5 /** Returns the authenticated user, or null if authentication is
7 function authenticate();
9 /** Called if the user is not authenticated as a registered
10 * user and if the page requires it.
11 * Should initiate whatever is appropriate to begin the authentication
12 * process (eg: displaying logon information).
13 * You may assume that no output has been sent to the client at
14 * the time that this function is called.
15 * Returns null if not supported, throw an exception if failed,
16 * else return a the authenticated user (if it can be determined
17 * by the time the function returns).
18 * If an alternate login page is displayed, this function should
19 * exit instead of returning.
21 function doAuthenticate($force = false);
23 /** Returns a list of available groups.
24 * Returns null if not supported, throw an exception if failed. */
25 function enumGroups();
27 /** Returns a list of groups that a given user belongs to.
28 * Returns null if not supported, throw an exception if failed. */
29 function getGroups($username);
31 /** Adds a user to a group.
32 * Returns null if not supported, throw an exception if failed,
33 * return true if succeeded */
34 function addToGroup($username, $groupname);
36 /** Removes a user from a group.
37 * Returns null if not supported, throw an exception if failed,
38 * return true if succeeded */
39 function removeFromGroup($username, $groupname);
41 /** Returns userdata for a given user id
42 * Some authentication mechanisms outsource the storage of user data.
43 * This function returns null if no additional information is available,
44 * or an array containing the following keys:
45 * email - the email address
46 * fullname - the full name
47 * avatar - URL to an avatar image
49 function getUserData($username);