3 require_once(
"./Services/User/classes/class.ilUserTableGUI.php");
4 require_once(
"./Services/User/classes/class.ilLocalUser.php");
5 require_once(
"./Services/User/classes/class.ilObjUserGUI.php");
6 require_once(
"./Services/User/classes/class.ilObjUserFolderGUI.php");
57 $ilTabs = $DIC[
'ilTabs'];
58 $ilToolbar = $DIC[
'ilToolbar'];
60 $rbacsystem = $DIC[
'rbacsystem'];
64 $this->parent_gui = $parent_gui;
65 $this->
object = $parent_gui->object;
66 $this->tabs_gui = $this->parent_gui->tabs_gui;
67 $this->toolbar = $ilToolbar;
70 $this->lng->loadLanguageModule(
'user');
71 if (! $rbacsystem->checkAccess(
"cat_administrate_users", $this->parent_gui->object->getRefId())) {
81 $cmd = $this->ctrl->getCmd();
85 $this->tabs_gui->clearTargets();
86 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),$this->ctrl->getLinkTargetByClass(
"illocalusergui",
'index'));
104 $table->resetOffset();
105 $table->resetFilter();
117 $table->resetOffset();
118 $table->writeFilterToSession();
123 function index($show_delete =
false) {
126 $rbacreview = $DIC[
'rbacreview'];
127 $rbacsystem = $DIC[
'rbacsystem'];
128 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.cat_admin_users.html',
130 if (count($rbacreview->getGlobalAssignableRoles())
131 or in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))
133 $this->toolbar->addButton(
134 $this->lng->txt(
'add_user'),
135 $this->ctrl->getLinkTargetByClass(
'ilobjusergui',
'create')
137 $this->toolbar->addButton(
138 $this->lng->txt(
'import_users'),
139 $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'importUserForm')
145 $this->tpl->setCurrentBlock(
"confirm_delete");
146 $this->tpl->setVariable(
"CONFIRM_FORMACTION", $this->ctrl->getFormAction($this));
147 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
'cancel'));
148 $this->tpl->setVariable(
"CONFIRM_CMD",
'performDeleteUsers');
149 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
'delete'));
150 $this->tpl->parseCurrentBlock();
153 $this->tpl->setVariable(
'USERS_TABLE', $table->getHTML());
163 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
165 $auto->setSearchFields(
array(
'login',
'firstname',
'lastname',
'email' ));
166 $auto->enableFieldSearchableCheck(
true);
167 $auto->setMoreLinkAvailable(
true);
169 if(($_REQUEST[
'fetchall']))
174 echo $auto->getList($_REQUEST[
'term']);
185 include_once
'./Services/User/classes/class.ilLocalUser.php';
187 foreach (
$_POST[
'user_ids'] as $user_id) {
189 $ilLog->write(__FILE__.
":".__LINE__.
" User with id $user_id could not be found.");
198 $this->ctrl->redirect($this,
'index');
206 if (! count(
$_POST[
'id'])) {
212 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
214 $confirm->setFormAction($this->ctrl->getFormAction($this));
215 $confirm->setHeaderText($this->lng->txt(
'sure_delete_selected_users'));
216 $confirm->setConfirm($this->lng->txt(
'delete'),
'performDeleteUsers');
217 $confirm->setCancel($this->lng->txt(
'cancel'),
'index');
218 foreach (
$_POST[
'id'] as $user) {
223 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']' 226 $this->tpl->setContent($confirm->getHTML());
232 $rbacreview = $DIC[
'rbacreview'];
233 if (! $this->ilAccess->checkAccess(
"cat_administrate_users",
"",
$_GET[
"ref_id"])) {
235 $this->ctrl->redirect($this,
"");
237 $offset =
$_GET[
"offset"];
239 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"])) {
240 $_GET[
"sort_by"] =
"login";
242 $order =
$_GET[
"sort_by"];
243 $direction =
$_GET[
"sort_order"];
244 include_once
'./Services/User/classes/class.ilLocalUser.php';
245 if (! isset(
$_GET[
'obj_id'])) {
252 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.cat_role_assignment.html',
254 $ass_roles = $rbacreview->assignedRoles(
$_GET[
'obj_id']);
256 foreach ($roles as $role) {
263 $f_result[
$counter][] = $role_obj->getTitle();
264 $f_result[
$counter][] = $role_obj->getDescription()?$role_obj->getDescription():
'';
265 $f_result[
$counter][] = $role[
'role_type'] ==
'global' ?
266 $this->lng->txt(
'global') :
267 $this->lng->txt(
'local');
277 $rbacreview = $DIC[
'rbacreview'];
278 $rbacadmin = $DIC[
'rbacadmin'];
279 if (! $this->ilAccess->checkAccess(
"cat_administrate_users",
"",
$_GET[
"ref_id"])) {
281 $this->ctrl->redirect($this,
"");
283 include_once
'./Services/User/classes/class.ilLocalUser.php';
298 $this->assignRolesObject();
303 $assigned_roles = $rbacreview->assignedRoles((
int)$_REQUEST[
'obj_id']);
304 foreach ($roles as $role) {
305 if (in_array($role[
'obj_id'], $new_role_ids)
and ! in_array($role[
'obj_id'], $assigned_roles)) {
306 $rbacadmin->assignUser($role[
'obj_id'], (
int)$_REQUEST[
'obj_id']);
308 if (in_array($role[
'obj_id'], $assigned_roles)
and ! in_array($role[
'obj_id'], $new_role_ids)) {
309 $rbacadmin->deassignUser($role[
'obj_id'], (
int)$_REQUEST[
'obj_id']);
321 $rbacreview = $DIC[
'rbacreview'];
323 if (! $this->ilAccess->checkAccess(
"cat_administrate_users",
"",
$_GET[
"ref_id"])) {
325 $this->ctrl->redirect($this,
"");
329 if ($tmp_obj->getTimeLimitOwner() != $this->
object->getRefId()
and 330 ! in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))
335 $new_assigned = $new_assigned ? $new_assigned :
array();
336 $assigned = $rbacreview->assignedRoles((
int)
$_GET[
'obj_id']);
338 if (! in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))) {
339 $ga = $rbacreview->getGlobalAssignableRoles();
341 $ga = $rbacreview->getGlobalRolesArray();
343 $global_assignable =
array();
344 foreach ($ga as $role) {
345 $global_assignable[] = $role[
'obj_id'];
347 $new_visible_assigned_roles = array_intersect($new_assigned, $global_assignable);
348 $all_assigned_roles = array_intersect($assigned, $rbacreview->getGlobalRoles());
349 $main_assigned_roles = array_diff($all_assigned_roles, $global_assignable);
350 if (! count($new_visible_assigned_roles)
and ! count($main_assigned_roles)) {
360 $rbacreview = $DIC[
'rbacreview'];
365 if (in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))) {
366 $global_roles = $rbacreview->getGlobalRolesArray();
367 } elseif ($tmp_obj->getTimeLimitOwner() == $this->
object->getRefId()) {
368 $global_roles = $rbacreview->getGlobalAssignableRoles();
370 $global_roles =
array();
373 return $roles = array_merge($global_roles, $rbacreview->getAssignableChildRoles($this->object->getRefId()));
378 if (! $this->ilAccess->checkAccess(
"cat_administrate_users",
"",
$_GET[
"ref_id"])) {
380 $this->ctrl->redirect($this,
"");
382 $tbl =& $this->parent_gui->__initTableGUI();
385 $tpl->setCurrentBlock(
"tbl_form_header");
386 $this->ctrl->setParameter($this,
'obj_id',
$_GET[
'obj_id']);
387 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
388 $tpl->parseCurrentBlock();
390 $tpl->setVariable(
"COLUMN_COUNTS", 4);
392 $tpl->setVariable(
"BTN_NAME",
"assignSave");
393 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"change_assignment"));
394 $tpl->setCurrentBlock(
"tbl_action_row");
395 $tpl->setVariable(
"TPLPATH", $this->tpl->tplPath);
396 $tpl->parseCurrentBlock();
398 $title = $this->lng->txt(
'role_assignment') .
' (' . $tmp_obj->getFullname() .
')';
399 $tbl->setTitle(
$title,
"icon_role.svg", $this->lng->txt(
"role_assignment"));
402 $this->lng->txt(
"title"),
403 $this->lng->txt(
'description'),
404 $this->lng->txt(
"type")
411 ), (get_class($this->parent_gui) ==
'ilObjOrgUnitGUI') ?
array(
412 "ref_id" => $this->
object->getRefId(),
413 "cmd" =>
"assignRoles",
414 "obj_id" =>
$_GET[
'obj_id'],
415 "cmdNode" =>
$_GET[
"cmdNode"],
416 "baseClass" =>
'ilAdministrationGUI',
417 "admin_mode" =>
"settings" 419 "ref_id" => $this->
object->getRefId(),
420 "cmd" =>
"assignRoles",
421 "obj_id" =>
$_GET[
'obj_id'],
422 "cmdClass" =>
"ilobjcategorygui",
423 "baseClass" =>
'ilRepositoryGUI',
424 "cmdNode" =>
$_GET[
"cmdNode"],
426 $tbl->setColumnWidth(
array(
"4%",
"35%",
"45%",
"16%" ));
427 $this->set_unlimited =
true;
428 $this->parent_gui->__setTableGUIBasicData(
$tbl, $a_result_set, $a_from,
true);
430 $this->tpl->setVariable(
"ROLES_TABLE",
$tbl->tpl->get());
439 if (! $this->ilAccess->checkAccess($permission,
"",
$_GET[
"ref_id"])) {
441 $this->ctrl->redirect($this,
"");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
__showRolesTable($a_result_set, $a_from="")
performDeleteUsers()
Delete User.
Auto completion class for user lists.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__checkGlobalRoles($new_assigned)
TableGUI class for user administration.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _getAllUserIds($a_filter=0)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
index($show_delete=false)
applyFilter()
Apply filter.
Create new PHPExcel object
obj_idprivate
resetFilter()
Reset filter (note: this function existed before data table filter has been introduced.
addUserAutoCompleteObject()
Show auto complete results.
checkPermission($permission)
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
Confirmation screen class.