File/inc/auth-functions.php

Description

The authentication handling plugins can be used by the Session class to provide authentication.

Each authenticate hook needs to:

  • Accept a username / password
  • Confirm the username / password are correct
  • Create (or update) a 'usr' record in our database
  • Return the 'usr' record as an object
  • Return === false when authentication fails
It can expect that:
  • Configuration data will be in $c->authenticate_hook['config'], which might be an array, or whatever is needed.
In order to be called:
  • This file should be included
  • $c->authenticate_hook['call'] should be set to the name of the plugin
  • $c->authenticate_hook['config'] should be set up with any configuration data for the plugin

Includes
 require_once ("DataUpdate.php") (line 29)
 require_once ("AWLUtilities.php") (line 28)

The authentication handling plugins can be used by the Session class to provide authentication.

Each authenticate hook needs to:

  • Accept a username / password
  • Confirm the username / password are correct
  • Create (or update) a 'usr' record in our database
  • Return the 'usr' record as an object
  • Return === false when authentication fails
It can expect that:
  • Configuration data will be in $c->authenticate_hook['config'], which might be an array, or whatever is needed.
In order to be called:
  • This file should be included
  • $c->authenticate_hook['call'] should be set to the name of the plugin
  • $c->authenticate_hook['config'] should be set up with any configuration data for the plugin

Functions
AuthExternalAWL (line 142)

Authenticate against a different PostgreSQL database which contains a usr table in the AWL format.

Use this as in the following example config snippet:

require_once('auth-functions.php'); $c->authenticate_hook = array( 'call' => 'AuthExternalAwl', 'config' => array( // A PgSQL database connection string for the database containing user records 'connection' => 'dbname=wrms host=otherhost port=5433 user=general', // Which columns should be fetched from the database 'columns' => "user_no, active, email_ok, joined, last_update AS updated, last_used, username, password, fullname, email", // a WHERE clause to limit the records returned. 'where' => "active AND org_code=7" ) );

void AuthExternalAWL ( $username,  $password)
  • $username
  • $password
CreateDefaultRelationships (line 63)

Create default relationships

void CreateDefaultRelationships (string $username)
  • string $username: The username of the user we are creating relationships for.
CreateHomeCalendar (line 36)

Create a default home calendar for the user.

void CreateHomeCalendar (string $username)
  • string $username: The username of the user we are creating relationships for.
UpdateUserFromExternal (line 90)

Update the local cache of the remote user details

void UpdateUserFromExternal ( &$usr, object $usr)
  • object $usr: The user details we read from the remote.
  • &$usr

Documentation generated on Tue, 18 Nov 2008 18:33:27 +1300 by phpDocumentor 1.3.2