ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjGroupAccess Class Reference

Class ilObjGroupAccess. More...

+ Inheritance diagram for ilObjGroupAccess:
+ Collaboration diagram for ilObjGroupAccess:

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)
 _getCommands ()
 get commands
 _checkGoto ($a_target)
 check whether goto script will succeed
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data.
- Public Member Functions inherited from ilObjectAccess
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id=0)
 check condition

Static Public Member Functions

static _registrationEnabled ($a_obj_id)
- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten.

Detailed Description

Class ilObjGroupAccess.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilObjGroupAccess.php 29180 2011-05-21 13:43:59Z akill

Definition at line 15 of file class.ilObjGroupAccess.php.

Member Function Documentation

ilObjGroupAccess::_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 29 of file class.ilObjGroupAccess.php.

References $lng, ilWaitingList\_isOnList(), and ilGroupParticipants\_isParticipant().

{
global $ilUser, $lng, $rbacsystem, $ilAccess;
if ($a_user_id == "")
{
$a_user_id = $ilUser->getId();
}
switch ($a_cmd)
{
case "info":
include_once './Modules/Group/classes/class.ilGroupParticipants.php';
if(ilGroupParticipants::_isParticipant($a_ref_id,$a_user_id))
{
$ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("info_is_member"));
}
else
{
$ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("info_is_not_member"));
}
break;
case "join":
include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
if(ilGroupWaitingList::_isOnList($ilUser->getId(), $a_obj_id))
{
return false;
}
include_once './Modules/Group/classes/class.ilGroupParticipants.php';
if(ilGroupParticipants::_isParticipant($a_ref_id,$a_user_id))
{
return false;
}
break;
case 'leave':
// Regular member
if($a_permission == 'leave')
{
include_once './Modules/Group/classes/class.ilGroupParticipants.php';
if(!ilGroupParticipants::_isParticipant($a_ref_id, $a_user_id))
{
return false;
}
}
// Waiting list
if($a_permission == 'join')
{
include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
if(!ilGroupWaitingList::_isOnList($ilUser->getId(), $a_obj_id))
{
return false;
}
}
break;
}
switch ($a_permission)
{
}
return true;
}

+ Here is the call graph for this function:

ilObjGroupAccess::_checkGoto (   $a_target)

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 146 of file class.ilObjGroupAccess.php.

{
global $ilAccess,$ilUser;
// registration codes
if(substr($t_arr[2],0,5) == 'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
{
return true;
}
$t_arr = explode("_", $a_target);
if ($t_arr[0] != "grp" || ((int) $t_arr[1]) <= 0)
{
return false;
}
if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
$ilAccess->checkAccess("visible", "", $t_arr[1]))
{
return true;
}
return false;
}
ilObjGroupAccess::_getCommands ( )

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Reimplemented from ilObjectAccess.

Definition at line 112 of file class.ilObjGroupAccess.php.

References ilDAVActivationChecker\_isActive(), and ilDAVUtils\getInstance().

Referenced by ilObjGroupListGUI\init().

{
$commands = array();
$commands[] = array("permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true);
$commands[] = array("permission" => "join", "cmd" => "join", "lang_var" => "join");
// on waiting list
$commands[] = array('permission' => "join", "cmd" => "leave", "lang_var" => "leave_waiting_list");
// regualar users
$commands[] = array('permission' => "leave", "cmd" => "leave", "lang_var" => "grp_btn_unsubscribe");
include_once ('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
{
include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
if(ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired())
{
$commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
}
else
{
$commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
}
}
$commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "edit");
return $commands;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroupAccess::_preloadData (   $a_obj_ids,
  $a_ref_ids 
)

Preload data.

Parameters
array$a_obj_idsarray of object ids

Reimplemented from ilObjectAccess.

Definition at line 221 of file class.ilObjGroupAccess.php.

References $ilDB, and ilWaitingList\_preloadOnListInfo().

{
global $ilDB, $ilUser;
include_once("./Modules/Group/classes/class.ilGroupWaitingList.php");
ilGroupWaitingList::_preloadOnListInfo($ilUser->getId(), $a_obj_ids);
}

+ Here is the call graph for this function:

static ilObjGroupAccess::_registrationEnabled (   $a_obj_id)
static
Returns
Parameters
object$a_obj_id

Definition at line 177 of file class.ilObjGroupAccess.php.

References $ilDB, $query, $res, $row, ilDateTime\_after(), ilDateTime\_before(), DB_FETCHMODE_OBJECT, IL_CAL_DATETIME, and IL_CAL_UNIX.

Referenced by ilObjGroup\register().

{
global $ilDB;
$query = "SELECT * FROM grp_settings ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
$res = $ilDB->query($query);
$enabled = $unlimited = false;
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$enabled = $row->registration_enabled;
$unlimited = $row->registration_unlimited;
$start = $row->registration_start;
$end = $row->registration_end;
}
if(!$enabled)
{
return false;
}
if($unlimited)
{
return true;
}
if(!$unlimited)
{
$start = new ilDateTime($start,IL_CAL_DATETIME,'UTC');
$end = new ilDateTime($end,IL_CAL_DATETIME,'UTC');
$time = new ilDateTime(time(),IL_CAL_UNIX);
return ilDateTime::_after($time, $start) and ilDateTime::_before($time,$end);
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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