The session class. More...
Public Member Functions | |
| __construct ($trans) | |
| construct the session object, check validity | |
| canExecute ($transaction) | |
| checks whether user can execute this transaction, returns true on success; it always returns true for admins | |
| checkFlags ($iflg) | |
| checks the given flags item pattern (string or array of strings) and returns true if they match | |
| deleteSession () | |
| delete current session | |
| getFlags () | |
| returns the flags of this user | |
| getRights () | |
| returns all rights of this user | |
| getRoles () | |
| returns all roles of this user | |
| getUser () | |
| returns the user name of the session | |
| hasFlag ($f) | |
| returns whether the user has a specific flag | |
| isAuthenticated () | |
| returns true if the session is actually authenticated | |
| isValid () | |
| returns true if the session exists, it may still be temporary and unauthenticated | |
| setMyPasswd ($trans) | |
| set my own password; called from SetMyPasswd transaction | |
Static Public Member Functions | |
| static | currentUserName () |
| return the name of the currently logged in user | |
| static | instance () |
| return the session instance | |
| static | login ($trans) |
| creates a new session, called from the Login transaction | |
| static | passwdHash ($passwd) |
| helper function to generate salted user or customer password hash | |
| static | passwdVerify ($passwd, $hash) |
| helper function to verify user or customer login | |
| static | setWebSession () |
| initialize system in web session mode (ie. | |
Protected Member Functions | |
| initRights () | |
| internal: retrieve and remember the rights, roles, and flags of this user | |
Protected Attributes | |
| $flags = array() | |
| $rights = array() | |
| $roles = array() | |
| $sessid = "" | |
| $user = "" | |
The session class.
| Session::__construct | ( | $ | trans | ) |
construct the session object, check validity
References $db, and initRights().
| Session::canExecute | ( | $ | transaction | ) |
checks whether user can execute this transaction, returns true on success; it always returns true for admins
References $db.
| Session::checkFlags | ( | $ | iflg | ) |
checks the given flags item pattern (string or array of strings) and returns true if they match
References hasFlag().
| static Session::currentUserName | ( | ) | [static] |
return the name of the currently logged in user
Referenced by WTvoucher_audit::newKey(), WTticket_audit::newKey(), WTorder_audit::newKey(), WTitem_audit::newKey(), and MSmokeTransaction::userName().
| Session::deleteSession | ( | ) |
delete current session
References $db.
| Session::getFlags | ( | ) |
returns the flags of this user
| Session::getRights | ( | ) |
returns all rights of this user
| Session::getRoles | ( | ) |
returns all roles of this user
| Session::getUser | ( | ) |
returns the user name of the session
| Session::hasFlag | ( | $ | f | ) |
returns whether the user has a specific flag
Referenced by checkFlags().
| Session::initRights | ( | ) | [protected] |
internal: retrieve and remember the rights, roles, and flags of this user
References $db.
Referenced by DummyWebSession::__construct(), and __construct().
| static Session::instance | ( | ) | [static] |
return the session instance
Referenced by WTrLogout::handleRequest(), WTrGetMyRoles::handleRequest(), WTrGetMyRights::handleRequest(), WTrChangeMyPassword::handleRequest(), MSmokeTransaction::isAuthenticated(), and MSmokeTransaction::isAuthorized().
| Session::isAuthenticated | ( | ) |
returns true if the session is actually authenticated
| Session::isValid | ( | ) |
returns true if the session exists, it may still be temporary and unauthenticated
| static Session::login | ( | $ | trans | ) | [static] |
creates a new session, called from the Login transaction
References $ClientSessionTimeout, $db, getRandom(), and translate().
Referenced by WTrLogin::handleRequest().
| static Session::passwdHash | ( | $ | passwd | ) | [static] |
helper function to generate salted user or customer password hash
| $passwd | unhashed password |
References getSalt().
Referenced by WOCustomer::registerCustomer(), WOCustomer::resetLoginPage(), and setMyPasswd().
| static Session::passwdVerify | ( | $ | passwd, | |
| $ | hash | |||
| ) | [static] |
helper function to verify user or customer login
| $passwd | unhashed password | |
| $hash | salted password hash |
Referenced by WOCustomer::checkLogin().
| Session::setMyPasswd | ( | $ | trans | ) |
set my own password; called from SetMyPasswd transaction
References $db, passwdHash(), and tr().
| static Session::setWebSession | ( | ) | [static] |
initialize system in web session mode (ie.
some user called the web page in a browser)
Session::$flags = array() [protected] |
Session::$rights = array() [protected] |
Session::$roles = array() [protected] |
Session::$sessid = "" [protected] |
Session::$user = "" [protected] |
1.7.1