Class CMS_session

Description

Class CMS_session

Keeps track of user session context and manage authentification with modules

Located in /automne/classes/user/session.php (line 25)

CMS_grandFather
   |
   --CMS_session
Class Constant Summary
Variable Summary
 static integer $_bookmark
 static integer $_pageID
 static boolean $_permanent
 static integer $_recordsPerPage
 static Zend_Auth_Result $_result
 static array $_token
 static integer $_userID
Method Summary
 static void authenticate ([array $params = array()])
 static boolean autoLoginSucceeded ()
 static boolean checkToken ( $name,  $token, string $name,, string $token,)
 static void deleteSession ([boolean $force = false])
 static boolean expireToken ( $name, string $name,)
 static Zend_Auth_Result getAuthResult ()
 static string getAutoLoginCookieName ()
 static integer getBookmark ()
 static string getContextHash ([ $datas = array()], array $datas,)
 static string getJSLocales ()
 static CMS_page getPage ()
 static integer getPageID ()
 static boolean getPermanent ()
 static integer getRecordsPerPage ()
 static array getSessionInfos ()
 static void getSessionVar (string $name)
 static string getToken ( $name, string $name,)
 static user getUser ()
 static integer getUserID ()
 static void init ()
 static void setBookmark (integer $bookmark)
 static void setCookie ( $name, [ $value = false], [ $expire = false], string $name,, string $value,, int $expire,)
 static void setPage ( &$page, CMS_page $page)
 static void setRecordsPerPage (integer $howMany)
 static void setSessionVar (string $name, mixed $value)
 static boolean tokenIsExpired ( $name, string $name,)
 CMS_session __construct ()
 void _cleanSessions ()
Variables
static integer $_bookmark = 1 (line 43)

Bookmark for a page of data

  • access: private
static integer $_pageID (line 59)

Page DB ID

  • access: private
static boolean $_permanent = false (line 75)

User use permanent session

  • access: private
static integer $_recordsPerPage = 30 (line 51)

How many per page of data by default ?

  • access: private
static Zend_Auth_Result $_result (line 83)

Authentification result

  • access: private
static array $_token (line 67)

User tokens

  • access: private
static integer $_userID = 0 (line 35)

User DB ID

  • access: private
Methods
static authenticate (line 169)

Authenticate user

This method can

  • authenticate user throught authentification process
  • load already authenticated user in current session (or SSO)
  • disconnect user

  • access: public
static void authenticate ([array $params = array()])
  • array $params: : indexed array of authentification parameters (default : nothing) Accepted array keys are :
    • authenticate : boolean : default true if disconnect is not set
    • disconnect : boolean : default false
    • login : string : user login to authenticate
    • password : string : user password to authenticate
    • remember : boolean : default false
    • tokenName : string
    • token : string
    • type : string : type of authentification (admin|frontend) : default APPLICATION_USER_TYPE contant
    • ... and any parameter needed by authentifications processes handled by modules
static autoLoginSucceeded (line 682)

Test auto login through cookie

  • return: true if autologin succeeded
  • access: public
static boolean autoLoginSucceeded ()
static checkToken (line 806)

Check a session token value for a given token name

  • return: : true if token is valid or false otherwise
  • access: public
static boolean checkToken ( $name,  $token, string $name,, string $token,)
  • string $name,: token name to check
  • string $token,: token value to check
  • $name
  • $token
static deleteSession (line 440)

Delete current session datas

  • access: public
static void deleteSession ([boolean $force = false])
  • boolean $force: : force removing persistent session (default false)
static expireToken (line 856)

Force a token expiration

  • access: public
static boolean expireToken ( $name, string $name,)
  • string $name,: token name to expire
  • $name
static getAuthResult (line 516)

Get authentification result

  • access: public
static Zend_Auth_Result getAuthResult ()
static getAutoLoginCookieName (line 669)

Get autologin cookie name

  • return: : the autologin cookie name
  • access: public
static string getAutoLoginCookieName ()
static getBookmark (line 541)

Get Bookmark

  • access: public
static integer getBookmark ()
static getContextHash (line 898)

Get current context hash (usually used for cache)

  • return: : the current context cache
  • access: public
static string getContextHash ([ $datas = array()], array $datas,)
  • array $datas,: additionnal datas to use for cache
  • $datas
static getJSLocales (line 731)

Get all JS locales for current user (in current language)

  • return: : JS locales
  • access: public
static string getJSLocales ()
static getPage (line 592)

Get Page

  • return: The page currently registered, false if none
  • access: public
static CMS_page getPage ()
static getPageID (line 607)

Get Page ID

  • access: public
static integer getPageID ()
static getPermanent (line 506)

Get permanent status for the session

  • access: public
static boolean getPermanent ()
static getRecordsPerPage (line 566)

Get the number of records per page

  • access: public
static integer getRecordsPerPage ()
static getSessionInfos (line 697)

Get current session infos

  • return: : the user session infos
  • access: public
static array getSessionInfos ()
static getSessionVar (line 636)

Gets session variable with name

  • access: public
static void getSessionVar (string $name)
  • string $name
static getToken (line 766)

Get a unique session token value for given token name

  • return: : Token value
  • access: public
static string getToken ( $name, string $name,)
  • string $name,: token name to get value
  • $name
static getUser (line 483)

Get user object

  • return: object
  • access: public
static user getUser ()
static getUserID (line 496)

Get user DB ID

  • access: public
static integer getUserID ()
static init (line 97)

Start session and load existant user if any

  • access: public
static void init ()
static setBookmark (line 527)

Set Bookmark

  • access: public
static void setBookmark (integer $bookmark)
  • integer $bookmark
static setCookie (line 652)

Sets a cookie given at least its name If value is empty, deletes cookie

  • access: public
static void setCookie ( $name, [ $value = false], [ $expire = false], string $name,, string $value,, int $expire,)
  • string $name,: cookie name
  • string $value,: the value to store
  • int $expire,: represents time in which cookie will expire if not set, expires at the end of the session
  • $name
  • $value
  • $expire
static setPage (line 577)

Set Page

  • access: public
static void setPage ( &$page, CMS_page $page)
static setRecordsPerPage (line 552)

Set The number of records per page

  • access: public
static void setRecordsPerPage (integer $howMany)
  • integer $howMany
static setSessionVar (line 623)

Sets session variable

  • access: public
static void setSessionVar (string $name, mixed $value)
  • string $name
  • mixed $value
static tokenIsExpired (line 873)

Check if a session token is expired for a given token name

  • return: : true if token is expired or false otherwise
  • access: public
static boolean tokenIsExpired ( $name, string $name,)
  • string $name,: token name to check
  • $name
Constructor __construct (line 88)

Constructor overriding - make sure that a developer cannot instantiate

CMS_session __construct ()
_cleanSessions (line 387)

Clean old sessions datas

  • access: private
void _cleanSessions ()

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
MESSAGE_USER_JS_LOCALES = 1547 (line 27)

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:39:14 +0100 by phpDocumentor 1.4.3