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

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

Defunct function for creating default relationships.

void CreateDefaultRelationships (string $username)

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

CreateHomeCalendar (line 137)

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, [ $defult_timezone = null])

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

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

UpdateCollectionTimezones (line 178)
void UpdateCollectionTimezones ( $username, [ $new_timezone = null])

- $username
- $new_timezone

UpdateUserFromExternal (line 188)

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 Sun, 08 Jul 2012 12:53:46 +0000 by phpDocumentor 1.4.3