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