Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 37 revisions

A simple security system [work in progress].

[h3] Introduction [/h3]

The sentry system uses a configurable database table, which is configurable and only saves minimal information to the session. I use the Sentry class in conjunction with the Filters_system.

The Sentry system is made up of the following components:

  • SentryLib core library class in the system\library\Sentry.php - SentryLib core library handles the heavy lifting of performing the security functions.

  • The initializer in the system\init\init_sentry.php - The Sentry installation script installs the sentry class once and only once.

  • The configuration in the system\application\config\sentry.php - The configuration allows you to set various configuration options and tailor the sentry library to your system without a lot of reworking of code.

  • The sentry helper file in system\helper\sentry.php - Sentry helper wraps SentryLib calls to make them easier to use from views.

  • The Sentry controller class in the system\application\controllers\sentry.php - System controller class routes calls to the SentryLib library.

  • View in the system\application\views\sentry

  • Database samples for MySQL user and country tables.

[h3] Features [/h3]

Login/logout functionality. Registration, with security code image and activation. Forgotten password reset. Auto-login via cookie.

[h3] Installation [/h3]

I would recommend installing the NativeSession and Sentry libraries to the system\libraries folder so that is is available across applications. The init script can handle the sentry system being in either the application or system libraries folder. Both the NativeSession and Sentry libraries should be set as autoloaded core libraries.

The zip file contains the Sentry and the NativeSession library files. If you wish to use it with the Filter system, see the Filters_system wiki. It also includes a sample filter.

[h3] Code [/h3]

[url=http://www.thzero.com/programming/codeignitor/sentry.zip]Sentry[/url] Category:Libraries

Clone this wiki locally