class setup
To setup the class you need to define a few properties in the flexibleAccess class. For easier upgrade when a new version released you also have the ability to use an external source that load your settings. For more information click here.
Bellow is a list of directives and some explanations regarding them
Database settings
The database settings are the following:
var $dbName
The name of the database
var $dbHost
The host where the database server is
var $dbPort
The port the the database server listens to
var $dbUser
The database user
var $dbPass
Password for the database user
var $dbTable
The name of the table that the class will use.
var $tbFields
The $tbFields array holds the key fields of the database table we are using. As you can see in the default settings the array is like this :
var $tbFields = array(
'userID'=> 'userID',
'login' => 'username',
'pass' => 'password',
'email' => 'email',
'active'=> 'active'
);
The value for each array variable is the name of the field in the table. Those are the fields that the class needs to work. The userID which should be an auto_increment field, the login which is the field that holds the user name of the user, the pass that holds the password, the email (this is not really required) and the active which should hold a flag (0/1) if the user is active. If you don't want to use that feature, just use a field with the default value set to 1.
Session & Cookie settings
Here are the session and cookie related settings for the class:
var $sessionVariable
This is the name of the session variable that will be used by the script. In general you wont need to change that, but we've added it for more integration capabilities.
var $remTime
When the class remembers users, here we hold in seconds the time that the cookie will be alive. For sites that need high security that should be a small number, but for very high security you will need to disable that option at all.
var $remCookieName
This is the cookie variable that the script will use
var $remCookieDomain
In most cases you wont need to change that. But in case your site has many subdomains you should use something like var $remCookieDomain = '.mydomain.com';
Miscellaneous settings
var $passMethod
This variable holds the method that passwords are stored in the database. That could be 'sha1', 'md5' and 'nothing', where 'nothing' means that the password will be hold as is but please don't use that as it is very unsecure.
var $displayErrors
This is a true/false variable which is useful when you are debugging the script.
Setting up the class from external source
We recommend you to use this functionality of the php user class, as it gives you the best way to upgrade your installation with a new version of the class.
This feature is very easy to use. Just create an associative array with the form array( ClassProperty => Value) and use this in the initialization of the script like this : $user = new flexibleAccess('', $array);
The class will automatically use this settings upon initialization. Please read the class examples for more information

