
Public Member Functions | |
| __construct () | |
| INSERT BRIEF DESCRIPTION HERE. | |
| authenticateWith ($realm, $username, $password) | |
| Attempt to authenticate the user to a named realm using the given credentials. | |
| commit () | |
| deAuthenticateAll () | |
| De-authenticate a user from all realms. | |
| deAuthenticateFor ($realm) | |
| De-authenticate a user from the named realm. | |
| doc () | |
| Return documentation for this class (for error messages). | |
| getAttributes () | |
| getAuthModule ($name) | |
| Get an authentication module, based on the name of its realm. | |
| getEmail () | |
| Fetch the user's email from the active authentication module. | |
| getFirstName () | |
| Fetch the user's first name from the active authentication module. | |
| getLastName () | |
| Fetch the user's last name from the active authentication module. | |
| getRealmClassName ($realm) | |
| Get the name of the authentication module for a given realm. | |
| getRole () | |
| Fetch the user's role from the active authentication module. | |
| getUniqueAttributes () | |
| isAuthenticated () | |
| Check whether the user is authenticated to any realm. | |
| isAuthenticatedFor ($realm) | |
| Check whether a user is authenticated for a given realm. | |
| populate () | |
Protected Member Functions | |
| addAuthRealm ($realm, $mod, $username) | |
| Add an authenticated realm to this object. | |
Protected Attributes | |
| $firstName | |
| The first name of the user as a string. | |
| $flash | |
| The list of messages waiting to be displayed to the user. | |
| $id | |
| The user's id for persistant storage -- i.e., database primary key. | |
| $lastName | |
| The last name of the user as a string. | |
| $role | |
| The user's current role (changes based on their login status). | |
| $sessionData | |
| Misc session data stored for this user by web app controllers. | |
| $userName | |
| The username of the user for login. | |
The global user object represents a user of the Shodor website. An instance of the object is created and stored in the session of each new user visiting a Shodor site. This object then follows a user from project to project and keeps track of their authentication realms -- for what realms within Shodor they have successfully signed in.
Projects can ask for this global authentication information, for example to decide what roles to grant the user within the project.
The global user object also stores a global username and name to the user (assigned at time of authentication to the first auth realm)
Definition at line 22 of file SGlobalUser.php5.
| SGlobalUser::__construct | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Reimplemented from SObject.
Definition at line 39 of file SGlobalUser.php5.
| SGlobalUser::addAuthRealm | ( | $ | realm, | |
| $ | mod, | |||
| $ | username | |||
| ) | [protected] |
Add an authenticated realm to this object.
For internal use only.
Add a successfully authenticated auth module to this object's array of auth realms.
| $realm | [string]: The name of the realm (i.e., 'ldap', 'cserd', 'ncsi') | |
| $mod | [SAuthModule]: The auth module, a subclass of SAuthModule | |
| $username | [string]: The username used to authenticate to this realm (depricated) |
Definition at line 270 of file SGlobalUser.php5.
Referenced by authenticateWith().
| SGlobalUser::authenticateWith | ( | $ | realm, | |
| $ | username, | |||
| $ | password | |||
| ) |
Attempt to authenticate the user to a named realm using the given credentials.
Attempt to authenticate the user to a named realm (i.e., 'ldap', 'cserd', 'ncsi'), given the username and password provided. If the user's credentials are valid, add the realm to this global user's list of successfully authenticated realms and return true. Otherwise, return false.
| $realm | [string]: The name of the realm (i.e., 'ldap', 'cserd', 'ncsi') | |
| $username | [string]: The username with which to authenticate the user | |
| $password | [TYPE]: The password with which to authenticate the user |
Definition at line 192 of file SGlobalUser.php5.
References addAuthRealm(), getRealmClassName(), and SObject::setPrettyWarning().
| SGlobalUser::commit | ( | ) |
For internal use only.
Cannot commit this object
Reimplemented from SModel.
Definition at line 80 of file SGlobalUser.php5.
| SGlobalUser::deAuthenticateAll | ( | ) |
De-authenticate a user from all realms.
Reset our list of successfully authenticated realms to be blank (i.e., logout of all realms)
Definition at line 238 of file SGlobalUser.php5.
| SGlobalUser::deAuthenticateFor | ( | $ | realm | ) |
De-authenticate a user from the named realm.
If a user is authenticated to the specified realm, remove it from our list of successfully authenticated realms (i.e., logout of that realm, but not others).
| $realm | [string]: The name of the realm (i.e., 'ldap', 'cserd', 'ncsi') |
Definition at line 229 of file SGlobalUser.php5.
| SGlobalUser::doc | ( | ) |
Return documentation for this class (for error messages).
Reimplemented from SUser.
Definition at line 49 of file SGlobalUser.php5.
| SGlobalUser::getAttributes | ( | ) |
| SGlobalUser::getAuthModule | ( | $ | name | ) |
Get an authentication module, based on the name of its realm.
For any realm that we are successfully authenticated within, get the auth module used to do the authentication.
| $name | [string]: The name of the realm (i.e., 'ldap', 'cserd', 'ncsi') |
Definition at line 286 of file SGlobalUser.php5.
| SGlobalUser::getEmail | ( | ) |
Fetch the user's email from the active authentication module.
Definition at line 123 of file SGlobalUser.php5.
References SUser::reset().
| SGlobalUser::getFirstName | ( | ) |
Fetch the user's first name from the active authentication module.
Definition at line 93 of file SGlobalUser.php5.
References SUser::reset().
| SGlobalUser::getLastName | ( | ) |
Fetch the user's last name from the active authentication module.
Definition at line 108 of file SGlobalUser.php5.
References SUser::reset().
| SGlobalUser::getRealmClassName | ( | $ | realm | ) |
Get the name of the authentication module for a given realm.
Return the name of the expected authentication module class as a string. All auth modules are named based on their realm as follows: 'ldap' => 'SLdapAuthModule' ('S' + upper-case-first realm + 'AuthModule')
| $realm | [string]: The name of the realm (i.e., 'ldap', 'cserd', 'ncsi') |
Definition at line 254 of file SGlobalUser.php5.
Referenced by authenticateWith().
| SGlobalUser::getRole | ( | ) |
Fetch the user's role from the active authentication module.
Definition at line 135 of file SGlobalUser.php5.
References SUser::reset().
| SGlobalUser::getUniqueAttributes | ( | ) |
| SGlobalUser::isAuthenticated | ( | ) |
Check whether the user is authenticated to any realm.
Return true if the user has successfully authenticated to at least one realm, and false otherwise.
Definition at line 175 of file SGlobalUser.php5.
| SGlobalUser::isAuthenticatedFor | ( | $ | realm | ) |
Check whether a user is authenticated for a given realm.
Check to see whether a user has logged in successfully under a given authentication realm. Return true if the requested realm is found under the list of successfully authenticated realms.
| $realm | [string]: The name of the realm (i.e., 'ldap', 'cserd', 'ncsi') |
Definition at line 159 of file SGlobalUser.php5.
| SGlobalUser::populate | ( | ) |
1.5.6