## /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

- author: Andrew McMillan <andrew@catalyst.net.nz>
- copyright: Catalyst IT Ltd
- license: GNU GPL v2

Includes
require_once ("DataUpdate.php") (line 31)
require_once ("AWLUtilities.php") (line 30)

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

- author: Andrew McMillan <andrew@catalyst.net.nz>
- copyright: Catalyst IT Ltd
- license: GNU GPL v2

Functions
AuthExternalAWL (line 162)

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

Use this as in the following example config snippet:

include('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 64)

Create default relationships

void CreateDefaultRelationships (string $username)

- string $username: The username of the user we are creating relationships for.

CreateHomeCalendar (line 37)

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 91)

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 Sat, 24 Oct 2009 12:40:37 +1300 by phpDocumentor 1.3.2