Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

Session Class Reference

The session class. More...

Inheritance diagram for Session:
DummyWebSession

List of all members.

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 = ""

Detailed Description

The session class.


Constructor & Destructor Documentation

Session::__construct ( trans  ) 

construct the session object, check validity

References $db, and initRights().


Member Function Documentation

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]
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().

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

Parameters:
$passwd unhashed password
Returns:
the salted password hash

References getSalt().

Referenced by WOCustomer::registerCustomer(), WOCustomer::resetLoginPage(), and setMyPasswd().

static Session::passwdVerify ( passwd,
hash 
) [static]

helper function to verify user or customer login

Parameters:
$passwd unhashed password
$hash salted password hash
Returns:
true on success, false on error or if the password does not match

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)


Member Data Documentation

Session::$flags = array() [protected]
Session::$rights = array() [protected]
Session::$roles = array() [protected]
Session::$sessid = "" [protected]
Session::$user = "" [protected]

The documentation for this class was generated from the following file: