55 $ilTabs = $DIC[
'ilTabs'];
56 $ilToolbar = $DIC[
'ilToolbar'];
58 $rbacsystem = $DIC[
'rbacsystem'];
62 $this->parent_gui = $parent_gui;
63 $this->
object = $parent_gui->object;
64 $this->tabs_gui = $this->parent_gui->tabs_gui;
65 $this->toolbar = $ilToolbar;
68 $this->lng->loadLanguageModule(
'user');
69 if (!$rbacsystem->checkAccess(
"cat_administrate_users", $this->parent_gui->object->getRefId())) {
80 $cmd = $this->ctrl->getCmd();
84 $this->tabs_gui->clearTargets();
85 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTargetByClass(
"illocalusergui",
'index'));
119 $table->writeFilterToSession();
124 public function index($show_delete =
false)
128 $rbacreview = $DIC[
'rbacreview'];
129 $rbacsystem = $DIC[
'rbacsystem'];
130 $this->tpl->addBlockfile(
133 'tpl.cat_admin_users.html',
136 if (count($rbacreview->getGlobalAssignableRoles())
137 or in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))
139 $this->toolbar->addButton(
140 $this->lng->txt(
'add_user'),
141 $this->ctrl->getLinkTargetByClass(
'ilobjusergui',
'create')
143 $this->toolbar->addButton(
144 $this->lng->txt(
'import_users'),
145 $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'importUserForm')
151 $this->tpl->setCurrentBlock(
"confirm_delete");
152 $this->tpl->setVariable(
"CONFIRM_FORMACTION", $this->ctrl->getFormAction($this));
153 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
'cancel'));
154 $this->tpl->setVariable(
"CONFIRM_CMD",
'performDeleteUsers');
155 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
'delete'));
156 $this->tpl->parseCurrentBlock();
159 $this->tpl->setVariable(
'USERS_TABLE',
$table->getHTML());
171 $auto->setSearchFields(
array(
'login',
'firstname',
'lastname',
'email' ));
172 $auto->enableFieldSearchableCheck(
true);
173 $auto->setMoreLinkAvailable(
true);
175 if (($_REQUEST[
'fetchall'])) {
179 echo $auto->getList($_REQUEST[
'term']);
192 foreach (
$_POST[
'user_ids'] as $user_id) {
194 $ilLog->write(__FILE__ .
":" . __LINE__ .
" User with id $user_id could not be found.");
203 $this->ctrl->redirect($this,
'index');
212 if (!count(
$_POST[
'id'])) {
219 $confirm->setFormAction($this->ctrl->getFormAction($this));
220 $confirm->setHeaderText($this->lng->txt(
'sure_delete_selected_users'));
221 $confirm->setConfirm($this->lng->txt(
'delete'),
'performDeleteUsers');
222 $confirm->setCancel($this->lng->txt(
'cancel'),
'index');
223 foreach (
$_POST[
'id'] as $user) {
228 $name[
'lastname'] .
', ' .
$name[
'firstname'] .
' [' .
$name[
'login'] .
']' 231 $this->tpl->setContent($confirm->getHTML());
238 $rbacreview = $DIC[
'rbacreview'];
241 $this->ctrl->redirect($this,
"");
243 $offset =
$_GET[
"offset"];
245 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"])) {
246 $_GET[
"sort_by"] =
"login";
248 $order =
$_GET[
"sort_by"];
249 $direction =
$_GET[
"sort_order"];
250 if (!isset(
$_GET[
'obj_id'])) {
257 $this->tpl->addBlockfile(
260 'tpl.cat_role_assignment.html',
263 $ass_roles = $rbacreview->assignedRoles(
$_GET[
'obj_id']);
265 foreach ($roles as $role) {
269 in_array($role[
'obj_id'], $ass_roles) ? 1 : 0,
274 $f_result[
$counter][] = $role_obj->getTitle();
275 $f_result[
$counter][] = $role_obj->getDescription()?$role_obj->getDescription():
'';
276 $f_result[
$counter][] = $role[
'role_type'] ==
'global' ?
277 $this->lng->txt(
'global') :
278 $this->lng->txt(
'local');
289 $rbacreview = $DIC[
'rbacreview'];
290 $rbacadmin = $DIC[
'rbacadmin'];
293 $this->ctrl->redirect($this,
"");
306 $this->assignRolesObject();
311 $assigned_roles = $rbacreview->assignedRoles((
int) $_REQUEST[
'obj_id']);
312 foreach ($roles as $role) {
313 if (in_array($role[
'obj_id'], $new_role_ids) and !in_array($role[
'obj_id'], $assigned_roles)) {
314 $rbacadmin->assignUser($role[
'obj_id'], (
int) $_REQUEST[
'obj_id']);
316 if (in_array($role[
'obj_id'], $assigned_roles) and !in_array($role[
'obj_id'], $new_role_ids)) {
317 $rbacadmin->deassignUser($role[
'obj_id'], (
int) $_REQUEST[
'obj_id']);
330 $rbacreview = $DIC[
'rbacreview'];
334 $this->ctrl->redirect($this,
"");
338 if ($tmp_obj->getTimeLimitOwner() != $this->
object->getRefId() and
339 !in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))
344 $new_assigned = $new_assigned ? $new_assigned :
array();
345 $assigned = $rbacreview->assignedRoles((
int)
$_GET[
'obj_id']);
347 if (!in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))) {
348 $ga = $rbacreview->getGlobalAssignableRoles();
350 $ga = $rbacreview->getGlobalRolesArray();
352 $global_assignable =
array();
353 foreach ($ga as $role) {
354 $global_assignable[] = $role[
'obj_id'];
356 $new_visible_assigned_roles = array_intersect($new_assigned, $global_assignable);
357 $all_assigned_roles = array_intersect($assigned, $rbacreview->getGlobalRoles());
358 $main_assigned_roles = array_diff($all_assigned_roles, $global_assignable);
359 if (!count($new_visible_assigned_roles) and !count($main_assigned_roles)) {
370 $rbacreview = $DIC[
'rbacreview'];
375 if (in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId()))) {
376 $global_roles = $rbacreview->getGlobalRolesArray();
377 } elseif ($tmp_obj->getTimeLimitOwner() == $this->
object->getRefId()) {
378 $global_roles = $rbacreview->getGlobalAssignableRoles();
380 $global_roles =
array();
383 return $roles = array_merge($global_roles, $rbacreview->getAssignableChildRoles($this->object->getRefId()));
391 $this->ctrl->redirect($this,
"");
393 $tbl =&$this->parent_gui->__initTableGUI();
396 $tpl->setCurrentBlock(
"tbl_form_header");
397 $this->ctrl->setParameter($this,
'obj_id',
$_GET[
'obj_id']);
398 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
399 $tpl->parseCurrentBlock();
402 $tpl->setVariable(
"BTN_NAME",
"assignSave");
403 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"change_assignment"));
404 $tpl->setCurrentBlock(
"tbl_action_row");
405 $tpl->setVariable(
"TPLPATH", $this->tpl->tplPath);
406 $tpl->parseCurrentBlock();
408 $title = $this->lng->txt(
'role_assignment') .
' (' . $tmp_obj->getFullname() .
')';
409 $tbl->setTitle(
$title,
"icon_role.svg", $this->lng->txt(
"role_assignment"));
412 $this->lng->txt(
"title"),
413 $this->lng->txt(
'description'),
414 $this->lng->txt(
"type")
421 ), (get_class($this->parent_gui) ==
'ilObjOrgUnitGUI') ?
array(
422 "ref_id" => $this->
object->getRefId(),
423 "cmd" =>
"assignRoles",
424 "obj_id" =>
$_GET[
'obj_id'],
425 "cmdNode" =>
$_GET[
"cmdNode"],
426 "baseClass" =>
'ilAdministrationGUI',
427 "admin_mode" =>
"settings" 429 "ref_id" => $this->
object->getRefId(),
430 "cmd" =>
"assignRoles",
431 "obj_id" =>
$_GET[
'obj_id'],
432 "cmdClass" =>
"ilobjcategorygui",
433 "baseClass" =>
'ilRepositoryGUI',
434 "cmdNode" =>
$_GET[
"cmdNode"],
436 $tbl->setColumnWidth(
array(
"4%",
"35%",
"45%",
"16%" ));
437 $this->set_unlimited =
true;
438 $this->parent_gui->__setTableGUIBasicData(
$tbl, $a_result_set, $a_from,
true);
440 $this->tpl->setVariable(
'OBJECTS',
$tbl->getTemplateObject()->get());
452 $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.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
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.
if(empty($password)) $table
checkPermission($permission)
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
Confirmation screen class.