## /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@mcmillan.net.nz>
- copyright: Catalyst IT Ltd, Morphoss Ltd
- license: GNU GPL v2 or later

Includes
require_once ("DataUpdate.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

- author: Andrew McMillan <andrew@mcmillan.net.nz>
- copyright: Catalyst IT Ltd, Morphoss Ltd
- license: GNU GPL v2 or later

Functions
AuthExternalAWL (line 145)

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

Defunct function for creating default relationships.

void CreateDefaultRelationships (string $username)

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

CreateHomeCalendar (line 35)

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

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 Thu, 25 Feb 2010 11:39:17 +1300 by phpDocumentor 1.3.2