Class Sylar_Session

Description

Gestione Sessione e Permessi.

La classe gestisce la sessione Web dell'utente e utilizza vari oggetti globali per la gestione dei $Log, utilizza la classe DataBase, ecc...

Located in /sylar/classes/common/security/Session.php (line 41)


	
			
Method Summary
 Sylar_Session __construct ()
 void __destruct ()
 string getSessionID ()
 array getSessionObj ()
 mixed getSessionParam (string $parametro)
 string getStorageMethod ()
 integer getUniqueID ()
 boolean hasUserPermissionCode (string $permission_code)
 boolean hasUserPermissionId (int $permission_id)
 boolean isUserLogged ()
 boolean isUserMemberOfGroupId (int $user_id)
 boolean login (string $password, [string $username = null], [mixed $email = null], [mixed $userid = null])
 boolean logout ()
 object provideSessionStorageObject ([mixed $methodName = "db"])
 void setEncryptPwdMethod ([string $methodName = 'md5'])
 mixed setSessionParam (string $parametro, mixed $valore)
 void setStorageMethod ([string $methodName = "db"])
Methods
Constructor __construct (line 49)
Sylar_Session __construct ()
Destructor __destruct (line 55)
void __destruct ()
getEncryptPwdMethod (line 83)

it returns the method sets for password encription

string getEncryptPwdMethod ()
getSessionID (line 552)

return the id of session

string getSessionID ()
getSessionObj (line 565)

returns the Session Object. In Sylar is an Array

array getSessionObj ()
getSessionParam (line 479)

return the value of session param.

mixed getSessionParam (string $parametro)
  • string $parametro: name of param.
getSessionStatusDump (line 517)

return a dump of session status converted into a formatted string.

string getSessionStatusDump ()
getStorageMethod (line 539)

get the storage method of user data

  • access: public
  • todo: Implements method different from db like csv, xml etc...
  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • since: 16/feb/08
string getStorageMethod ()
getUniqueID (line 608)

get a unique id for the user session.

integer getUniqueID ()
hasUserPermissionCode (line 375)

it controls permissions associati user by permission_code

  • access: public
  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • since: 16/feb/08
  • see: Sylar_iSessionStorage::loadUserPermissions($user_id)
  • see: Sylar_Session::login($username, $password)
boolean hasUserPermissionCode (string $permission_code)
  • string $permission_code
hasUserPermissionId (line 350)

it controls permissions associated user by permission_id

  • access: public
  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • since: 16/feb/08
  • see: Sylar_iSessionStorage::loadUserPermissions($user_id)
  • see: Sylar_Session::login($username, $password)
boolean hasUserPermissionId (int $permission_id)
  • int $permission_id
isUserLogged (line 263)

check if a user is logged in session

This method can be override and modified as you need

boolean isUserLogged ()
isUserMemberOfGroupId (line 325)

it returns true if the user in session is member of specified group_id, false otherwise

  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • access: public
  • since: 16/feb/08
  • see: Sylar_iSessionStorage::loadUserGroups($user_id)
  • see: Sylar_Session::login($username, $password)
  • todo: to be done isUserMemberOfGroupName but Groups name must be unique?
boolean isUserMemberOfGroupId (int $user_id)
  • int $user_id
login (line 104)

User Login.

Effettua il login dell'utente passato al metodo. Aggiorna la sua sessione, lo stato sul db e logga l'azione nel DB. Gestisce in modo trasparente le varie tipologie di utenza come Operatore, Dipendente, ecc...

  • access: public
  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • since: 03-2005
  • todo: switch between the different storage methods. Now works only with DB
boolean login (string $password, [string $username = null], [mixed $email = null], [mixed $userid = null])
  • string $username: nome di login dell'utente
  • string $password: password di login dell'utente
logout (line 161)

Logout execute the logout process for the user passed

boolean logout ()
provideSessionStorageObject (line 286)

It returns an object that is an implementation of

interface iSessionStorage $methodName can assume:

  • db
  • csv

  • access: protected
  • todo: the rest of method software. Must implement the respective interfaces
  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • since: 16/feb/08
object provideSessionStorageObject ([mixed $methodName = "db"])
setEncryptPwdMethod (line 70)

it sets the method used to encrypt the password befor autenticate user

  • access: public
  • see: encryptPwd
  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • since: 16/feb/08
  • todo: actually only md5 method is avaiable.
void setEncryptPwdMethod ([string $methodName = 'md5'])
  • string $methodName
setSessionParam (line 464)

set the param value.

Set the value of Session param.

mixed setSessionParam (string $parametro, mixed $valore)
  • string $parametro: il nome del parametro da impostare.
  • mixed $valore: il valore da assegnare al parametro.
setStorageMethod (line 504)

set the storage method of user data

Possible value:

  • db
  • xml
  • csv
  • custom

  • access: public
  • author: Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  • since: 16/feb/08
  • todo: Implements other method different from db like file or other custom
void setStorageMethod ([string $methodName = "db"])
  • string $methodName

Documentation generated on Thu, 24 Apr 2008 16:14:20 +0200 by phpDocumentor 1.3.0RC3