Adam Griffiths' Open Source Libraries


Installation

Installing The Authentication Library is very simple, with only 3 steps to get going.

Step 1

Download the files from Github

Step 2

If this is your first time using the library, create a new database and run the query in dump.sql (MySQL only). This will set up the user table.

You will also need to change your base URL, and other general changes when using CodeIgniter. Please consult the CodeIgniter user guide directly.

Open up config.php and set $config['sess_use_database'] to TRUE.

Open up routes.php and copy The Authentication Library routes over to your own application's routes.php file.

Note:  You need to set an encryption key in the config.php file. Once this is set you must not change it as this will break your application.

Step 3

Try out The Authentication Library! Navigate to http://yourdomain.ext/index.php/register to set up a new user account. You should go into PHPMyAdmin or another equivalent package and edit the group_id to 1, so that the first user is an administrator.

To make things easier to work with and build upon the last version of The Authentication Library I have added the SQL for the groups table to both the dump.sql and upgrade.sql file. This will help when developing applications that need to show user groups.

Note:  The 'id' field is not set to auto-increment. Bare this in mind when developing an application to add groups etc.

Step 4

In many cases you may want to store your models, views and controllers in a sub folder for The Authentication Library Admin Panel. If this is the case (or you have changed the folder name from the default value) you can change these values inside of config/Auth.php.