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

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

auth_functions_deprecated (line 31)
void auth_functions_deprecated ( $method, [ $message = null])

- $method
- $message

CreateDefaultRelationships (line 156)

Defunct function for creating default relationships.

void CreateDefaultRelationships (string $username)

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

CreateHomeCalendar (line 147)

Backward compatibility

void CreateHomeCalendar (unknown_type $username)

- unknown_type $username

CreateHomeCollections (line 71)

Creates some default home collections for the user.

void CreateHomeCollections (string $username)

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

getPrincipalByID (line 61)
void getPrincipalByID ( $principal_id, [ $use_cache = true])

- $principal_id
- $use_cache

getUserByEMail (line 51)
void getUserByEMail ( $email, [ $use_cache = true])

- $email
- $use_cache

getUserByID (line 56)
void getUserByID ( $user_no, [ $use_cache = true])

- $user_no
- $use_cache

getUserByName (line 46)
void getUserByName ( $username, [ $use_cache = true])

- $username
- $use_cache

UpdateUserFromExternal (line 192)

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 Mon, 24 Oct 2011 20:09:25 +1300 by phpDocumentor 1.4.3