Previous Next
EVS

Auth_Container_RSDB

Extended Container for PEAR::Auth based on Auth_Container_DB

Introduction

Auth_Container_RSDB extends Auth_Container_DB with two features. The first one is the ability to (de)activate a user. This is regarded as a very essential feature because you often have foreign key defined in other database tables linking to a certain user. The second is that you can choose if you want to use persistent connections or not.

Usage

The two features are represented by to new options:

  • 'activatedcol' - The name of the column that stores the information if a user account is acctivated (1) or deactivated(0).
  • 'persistent' - Whether to use persistent database connections.
The rest is pretty easy. Please see the manual of Auth for details.

1 <?php
2 /**PEAR::Auth is needed for authentication!
3 */
4 require_once('Auth/Auth.php');
5
6 $myAuthParams = array(
7 'dsn' => 'mysql://user:pass@localhost/mydb'
8 'table' => 't_auth',
9 'usernamecol' => 'f_username',
10 'passwordcol' => 'f_password',
11 'activatedcol' => 'f_activated',
12 'cryptType' => 'none',
13 'persistent' => true
14 );
15 $myAuth =& new Auth('RSDB', $myAuthParams, 'myLoginFunction');
16 ?>

Previous Next
EVS

Documentation generated on Mon, 8 Dec 2003 13:09:32 +0100 by phpDocumentor 1.2.3