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...
|
|
| canBeDelivered (ilWACPath $ilWACPath) |
| - Parameters
-
- Returns
- bool
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 $DIC, $ilUser, $lng, ilWaitingList\_isOnList(), ilGroupParticipants\_isParticipant(), ilDatePresentation\formatDate(), ilAccessInfo\IL_STATUS_INFO, and ilObjGroup\mayLeave().
36 $rbacsystem = $DIC[
'rbacsystem'];
37 $ilAccess = $DIC[
'ilAccess'];
39 if ($a_user_id ==
"") {
46 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
56 if (!self::_registrationEnabled($a_obj_id)) {
60 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
65 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
74 if ($a_permission ==
'leave') {
75 include_once
'./Modules/Group/classes/class.ilObjGroup.php';
78 $ilAccess->addInfoItem(
85 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
91 if ($a_permission ==
'join') {
92 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
101 switch ($a_permission) {
103 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, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
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 163 of file class.ilObjGroupAccess.php.
References $DIC, and $ilUser.
167 $ilAccess = $DIC[
'ilAccess'];
170 $t_arr = explode(
"_", $a_target);
172 if (substr($t_arr[2], 0, 5) ==
'rcode' and $ilUser->getId() != ANONYMOUS_USER_ID) {
173 self::$using_code =
true;
177 if ($t_arr[0] !=
"grp" || ((
int) $t_arr[1]) <= 0) {
181 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
182 $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 121 of file class.ilObjGroupAccess.php.
References ilDAVActivationChecker\_isActive(), ilFMSettings\getInstance(), and ilWebDAVUtil\getInstance().
Referenced by ilObjGroupReferenceAccess\_getCommands(), and ilObjGroupListGUI\init().
124 $commands[] = array(
"permission" =>
"grp_linked",
"cmd" =>
"",
"lang_var" =>
"show",
"default" =>
true);
126 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
129 'permission' =>
'read',
130 'cmd' =>
'fileManagerLaunch',
131 'lang_var' =>
'fm_start',
132 'enable_anonymous' =>
false 136 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
139 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
142 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"grp_btn_unsubscribe");
144 include_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
146 include_once
'./Services/WebDAV/classes/class.ilWebDAVUtil.php';
148 $commands[] = array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
150 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
154 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
155 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
static _isActive()
Static getter.
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 193 of file class.ilObjGroupAccess.php.
References $DIC, $end, $ilDB, $query, $res, $row, $start, $time, ilDateTime\_after(), ilDateTime\_before(), ilDBConstants\FETCHMODE_OBJECT, IL_CAL_DATETIME, and IL_CAL_UNIX.
197 $ilDB = $DIC[
'ilDB'];
199 $query =
"SELECT * FROM grp_settings " .
200 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
204 $enabled = $unlimited =
false;
206 $enabled =
$row->registration_enabled;
207 $unlimited =
$row->registration_unlimited;
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.
foreach($_POST as $key=> $value) $res
◆ _usingRegistrationCode()
static ilObjGroupAccess::_usingRegistrationCode |
( |
| ) |
|
|
static |
◆ lookupPeriodInfo()
static ilObjGroupAccess::lookupPeriodInfo |
( |
|
$a_obj_id | ) |
|
|
static |
Lookup course period info.
- Parameters
-
- Returns
- array
Definition at line 340 of file class.ilObjGroupAccess.php.
References $DIC, $end, $ilDB, $lng, $query, $row, $start, ilDatePresentation\formatPeriod(), and IL_CAL_UNIX.
Referenced by ilObjGroupListGUI\getProperties().
344 $ilDB = $DIC[
'ilDB'];
349 $query =
'SELECT grp_start, grp_end FROM grp_settings' .
350 ' WHERE obj_id = ' .
$ilDB->quote($a_obj_id);
362 $lng->loadLanguageModule(
'grp');
365 'property' =>
$lng->txt(
'grp_period'),
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
◆ lookupRegistrationInfo()
static ilObjGroupAccess::lookupRegistrationInfo |
( |
|
$a_obj_id | ) |
|
|
static |
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
- Parameters
-
- Returns
- array
Definition at line 254 of file class.ilObjGroupAccess.php.
References $DIC, $ilDB, $ilUser, $info, $lng, $query, $res, $row, ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), ilDBConstants\FETCHMODE_OBJECT, ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, and ilWaitingList\lookupListSize().
Referenced by ilGroupRegistrationGUI\fillMaxMembers(), ilObjGroupListGUI\getProperties(), and ilObjGroupGUI\infoScreen().
258 $ilDB = $DIC[
'ilDB'];
262 $query =
'SELECT registration_type, registration_enabled, registration_unlimited, registration_start, ' .
263 'registration_end, registration_mem_limit, registration_max_members FROM grp_settings ' .
264 'WHERE obj_id = ' .
$ilDB->quote($a_obj_id);
271 $info[
'reg_info_type'] =
$row->registration_type;
272 $info[
'reg_info_max_members'] =
$row->registration_max_members;
273 $info[
'reg_info_mem_limit'] =
$row->registration_mem_limit;
274 $info[
'reg_info_unlimited'] =
$row->registration_unlimited;
276 $info[
'reg_info_max_members'] = 0;
277 if (
$info[
'reg_info_mem_limit']) {
278 $info[
'reg_info_max_members'] =
$row->registration_max_members;
281 $info[
'reg_info_enabled'] =
$row->registration_enabled;
284 $registration_possible =
$info[
'reg_info_enabled'];
287 if (!
$info[
'reg_info_unlimited'] && $registration_possible) {
290 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_start');
293 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_end');
296 $registration_possible =
false;
297 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg_period');
298 $info[
'reg_info_list_prop'][
'value'] =
$lng->txt(
'grp_list_reg_noreg');
302 if (!$registration_possible) {
303 $registration_possible =
false;
304 $info[
'reg_info_list_prop'][
'property'] =
$lng->txt(
'grp_list_reg');
305 $info[
'reg_info_list_prop'][
'value'] =
$lng->txt(
'grp_list_reg_noreg');
309 if (
$info[
'reg_info_mem_limit'] &&
$info[
'reg_info_max_members'] && $registration_possible) {
311 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
314 include_once
'./Modules/Course/classes/class.ilCourseWaitingList.php';
316 if (
$info[
'reg_info_list_size']) {
317 $info[
'reg_info_free_places'] = 0;
319 $info[
'reg_info_free_places'] = max(0,
$info[
'reg_info_max_members'] - $part->getCountMembers());
322 if (
$info[
'reg_info_free_places']) {
323 $info[
'reg_info_list_prop_limit'][
'property'] =
$lng->txt(
'grp_list_reg_limit_places');
324 $info[
'reg_info_list_prop_limit'][
'value'] =
$info[
'reg_info_free_places'];
326 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
327 $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, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
foreach($_POST as $key=> $value) $res
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static lookupListSize($a_obj_id)
Lookup waiting lit size.
◆ $using_code
ilObjGroupAccess::$using_code = false |
|
staticprotected |
The documentation for this class was generated from the following file: