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...
|
|
| _getCommands () |
| get commands More...
|
|
| _checkGoto ($a_target) |
| check whether goto script will succeed More...
|
|
| _preloadData ($a_obj_ids, $a_ref_ids) |
| Preload data. 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=0) |
| check condition More...
|
|
| _getCommands () |
| get commands More...
|
|
| _checkGoto ($a_target) |
| check whether goto script will succeed More...
|
|
| _preloadData ($a_obj_ids, $a_ref_ids) |
| Preload data. 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(), and ilGroupParticipants\_isParticipant().
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.ilGroupParticipants.php';
87 if($a_permission ==
'join')
89 include_once
'./Modules/Group/classes/class.ilGroupWaitingList.php';
99 switch ($a_permission)
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
◆ _checkGoto()
ilObjGroupAccess::_checkGoto |
( |
|
$a_target | ) |
|
check whether goto script will succeed
Definition at line 165 of file class.ilObjGroupAccess.php.
References $ilUser.
169 $t_arr = explode(
"_", $a_target);
171 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)
182 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
183 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
◆ _getCommands()
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"), );
Definition at line 118 of file class.ilObjGroupAccess.php.
References ilDAVActivationChecker\_isActive(), ilFMSettings\getInstance(), and ilDAVUtils\getInstance().
Referenced by ilObjGroupListGUI\init().
121 $commands[] = array(
"permission" =>
"grp_linked",
"cmd" =>
"",
"lang_var" =>
"show",
"default" =>
true);
123 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
127 'permission' =>
'read',
128 'cmd' =>
'fileManagerLaunch',
129 'lang_var' =>
'fm_start',
130 'enable_anonymous' =>
false 134 $commands[] = array(
"permission" =>
"join",
"cmd" =>
"join",
"lang_var" =>
"join");
137 $commands[] = array(
'permission' =>
"join",
"cmd" =>
"leave",
"lang_var" =>
"leave_waiting_list");
140 $commands[] = array(
'permission' =>
"leave",
"cmd" =>
"leave",
"lang_var" =>
"grp_btn_unsubscribe");
142 include_once (
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
145 include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php';
148 $commands[] = array(
'permission' =>
'read',
'cmd' =>
'showPasswordInstruction',
'lang_var' =>
'mount_webfolder',
'enable_anonymous' =>
'false');
152 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"mount_webfolder",
"lang_var" =>
"mount_webfolder",
"enable_anonymous" =>
"false");
156 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"enableAdministrationPanel",
"lang_var" =>
"edit_content");
157 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings");
static _isActive()
Static getter.
static getInstance()
Get singleton instance.
static getInstance()
Get singleton instance.
◆ _preloadData()
ilObjGroupAccess::_preloadData |
( |
|
$a_obj_ids, |
|
|
|
$a_ref_ids |
|
) |
| |
◆ _registrationEnabled()
static ilObjGroupAccess::_registrationEnabled |
( |
|
$a_obj_id | ) |
|
|
static |
- Returns
- Parameters
-
Definition at line 195 of file class.ilObjGroupAccess.php.
References $query, $res, $row, ilDateTime\_after(), ilDateTime\_before(), DB_FETCHMODE_OBJECT, IL_CAL_DATETIME, and IL_CAL_UNIX.
199 $query =
"SELECT * FROM grp_settings ".
200 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
204 $enabled = $unlimited =
false;
207 $enabled =
$row->registration_enabled;
208 $unlimited =
$row->registration_unlimited;
209 $start =
$row->registration_start;
210 $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.
const DB_FETCHMODE_OBJECT
◆ _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 255 of file class.ilObjGroupAccess.php.
References $ilUser, $lng, $query, $res, $row, ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), DB_FETCHMODE_OBJECT, ilDatePresentation\formatDate(), IL_CAL_DATETIME, and IL_CAL_UNIX.
Referenced by ilObjGroupListGUI\getProperties().
259 $query =
'SELECT registration_type, registration_enabled, registration_unlimited, registration_start, '.
260 'registration_end, registration_mem_limit, registration_max_members FROM grp_settings '.
261 'WHERE obj_id = '.$ilDB->quote($a_obj_id);
269 $info[
'reg_info_type'] =
$row->registration_type;
270 $info[
'reg_info_max_members'] =
$row->registration_max_members;
271 $info[
'reg_info_mem_limit'] =
$row->registration_mem_limit;
272 $info[
'reg_info_unlimited'] =
$row->registration_unlimited;
274 $info[
'reg_info_max_members'] = 0;
275 if($info[
'reg_info_mem_limit'])
277 $info[
'reg_info_max_members'] =
$row->registration_max_members;
280 $info[
'reg_info_enabled'] =
$row->registration_enabled;
283 $registration_possible = $info[
'reg_info_enabled'];
286 if(!$info[
'reg_info_unlimited'] && $registration_possible)
291 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_start');
296 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_end');
301 $registration_possible =
false;
302 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_period');
303 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'grp_list_reg_noreg');
309 if (!$registration_possible)
311 $registration_possible =
false;
312 $info[
'reg_info_list_prop'][
'property'] = $lng->txt(
'grp_list_reg_period');
313 $info[
'reg_info_list_prop'][
'value'] = $lng->txt(
'grp_list_reg_noreg');
317 if($info[
'reg_info_mem_limit'] && $registration_possible)
324 include_once
'./Modules/Group/classes/class.ilGroupParticipants.php';
326 if($part->getCountMembers() <= $info[
'reg_info_max_members'])
328 $info[
'reg_info_list_prop_limit'][
'property'] = $lng->txt(
'grp_list_reg_limit_places');
329 $info[
'reg_info_list_prop_limit'][
'value'] = max(
331 $info[
'reg_info_max_members'] - $part->getCountMembers()
336 $info[
'reg_info_list_prop_limit'][
'property'] =
'';
337 $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.
const DB_FETCHMODE_OBJECT
static formatDate(ilDateTime $date)
Format a date public.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
◆ $using_code
ilObjGroupAccess::$using_code = false |
|
staticprotected |
The documentation for this class was generated from the following file: