3 * Authentication handling class
5 * This class provides a basic set of methods which are used by the Session
6 * class to provide authentication.
8 * This class is expected to be replaced, overridden or extended in some
9 * instances to enable different pluggable authentication methods.
12 * @subpackage AuthPlugin
13 * @author Andrew McMillan <andrew@catalyst.net.nz>
14 * @copyright Catalyst IT Ltd
15 * @license http://gnu.org/copyleft/gpl.html GNU GPL v2
19 * A class for authenticating and retrieving user information
39 * Create a new AuthPlugin object. This is as lightweight as possible.
41 * @param array $authparams An array of parameters used for this authentication method.
43 function AuthPlugin( $authparams ) {
44 $this->success
= false;
48 * Authenticate. Do whatever we need to authenticate a username / password.
50 * @param string $username The username of the person attempting to log in
51 * @param string $password The password the person is trying to log in with
52 * @return object The "user" object, containing fields matching the 'usr' database table
54 function Authenticate( $username, $password ) {
60 * This could also be done as a process of "registering" functions to perform the authentication,
61 * so in the Session we call something to (e.g.) do the authentication and that looks in (e.g.)
62 * $c->authenticate_hook for a function to be called, or it just does the normal thing if
64 * It might be a better way. I think I need to bounce these two ideas off some other people...
66 * In either case Session will need to split the fetching of session data from the fetching of
67 * usr data. So I'll look at doing that first.