Topics
Simple User Access Control System is designed as a wrapper in which to encase other programs such as a message board or file access system.
It is written in PHP, and designed to be highly and easily customize. It handles the user login and management, and passes all other requests as
determined by the GET data to a function defined by the person extending it, thereby handling the security and allowing the developer to work on the
other, perhaps more interesting sections of code.
This piece of software requires the following:
- PHP
- MySQL
Please note that other DBs may work, but have not been tested.
To extend (ie. utilize) the wrapper, edit the file ./include/process.php as you see fit. The only GET key used by the
wrapper is action. Use of the non-reserved (ie. not already in use) values for that variable is possible, however it is reccomended that
a different variable be used. A list of the reserved variables/values can be found below. When not calling for a reserved action, a logged in user
results in a call to the function process( ) in ./include/process.php from which all other functionality should be extended. A basic set of
data is sent to the function as parameters, but other information can be easily gathered from the PHP arrays $_POST and $_GET. A
session has already been initialized, and variables other than user may be written to it for storage.
As far as extending the DB, I would
suggest that you reference the existing user table with one of your own, which will allow the easy addition of more information. Editing the current
table might result in messy effects.
Reserved Variables/Values:
- $_SESSION[user], all values
- $CONFIG[dbname, dbpass, dbserver, dbuser, prefix, prelogin, prelogout, salt, title], all values
- $_POST[action], values of: add, chpw, delete, edit, logout, pass, users
- $_GET[], various values when directed to
To install, follow these steps:
- Create a database, and make note of the login credentials.
- Edit the configuration file located at ./include/config.php to reflect the DB login credentials. Also update the variable prefix to reflect
the desired table prefix and the salt variable to change the password salt used. DO NOT EDIT THESE VARIABLES FROM HERE ON OUT
- Edit the variables title, preloginand prelogout to reflect the desired information. These variables MAY be edited at any time.
- Save and close the configuration file.
- Direct your broswer to ./install.php and the database will be initialized if possible.
- You will be redirected to the index. Login using username: admin and password: password
- Enjoy.
Simple User Access Control System was originally written by Matt Berntsen in
October of 2005.