DAViCal
 All Classes Namespaces Functions Variables Pages
DAViCalSession Class Reference
Inheritance diagram for DAViCalSession:
Collaboration diagram for DAViCalSession:

Public Member Functions

 __construct ($sid='')
 
 AssignSessionDetails ($u)
 
 GetRoles ()
 
 HavePrivilegeTo ($do_what, $path, $any=null)
 
 LoginRequired ($roles= '')
 

Public Attributes

 $principal_id
 

Private Attributes

 $privilege_resources = array()
 

Detailed Description

Definition at line 48 of file DAViCalSession.php.

Constructor & Destructor Documentation

DAViCalSession::__construct (   $sid = '')

Create a new DAViCalSession object.

We create a Session and extend it with some additional useful DAViCal related information.

Parameters
string$sidA session identifier.

Definition at line 62 of file DAViCalSession.php.

Member Function Documentation

DAViCalSession::AssignSessionDetails (   $u)

Internal function used to assign the session details to a user's new session.

Parameters
object$uThe user+session object we (probably) read from the database.

Definition at line 72 of file DAViCalSession.php.

DAViCalSession::GetRoles ( )

Method used to get the user's roles

Definition at line 92 of file DAViCalSession.php.

DAViCalSession::HavePrivilegeTo (   $do_what,
  $path,
  $any = null 
)

Does the user have the privileges to do what is requested.

Parameters
$do_whatmixed The request privilege name, or array of privilege names, to be checked.
$pathstring The path we want that permission for
$anyboolean Whether we accept any of the privileges. The default is true, unless the requested privilege is 'all', when it is false.
Returns
boolean Whether they do have one of those privileges against the specified path.

Definition at line 111 of file DAViCalSession.php.

DAViCalSession::LoginRequired (   $roles = '')

Checks that this user is logged in, and presents a login screen if they aren't.

The function can optionally confirm whether they are a member of one of a list of roles, and deny access if they are not a member of any of them.

Parameters
string$rolesThe list of roles that the user must be a member of one of to be allowed to proceed.
Returns
boolean Whether or not the user is logged in and is a member of one of the required roles.

We allow basic auth to apply also, if present, though we check everything else first...

Definition at line 134 of file DAViCalSession.php.


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