ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjSessionAccess Class Reference
+ Inheritance diagram for ilObjSessionAccess:
+ Collaboration diagram for ilObjSessionAccess:

Public Member Functions

 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 
checks wether a user may invoke a command or not

(this method is called by ilAccessHandler::checkAccess)

 _checkGoto ($a_target)
 check whether goto script will succeed
- Public Member Functions inherited from ilObjectAccess
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id=0)
 check condition
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data.

Static Public Member Functions

 _getCommands ()
 get list of command/permission combinations
static _lookupRegistration ($a_obj_id)
 lookup registrations
static _lookupRegistered ($a_usr_id, $a_obj_id)
 lookup if user has registered
- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten.

Static Protected Attributes

static $registrations = null
static $registered = null

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 34 of file class.ilObjSessionAccess.php.

Member Function Documentation

ilObjSessionAccess::_checkAccess (   $a_cmd,
  $a_permission,
  $a_ref_id,
  $a_obj_id,
  $a_user_id = "" 
)

checks wether a user may invoke a command or not

(this method is called by ilAccessHandler::checkAccess)

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Reimplemented from ilObjectAccess.

Definition at line 72 of file class.ilObjSessionAccess.php.

References $ilUser, $lng, and _lookupRegistered().

{
global $ilUser, $lng, $rbacsystem, $ilAccess;
$a_user_id = $a_user_id ? $a_user_id : $ilUser->getId();
switch($a_cmd)
{
case 'register':
if(self::_lookupRegistration($a_obj_id)&& $a_user_id != ANONYMOUS_USER_ID)
{
return !self::_lookupRegistered($a_user_id,$a_obj_id);
}
return false;
case 'unregister':
if(self::_lookupRegistration($a_obj_id) && $a_user_id != ANONYMOUS_USER_ID)
{
return self::_lookupRegistered($a_user_id,$a_obj_id);
}
return false;
}
return true;
}

+ Here is the call graph for this function:

ilObjSessionAccess::_checkGoto (   $a_target)

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 100 of file class.ilObjSessionAccess.php.

{
global $ilAccess;
$t_arr = explode("_", $a_target);
if ($t_arr[0] != "sess" || ((int) $t_arr[1]) <= 0)
{
return false;
}
if($ilAccess->checkAccess("read", "", $t_arr[1]))
{
return true;
}
return false;
}
ilObjSessionAccess::_getCommands ( )
static

get list of command/permission combinations

public

Returns
array

Reimplemented from ilObjectAccess.

Definition at line 46 of file class.ilObjSessionAccess.php.

Referenced by ilObjSessionListGUI\init().

{
$commands = array
(
array("permission" => "read", "cmd" => "infoScreen", "lang_var" => "info_short", "default" => true),
array("permission" => "read", "cmd" => "register", "lang_var" => "join_session"),
array("permission" => "read", "cmd" => "unregister", "lang_var" => "event_unregister"),
array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"),
array('permission' => 'write', 'cmd' => 'members', 'lang_var' => 'event_edit_members')
);
return $commands;
}

+ Here is the caller graph for this function:

static ilObjSessionAccess::_lookupRegistered (   $a_usr_id,
  $a_obj_id 
)
static

lookup if user has registered

public

Parameters
intusr_id
intobj_id
Returns

Definition at line 153 of file class.ilObjSessionAccess.php.

References $ilUser, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by _checkAccess().

{
if(isset(self::$registered[$a_usr_id]))
{
return (bool) self::$registered[$a_usr_id][$a_obj_id];
}
global $ilDB,$ilUser;
$query = "SELECT event_id, registered FROM event_participants WHERE usr_id = ".$ilDB->quote($ilUser->getId(),'integer');
$res = $ilDB->query($query);
self::$registered[$a_usr_id] = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
self::$registered[$a_usr_id][$row->event_id] = (bool) $row->registered;
}
return (bool) self::$registered[$a_usr_id][$a_obj_id];
}

+ Here is the caller graph for this function:

static ilObjSessionAccess::_lookupRegistration (   $a_obj_id)
static

lookup registrations

public

Parameters
@return

Definition at line 126 of file class.ilObjSessionAccess.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
if(!is_null(self::$registrations))
{
return self::$registrations[$a_obj_id];
}
global $ilDB;
$query = "SELECT registration,obj_id FROM event ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
self::$registrations[$row->obj_id] = (bool) $row->registration;
}
return self::$registrations[$a_obj_id];
}

Field Documentation

ilObjSessionAccess::$registered = null
staticprotected

Definition at line 37 of file class.ilObjSessionAccess.php.

ilObjSessionAccess::$registrations = null
staticprotected

Definition at line 36 of file class.ilObjSessionAccess.php.


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