1: <?php
2: /**
3: * Authentication handling class
4: *
5: * This class provides a basic set of methods which are used by the Session
6: * class to provide authentication.
7: *
8: * This class is expected to be replaced, overridden or extended in some
9: * instances to enable different pluggable authentication methods.
10: *
11: * @package awl
12: * @subpackage AuthPlugin
13: * @author Andrew McMillan <andrew@mcmillan.net.nz>
14: * @copyright Catalyst IT Ltd
15: * @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
16: */
17:
18: /**
19: * A class for authenticating and retrieving user information
20: *
21: * @package awl
22: */
23: class AuthPlugin
24: {
25: /**#@+
26: * @access private
27: */
28: var $usr;
29: var $success;
30: /**#@-*/
31:
32: /**#@+
33: * @access public
34: */
35:
36: /**#@-*/
37:
38: /**
39: * Create a new AuthPlugin object. This is as lightweight as possible.
40: *
41: * @param array $authparams An array of parameters used for this authentication method.
42: */
43: function AuthPlugin( $authparams ) {
44: $this->success = false;
45: }
46:
47: /**
48: * Authenticate. Do whatever we need to authenticate a username / password.
49: *
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
53: */
54: function Authenticate( $username, $password ) {
55: }
56:
57: }
58: /**
59: * Notes:
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
63: * that is not set.
64: * It might be a better way. I think I need to bounce these two ideas off some other people...
65: *
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.
68: */
69:
70: