UserClass to manipulate and authenticate users. All details of user management, including checking authentication, should be done through this class. InheritsSummary
exportVars
Convenience function to export relevant user data to a template. Sets the username, full name, e-mail, homepage, and display name in template variables USER_ID, USER_NAME, USER_EMAIL, USER_HOMEPAGE, and USER_DISPLAY_NAME respectively. Parameters
login
Logs the user in. Note that there are two login methods available, with the one used being determined by the AUTH_USE_SESSION configuration constant. Parameters
ReturnsFalse if the authentication fails, true otherwise. logout
Logs the user out and destroys login tokens. Note that this is also subject to AUTH_USE_SESSION isAdministrator
Determines if the user is the system administrator. ReturnsTrue if the username is the same as that of the system administrator, false otherwise. Note that the system administrator’s username is controlled by the ADMIN_USER configuration constant. |
Convenience function to export relevant user data to a template.
function exportVars( & $tpl )
Checks if a password is valid for the current user.
function checkPassword( $pass )
Save changes to user data.
function save()
Set or return the user’s password>
function password( $pwd = false )
Set or return the username.
function username( $uid = false )
Set or return the user’s long name.
function name( $nm = false )
Returns a name to display.
function displayName()
Set or return the user’s e-mail address.
function email( = false )
Set or return the user’s homepage.
function homepage( $url = false )
Lists the groups to which the user belongs.
function groups()
Gets or sets the default group for this user.
function defaultGroup( $val = false )
Adds the user to the specified group.
function addToGroup( $groupname )
Logs the user in.
function login( $pwd )
Logs the user out and destroys login tokens.
function logout()
Checks tokens to determine if the user is logged in.
function checkLogin( $uname = false )
Determines if the user is the system administrator.
function isAdministrator()