Class ilObjGroupAccess.
More...
|
| _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) More...
|
|
| _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) More...
|
|
| _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id) |
| check condition More...
|
|
◆ _checkAccess()
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_cmd | command (not permission!) |
string | $a_permission | permission |
int | $a_ref_id | reference id |
int | $a_obj_id | object id |
int | $a_user_id | user id (if not provided, current user is taken) |
- Returns
- boolean true, if everything is ok
Definition at line 30 of file class.ilObjGroupAccess.php.
References $ilUser, $lng, ilWaitingList\_isOnList(), ilGroupParticipants\_isParticipant(), ilDatePresentation\formatDate(), and ilObjGroup\mayLeave().
37 $a_user_id = $ilUser->getId();
44 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
47 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt(
"info_is_member"));
51 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt(
"info_is_not_member"));
57 if(!self::_registrationEnabled($a_obj_id))
62 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
68 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
78 if($a_permission ==
'leave')
80 include_once
'./Modules/Group/classes/class.ilObjGroup.php';
84 $ilAccess->addInfoItem(IL_STATUS_MESSAGE,
89 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
96 if($a_permission ==
'join')
98 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
108 switch ($a_permission)
111 include_once
'./Modules/Group/classes/class.ilObjGroup.php';
static mayLeave($a_group_id, $a_user_id=null, &$a_date=null)
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
static formatDate(ilDateTime $date)
Format a date public.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
◆ _checkGoto()
static ilObjGroupAccess::_checkGoto |
( |
|
$a_target | ) |
|
|
static |
check whether goto script will succeed
Definition at line 176 of file class.ilObjGroupAccess.php.
References $ilUser.
180 $t_arr = explode(
"_", $a_target);
182 if(substr($t_arr[2],0,5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID)
184 self::$using_code =
true;
188 if ($t_arr[0] !=
"grp" || ((
int) $t_arr[1]) <= 0)
193 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
194 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
◆ _getCommands()
static ilObjGroupAccess::_getCommands |
( |
| ) |
|
|
static |
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"), );
Definition at line 129 of file class.ilObjGroupAccess.php.
References ilDAVActivationChecker\_isActive(), array, ilFMSettings\getInstance(), and ilDAVUtils\getInstance().
Referenced by ilObjGroupReferenceAccess\_getCommands(), and ilObjGroupListGUI\init().
132 $commands[] =
array(
"permission" =>
"grp_linked",
"cmd" =>
"",
"lang_var" =>
"show",
"default" =>
true);
134 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
138 'permission' =>
'read',
139 'cmd' =>
'fileManagerLaunch',
140 'lang_var' =>
'fm_start',
141 'enable_anonymous' =>
false 145 $commands[] =
array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
148 $commands[] =
array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
151 $commands[] =
array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"grp_btn_unsubscribe");
153 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
156 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
159 $commands[] =
array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
163 $commands[] =
array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
167 $commands[] =
array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
168 $commands[] =
array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
static _isActive()
Static getter.
Create styles array
The data for the language used.
static getInstance()
Get singleton instance.
static getInstance()
Get singleton instance.
◆ _preloadData()
static ilObjGroupAccess::_preloadData |
( |
|
$a_obj_ids, |
|
|
|
$a_ref_ids |
|
) |
| |
|
static |
◆ _registrationEnabled()
static ilObjGroupAccess::_registrationEnabled |
( |
|
$a_obj_id | ) |
|
|
static |
- Returns
- Parameters
-
Definition at line 206 of file class.ilObjGroupAccess.php.
References $ilDB, $query, $res, $row, $start, ilDateTime\_after(), ilDateTime\_before(), ilDBConstants\FETCHMODE_OBJECT, IL_CAL_DATETIME, IL_CAL_UNIX, and time.
210 $query =
"SELECT * FROM grp_settings ".
211 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
215 $enabled = $unlimited =
false;
218 $enabled =
$row->registration_enabled;
219 $unlimited =
$row->registration_unlimited;
221 $end =
$row->registration_end;
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
◆ _usingRegistrationCode()
static ilObjGroupAccess::_usingRegistrationCode |
( |
| ) |
|
|
static |
◆ lookupRegistrationInfo()
static ilObjGroupAccess::lookupRegistrationInfo |
( |
|
$a_obj_id | ) |
|
|
static |
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
- Parameters
-
- Returns
- array
Definition at line 266 of file class.ilObjGroupAccess.php.
References $ilDB, $ilUser, $info, $lng, $query, $res, $row, ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), array, ilDBConstants\FETCHMODE_OBJECT, ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, ilWaitingList\lookupListSize(), and time.
Referenced by ilGroupRegistrationGUI\fillMaxMembers(), ilObjGroupListGUI\getProperties(), and ilObjGroupGUI\infoScreen().
270 $query =
'SELECT registration_type, registration_enabled, registration_unlimited, registration_start, '.
271 'registration_end, registration_mem_limit, registration_max_members FROM grp_settings '.
272 'WHERE obj_id = '.$ilDB->quote($a_obj_id);
280 $info[
'reg_info_type'] =
$row->registration_type;
281 $info[
'reg_info_max_members'] =
$row->registration_max_members;
282 $info[
'reg_info_mem_limit'] =
$row->registration_mem_limit;
283 $info[
'reg_info_unlimited'] =
$row->registration_unlimited;
285 $info[
'reg_info_max_members'] = 0;
286 if(
$info[
'reg_info_mem_limit'])
288 $info[
'reg_info_max_members'] =
$row->registration_max_members;
291 $info[
'reg_info_enabled'] =
$row->registration_enabled;
294 $registration_possible =
$info[
'reg_info_enabled'];
297 if(!
$info[
'reg_info_unlimited'] && $registration_possible)
302 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_start');
307 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_end');
312 $registration_possible =
false;
313 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_period');
314 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'grp_list_reg_noreg');
320 if (!$registration_possible)
322 $registration_possible =
false;
323 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_period');
324 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'grp_list_reg_noreg');
328 if(
$info[
'reg_info_mem_limit'] &&
$info[
'reg_info_max_members'] && $registration_possible)
331 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
334 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
336 if(
$info[
'reg_info_list_size'])
338 $info[
'reg_info_free_places'] = 0;
342 $info[
'reg_info_free_places'] = max(0,
$info[
'reg_info_max_members'] - $part->getCountMembers());
345 if(
$info[
'reg_info_free_places'])
347 $info[
'reg_info_list_prop_limit'][
'property'] = $lng->txt(
'grp_list_reg_limit_places');
348 $info[
'reg_info_list_prop_limit'][
'value'] =
$info[
'reg_info_free_places'];
352 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
353 $info[
'reg_info_list_prop_limit'][
'value'] = $lng->txt(
'grp_list_reg_limit_full');
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static formatDate(ilDateTime $date)
Format a date public.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static lookupListSize($a_obj_id)
Lookup waiting lit size.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
◆ $using_code
ilObjGroupAccess::$using_code = false |
|
staticprotected |
The documentation for this class was generated from the following file: