4 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
5 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
46 function __construct($a_data,$a_id,$a_call_by_reference =
false,$a_prepare_output =
true)
50 $lng->loadLanguageModule(
'rbac');
53 define(
"USER_FOLDER_ID",7);
69 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
70 $this->ctrl->saveParameter($this, array(
'obj_id',
'rolf_ref_id'));
80 $next_class = $this->ctrl->getNextClass($this);
81 $cmd = $this->ctrl->getCmd();
85 case 'ilrepositorysearchgui':
86 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
88 $rep_search->setTitle($this->lng->txt(
'role_add_user'));
89 $rep_search->setCallback($this,
'addUserObject');
92 $this->tabs_gui->setTabActive(
'user_assignment');
93 $this->ctrl->setReturn($this,
'userassignment');
94 $ret =& $this->ctrl->forwardCommand($rep_search);
99 $this->tabs_gui->setTabActive(
'export');
101 include_once
'./Services/Export/classes/class.ilExportOptions.php';
105 include_once
'./Services/Export/classes/class.ilExportGUI.php';
107 $exp->addFormat(
'xml');
108 $this->ctrl->forwardCommand($exp);
120 $cmd =
'userassignment';
164 $this->back_target = array(
"text" => $a_text,
170 return $this->back_target ? $this->back_target : array();
204 global $rbacsystem,$rbacreview,
$tree;
208 $this->obj_ref_id != ROLE_FOLDER_ID)
215 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
220 $this->
__showButton(
'selectDesktopItem',$this->lng->txt(
'role_desk_add'));
222 if(!count($items = $role_desk_item_obj->getAll()))
227 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_desktop_item_list.html",
"Services/AccessControl");
228 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
230 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_role'));
231 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'role_assigned_desk_items').
' ('.$this->
object->getTitle().
')');
232 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
233 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
238 foreach($items as $role_item_id => $item)
242 if(strlen($desc = $tmp_obj->getDescription()))
244 $this->tpl->setCurrentBlock(
"description");
245 $this->tpl->setVariable(
"DESCRIPTION_DESK",$desc);
246 $this->tpl->parseCurrentBlock();
248 $this->tpl->setCurrentBlock(
"desk_row");
249 $this->tpl->setVariable(
"DESK_TITLE",$tmp_obj->getTitle());
251 $this->tpl->setVariable(
"CHECK_DESK",ilUtil::formCheckBox(0,
'del_desk_item[]',$role_item_id));
252 $this->tpl->setVariable(
"TXT_PATH",$this->lng->txt(
'path').
':');
253 $this->tpl->setVariable(
"PATH",$this->
__formatPath($tree->getPathFull($item[
'item_id'])));
254 $this->tpl->parseCurrentBlock();
267 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
269 if(!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
271 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
273 if(!count(
$_POST[
'del_desk_item']))
283 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_ask_delete_desktop_item.html",
"Services/AccessControl");
284 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
286 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_role'));
287 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'role_assigned_desk_items').
' ('.$this->
object->getTitle().
')');
288 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
289 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
290 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
292 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
298 foreach(
$_POST[
'del_desk_item'] as $role_item_id)
300 $item_data = $role_desk_item_obj->
getItem($role_item_id);
303 if(strlen($desc = $tmp_obj->getDescription()))
305 $this->tpl->setCurrentBlock(
"description");
306 $this->tpl->setVariable(
"DESCRIPTION_DESK",$desc);
307 $this->tpl->parseCurrentBlock();
309 $this->tpl->setCurrentBlock(
"desk_row");
310 $this->tpl->setVariable(
"DESK_TITLE",$tmp_obj->getTitle());
312 $this->tpl->parseCurrentBlock();
326 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
329 if (!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
331 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
334 if (!count(
$_SESSION[
'role_del_desk_items']))
343 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
347 foreach (
$_SESSION[
'role_del_desk_items'] as $role_item_id)
349 $role_desk_item_obj->
delete($role_item_id);
361 global $rbacsystem,
$tree;
363 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItemSelector.php';
364 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
366 if(!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
368 #$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
374 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_desktop_item_selector.html",
"Services/AccessControl");
375 $this->
__showButton(
'listDesktopItems',$this->lng->txt(
'back'));
381 $exp->setExpand(
$_GET[
"role_desk_item_link_expand"] ?
$_GET[
"role_desk_item_link_expand"] : $tree->readRootId());
382 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'selectDesktopItem'));
386 $output = $exp->getOutput();
387 $this->tpl->setVariable(
"EXPLORER",$output);
397 if (!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
399 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
404 if (!isset(
$_GET[
'item_id']))
412 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
419 $this->ctrl->redirect($this,
'listDesktopItems');
430 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
433 if($this->creation_mode)
435 $this->ctrl->setParameter($this,
"new_type",
'role');
437 $this->form->setFormAction($this->ctrl->getFormAction($this));
441 case self::MODE_GLOBAL_CREATE:
442 $this->form->setTitle($this->lng->txt(
'role_new'));
443 $this->form->addCommandButton(
'save',$this->lng->txt(
'role_new'));
446 case self::MODE_GLOBAL_UPDATE:
447 $this->form->setTitle($this->lng->txt(
'role_edit'));
448 $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
451 case self::MODE_LOCAL_CREATE:
452 case self::MODE_LOCAL_UPDATE:
455 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
465 $title->setValidationRegexp(
'/^(?!il_).*$/');
466 $title->setValidationFailureMessage($this->lng->txt(
'msg_role_reserved_prefix'));
470 $title->setMaxLength(70);
471 $title->setRequired(
true);
472 $this->form->addItem($title);
481 $this->form->addItem($desc);
483 if($a_mode != self::MODE_LOCAL_CREATE && $a_mode != self::MODE_GLOBAL_CREATE)
486 $this->form->addItem($ilias_id);
489 if($this->obj_ref_id == ROLE_FOLDER_ID)
493 #$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info'));
494 $this->form->addItem($reg);
498 #$la->setInfo($this->lng->txt('rbac_local_admin_info'));
499 $this->form->addItem($la);
504 #$pro->setInfo($this->lng->txt('role_protext_permission_info'));
505 $this->form->addItem($pro);
507 include_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
513 $quo->setInfo($this->lng->txt(
'enter_in_mb_desc').
'<br />'.$this->lng->txt(
'disk_quota_on_role_desc'));
514 $this->form->addItem($quo);
518 $this->lng->loadLanguageModule(
"file");
519 $wquo =
new ilNumberInputGUI($this->lng->txt(
'personal_workspace_disk_quota'),
'wsp_disk_quota');
522 $wquo->setInfo($this->lng->txt(
'enter_in_mb_desc').
'<br />'.$this->lng->txt(
'disk_quota_on_role_desc'));
523 $this->form->addItem($wquo);
537 if(!$this->form->getItemByPostVar(
'title')->getDisabled())
539 $role->
setTitle($this->form->getInput(
'title'));
542 if(!$this->form->getItemByPostVar(
'desc')->getDisabled())
562 include_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
577 $data[
'pro'] = $rbacreview->isProtected($this->obj_ref_id, $role->
getId());
579 $this->form->setValuesByArray(
$data);
594 if(!$rbacsystem->checkAccess(
'create_role',$this->obj_ref_id))
596 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
600 $this->tpl->setContent($this->form->getHTML());
613 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
617 if($this->object->getId() != SYSTEM_ROLE_ID)
619 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
622 $ilToolbar->addButton(
623 $this->lng->txt(
'rbac_delete_role'),
624 $this->ctrl->getLinkTarget($this,
'confirmDeleteRole')
631 $this->tpl->setContent($this->form->getHTML());
641 global $rbacadmin,$rbacreview;
646 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
648 $this->role->create();
650 $rbacadmin->setProtected(
652 $this->role->getId(),
653 $this->form->getInput(
'pro') ?
'y' :
'n'
656 $this->ctrl->setParameter($this,
'obj_id',$this->role->getId());
657 $this->ctrl->redirect($this,
'perm');
661 $this->form->setValuesByPost();
662 $this->tpl->setContent($this->form->getHTML());
685 if($this->form->checkInput() and !$this->
checkDuplicate($this->object->getId()))
687 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
689 $this->
object->update();
690 $rbacadmin->setProtected(
692 $this->object->getId(),
693 $this->form->getInput(
'pro') ?
'y' :
'n'
696 $this->ctrl->redirect($this,
'edit');
700 $this->form->setValuesByPost();
701 $this->tpl->setContent($this->form->getHTML());
709 protected function permObject($a_show_admin_permissions =
false)
713 $ilTabs->setTabActive(
'default_perm_settings');
717 if($a_show_admin_permissions)
719 $ilTabs->setSubTabActive(
'rbac_admin_permissions');
723 $ilTabs->setSubTabActive(
'rbac_repository_permissions');
728 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->MESSAGE);
733 if($this->object->getId() != SYSTEM_ROLE_ID)
735 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
736 $ilToolbar->addButton(
737 $this->lng->txt(
"adopt_perm_from_template"),
738 $this->ctrl->getLinkTarget($this,
'adoptPerm')
742 $ilToolbar->addButton(
743 $this->lng->txt(
'rbac_delete_role'),
744 $this->ctrl->getLinkTarget($this,
'confirmDeleteRole')
749 $this->tpl->addBlockFile(
752 'tpl.rbac_template_permissions.html',
753 'Services/AccessControl'
756 $this->tpl->setVariable(
'PERM_ACTION',$this->ctrl->getFormAction($this));
758 include_once
'./Services/Accordion/classes/class.ilAccordionGUI.php';
763 if($this->obj_ref_id == ROLE_FOLDER_ID)
765 if($a_show_admin_permissions)
767 $subs = $objDefinition->getSubObjectsRecursively(
'adm',
true,
true);
771 $subs = $objDefinition->getSubObjectsRecursively(
'root',
true,$a_show_admin_permissions);
776 $subs = $objDefinition->getSubObjectsRecursively($this->
getParentType(),
true,$a_show_admin_permissions);
780 foreach($subs as $subtype => $def)
782 if($objDefinition->isPlugin($subtype))
786 elseif($objDefinition->isSystemObject($subtype))
788 $translation = $this->lng->txt(
"obj_".$subtype);
792 $translation = $this->lng->txt(
'objs_'.$subtype);
795 $sorted[$subtype] = $def;
796 $sorted[$subtype][
'translation'] = $translation;
801 foreach($sorted as $subtype => $def)
803 if($objDefinition->isPlugin($subtype))
807 elseif($objDefinition->isSystemObject($subtype))
809 $translation = $this->lng->txt(
"obj_".$subtype);
813 $translation = $this->lng->txt(
'objs_'.$subtype);
816 include_once
'Services/AccessControl/classes/class.ilObjectRoleTemplatePermissionTableGUI.php';
821 $this->object->getId(),
823 $a_show_admin_permissions
827 $acc->addItem($translation, $tbl->getHTML());
830 $this->tpl->setVariable(
'ACCORDION',$acc->getHTML());
833 include_once
'./Services/AccessControl/classes/class.ilObjectRoleTemplateOptionsTableGUI.php';
838 $this->object->getId(),
839 $a_show_admin_permissions
841 if($this->object->getId() != SYSTEM_ROLE_ID)
844 $a_show_admin_permissions ?
'adminPermSave' :
'permSave',
845 $this->lng->txt(
'save')
850 $this->tpl->setVariable(
'OPTIONS_TABLE',
$options->getHTML());
877 $parent_role_ids = $rbacreview->getParentRoleIds($this->obj_ref_id,
true);
879 foreach($parent_role_ids as $id => $tmp)
886 foreach($sorted_ids as $id)
888 $par = $parent_role_ids[$id];
889 if ($par[
"obj_id"] != SYSTEM_ROLE_ID && $this->object->getId() != $par[
"obj_id"])
891 $output[$key][
"role_id"] = $par[
"obj_id"];
892 $output[$key][
"type"] = ($par[
"type"] ==
'role' ? $this->lng->txt(
'obj_role') : $this->lng->txt(
'obj_rolt'));
894 $output[$key][
"role_desc"] = $par[
"desc"];
900 include_once(
'./Services/AccessControl/classes/class.ilRoleAdoptPermissionTableGUI.php');
903 $tbl->setTitle($this->lng->txt(
"adopt_perm_from_template"));
904 $tbl->setData($output);
906 $this->tpl->setContent($tbl->getHTML());
917 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
920 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->WARNING);
923 $question = $this->lng->txt(
'rbac_role_delete_qst');
924 if($rbacreview->isAssigned($ilUser->getId(), $this->
object->getId()))
926 $question .= (
'<br />'.$this->lng->txt(
'rbac_role_delete_self'));
930 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
933 $confirm->setFormAction($this->ctrl->getFormAction($this));
934 $confirm->setHeaderText($question);
935 $confirm->setCancel($this->lng->txt(
'cancel'),
'perm');
936 $confirm->setConfirm($this->lng->txt(
'rbac_delete_role'),
'performDeleteRole');
940 $this->object->getId(),
941 $this->
object->getTitle(),
945 $this->tpl->setContent($confirm->getHTML());
958 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
961 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->WARNING);
964 $this->
object->setParent((
int) $this->obj_ref_id);
965 $this->
object->delete();
968 $this->ctrl->returnToParent($this);
981 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
985 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
989 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
997 if($this->obj_ref_id == ROLE_FOLDER_ID)
999 if($a_show_admin_permissions)
1001 $subs = $objDefinition->getSubObjectsRecursively(
'adm',
true,
true);
1005 $subs = $objDefinition->getSubObjectsRecursively(
'root',
true,
false);
1010 $subs = $objDefinition->getSubObjectsRecursively($this->
getParentType(),
true,
false);
1013 foreach($subs as $subtype => $def)
1016 $rbacadmin->deleteRolePermission($this->object->getId(),
$this->obj_ref_id,$subtype);
1019 if (empty(
$_POST[
"template_perm"]))
1021 $_POST[
"template_perm"] = array();
1024 foreach (
$_POST[
"template_perm"] as $key => $ops_array)
1027 $rbacadmin->setRolePermission($this->object->getId(), $key, $ops_array,
$this->obj_ref_id);
1030 if($rbac_log_active)
1038 $this->
object->update();
1041 if ($this->obj_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(),
$this->obj_ref_id))
1043 $rbacadmin->setProtected($this->obj_ref_id,$this->object->getId(),
ilUtil::tf2yn(
$_POST[
'protected']));
1046 if($a_show_admin_permissions)
1048 $_POST[
'recursive'] =
true;
1052 if(!
$_POST[
'recursive'] and !is_array(
$_POST[
'recursive_list']))
1055 if($a_show_admin_permissions)
1057 $this->ctrl->redirect($this,
'adminPerm');
1061 $this->ctrl->redirect($this,
'perm');
1071 $start = ($this->obj_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID :
$this->obj_ref_id);
1072 if($a_show_admin_permissions)
1074 $start = $tree->getParentId($this->obj_ref_id);
1079 $this->
object->changeExistingObjects(
1084 #$a_show_admin_permissions ? array(
'adm') : array()
1089 $this->
object->changeExistingObjects(
1094 #$a_show_admin_permissions ? array(
'adm') : array()
1099 if($a_show_admin_permissions)
1101 $this->ctrl->redirect($this,
'adminPerm');
1105 $this->ctrl->redirect($this,
'perm');
1118 global $rbacadmin, $rbacsystem, $rbacreview,
$tree;
1127 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1130 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
1133 if ($this->object->getId() ==
$_POST[
"adopt"])
1140 $parentRoles = $rbacreview->getParentRoleIds($this->obj_ref_id,
true);
1141 $rbacadmin->copyRoleTemplatePermissions(
1143 $parentRoles[
$_POST[
"adopt"]][
"parent"],
1145 $this->object->getId(),
1149 $this->
object->update();
1152 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_POST[
"adopt"]);
1153 ilUtil::sendSuccess($this->lng->txt(
"msg_perm_adopted_from1").
" '".$obj_data->getTitle().
"'.<br/>".
1154 $this->lng->txt(
"msg_perm_adopted_from2"),
true);
1157 $this->ctrl->redirect($this,
"perm");
1167 $this->assignUserObject();
1179 global $rbacreview,$rbacadmin;
1181 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1187 $this->obj_ref_id != ROLE_FOLDER_ID)
1194 $GLOBALS[
'lng']->loadLanguageModule(
'search');
1199 $assigned_users_all = $rbacreview->assignedUsers($this->object->getId());
1202 $assigned_users_new = array_diff($a_user_ids,array_intersect($a_user_ids,$assigned_users_all));
1205 if (count($assigned_users_new) == 0)
1208 $this->ctrl->redirect($this,
'userassignment');
1212 foreach ($assigned_users_new as $user)
1214 $rbacadmin->assignUser($this->object->getId(),$user,
false);
1218 $this->
object->update();
1221 $this->ctrl->redirect($this,
'userassignment');
1231 global $rbacsystem, $rbacadmin, $rbacreview;
1233 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1235 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1238 $selected_users = (
$_POST[
"user_id"]) ?
$_POST[
"user_id"] : array(
$_GET[
"user_id"]);
1240 if ($selected_users[0]=== NULL)
1242 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1246 if ($this->object->getId() == SYSTEM_ROLE_ID)
1248 if ($admin = array_search(SYSTEM_USER_ID,$selected_users) !==
false)
1249 unset($selected_users[$admin]);
1253 $last_role = array();
1254 $global_roles = $rbacreview->getGlobalRoles();
1256 foreach ($selected_users as $user)
1258 $assigned_roles = $rbacreview->assignedRoles($user);
1259 $assigned_global_roles = array_intersect($assigned_roles,$global_roles);
1261 if (count($assigned_roles) == 1 or (count($assigned_global_roles) == 1 and in_array($this->object->getId(),$assigned_global_roles)))
1263 $userObj = $this->ilias->obj_factory->getInstanceByObjId($user);
1264 $last_role[$user] = $userObj->getFullName();
1271 foreach ($selected_users as $user)
1273 if(!isset($last_role[$user]))
1275 $rbacadmin->deassignUser($this->object->getId(), $user);
1280 $this->
object->update();
1283 if(count($last_role))
1285 $user_list = implode(
", ",$last_role);
1286 ilUtil::sendFailure($this->lng->txt(
'msg_is_last_role').
': '.$user_list.
'<br />'.$this->lng->txt(
'msg_min_one_role'),
true);
1292 $this->ctrl->redirect($this,
'userassignment');
1303 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1305 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1308 $this->tabs_gui->setTabActive(
'user_assignment');
1310 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.rbac_ua.html',
'Services/AccessControl');
1312 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1316 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
1318 $this->object->getId() != SYSTEM_ROLE_ID ||
1320 !$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID) or
1328 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1333 'auto_complete_name' => $lng->txt(
'user'),
1334 'submit_name' => $lng->txt(
'add')
1345 $this->lng->txt(
'search_user'),
1346 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start')
1352 $this->lng->txt(
'role_mailto'),
1353 $this->ctrl->getLinkTarget($this,
'mailToRole')
1355 $this->tpl->setVariable(
'BUTTONS_UA',$tb->getHTML());
1358 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
1359 $role_assignment_editable =
true;
1361 $this->object->getId() == SYSTEM_ROLE_ID &&
1364 $role_assignment_editable =
false;
1367 include_once
'./Services/AccessControl/classes/class.ilAssignedUsersTableGUI.php';
1370 $this->tpl->setVariable(
'TABLE_UA',$ut->getHTML());
1383 if (
$_GET[
"new_type"] !=
"role")
1385 $this->ctrl->redirect($this,
"userassignment");
1389 $this->ctrl->redirectByClass(
"ilobjrolefoldergui",
"view");
1396 global $rbacsystem,$rbacreview;
1400 if (!is_array(
$_POST[
"role"]))
1403 $this->searchObject();
1408 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_usr_selection.html",
"Services/AccessControl");
1409 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"role_new_search"));
1414 foreach (
$_POST[
"role"] as $role_id)
1416 $members = array_merge($rbacreview->assignedUsers($role_id),$members);
1419 $members = array_unique($members);
1423 $f_result = array();
1425 foreach($members as $user)
1432 $user_ids[$counter] = $user;
1436 $f_result[$counter][] = $tmp_obj->getLogin();
1437 $f_result[$counter][] = $tmp_obj->getFirstname();
1438 $f_result[$counter][] = $tmp_obj->getLastname();
1444 $this->__showSearchUserTable($f_result,$user_ids,
"listUsersRole");
1455 foreach ($a_path_arr as
$data)
1462 $path .= $data[
'title'];
1465 if (strlen(
$path) > 50)
1467 return '...'.substr(
$path,-50);
1476 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
1477 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
1497 $this->tpl->setTitle($this->lng->txt(
'role'));
1498 $this->tpl->setDescription($this->object->getTitle());
1501 $this->
getTabs($this->tabs_gui);
1510 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html",
"Services/Locator");
1514 foreach ($tree->getPathFull($this->obj_ref_id) as $key =>
$row)
1518 $this->tpl->touchBlock(
'locator_separator_prefix');
1521 $this->tpl->setCurrentBlock(
"locator_item");
1523 if (
$row[
"type"] ==
'rolf')
1525 $this->tpl->setVariable(
"ITEM",$this->object->getTitle());
1526 $this->tpl->setVariable(
"LINK_ITEM",$this->ctrl->getLinkTarget($this));
1528 elseif (
$row[
"child"] != $tree->getRootId())
1530 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$row[
"child"]);
1531 $this->tpl->setVariable(
"ITEM",
$row[
"title"]);
1532 $this->tpl->setVariable(
"LINK_ITEM",
1533 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
""));
1537 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$row[
"child"]);
1538 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"repository"));
1539 $this->tpl->setVariable(
"LINK_ITEM",
1540 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
""));
1542 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
1544 $this->tpl->parseCurrentBlock();
1547 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
1548 $this->tpl->parseCurrentBlock();
1559 if (
$_GET[
"admin_mode"] ==
"settings"
1560 &&
$_GET[
"ref_id"] == ROLE_FOLDER_ID)
1564 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
1566 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
1568 if (
$_GET[
"obj_id"] > 0)
1570 $ilLocator->addItem($this->object->getTitle(),
1571 $this->ctrl->getLinkTarget($this,
"view"));
1585 global $rbacsystem,$rbacreview, $ilHelp;
1587 $base_role_container = $rbacreview->getFoldersAssignedToRole($this->object->getId(),
true);
1590 $activate_role_edit =
false;
1594 if (in_array($this->obj_ref_id,$base_role_container) ||
1595 (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" &&
1596 $_GET[
"admin_mode"] ==
"settings"))
1598 $activate_role_edit =
true;
1602 $tabs_gui->clearTargets();
1604 $ilHelp->setScreenIdComponent(
"role");
1606 if ($this->back_target !=
"")
1608 $tabs_gui->setBackTarget(
1609 $this->back_target[
"text"],$this->back_target[
"link"]);
1612 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit)
1614 $tabs_gui->addTarget(
"edit_properties",
1615 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"update"), get_class($this));
1631 $tabs_gui->addTarget(
1632 "default_perm_settings",
1633 $this->ctrl->getLinkTarget($this,
"perm"), array(),get_class($this)
1637 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit && $this->
object->getId() != ANONYMOUS_ROLE_ID)
1639 $tabs_gui->addTarget(
"user_assignment",
1640 $this->ctrl->getLinkTarget($this,
"userassignment"),
1641 array(
"deassignUser",
"userassignment",
"assignUser",
"searchUserForm",
"search"),
1645 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit && $this->
object->getId() != ANONYMOUS_ROLE_ID)
1647 $tabs_gui->addTarget(
"desktop_items",
1648 $this->ctrl->getLinkTarget($this,
"listDesktopItems"),
1649 array(
"listDesktopItems",
"deleteDesktopItems",
"selectDesktopItem",
"askDeleteDesktopItem"),
1654 $tabs_gui->addTarget(
1656 $this->ctrl->getLinkTargetByClass(
'ilExportGUI'),
1668 if(count($obj_ids) > 1)
1670 $_SESSION[
'mail_roles'][] =
'#il_role_'.$this->object->getId();
1674 $_SESSION[
'mail_roles'][] = $rbacreview->getRoleMailboxAddress($this->object->getId());
1677 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
1684 global $rbacsystem,$ilAccess;
1686 $a_perm_obj = $a_perm_obj ? $a_perm_obj : $a_perm_global;
1688 if($this->obj_ref_id == ROLE_FOLDER_ID)
1690 return $rbacsystem->checkAccess($a_perm_global,$this->obj_ref_id);
1694 return $ilAccess->checkAccess($a_perm_obj,
'',$this->obj_ref_id);
1706 if(!(
int)
$_POST[
'recursive'] and !is_array(
$_POST[
'recursive_list']))
1712 if($rbacreview->isProtected($this->obj_ref_id, $this->object->getId()))
1716 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
1722 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
1732 $protected =
$_POST[
'protected'];
1734 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1736 $form->setFormAction($this->ctrl->getFormAction($this,
'changeExistingObjects'));
1737 $form->setTitle($this->lng->txt(
'rbac_change_existing_confirm_tbl'));
1739 $form->addCommandButton(
'changeExistingObjects', $this->lng->txt(
'change_existing_objects'));
1740 $form->addCommandButton(
'perm',$this->lng->txt(
'cancel'));
1745 serialize(array(
'all')) :
1746 serialize(
$_POST[
'recursive_list'])
1748 $form->addItem($hidden);
1756 $this->lng->txt(
'rbac_keep_local_policies'),
1758 $this->lng->txt(
'rbac_keep_local_policies_info')
1765 $this->lng->txt(
'rbac_keep_local_policies'),
1767 $this->lng->txt(
'rbac_unprotected_keep_local_policies_info')
1771 $rad->addOption($keep);
1776 $this->lng->txt(
'rbac_delete_local_policies'),
1778 $this->lng->txt(
'rbac_delete_local_policies_info')
1784 $this->lng->txt(
'rbac_delete_local_policies'),
1786 $this->lng->txt(
'rbac_unprotected_delete_local_policies_info')
1789 $rad->addOption($del);
1791 $form->addItem($rad);
1792 $this->tpl->setContent($form->getHTML());
1801 global
$tree,$rbacreview,$rbacadmin;
1803 $mode = (int)
$_POST[
'mode'];
1804 $start = ($this->obj_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID :
$this->obj_ref_id);
1809 $this->ctrl->redirect($this,
'perm');
1823 case 'default_perm_settings':
1824 if($this->obj_ref_id != ROLE_FOLDER_ID)
1828 $ilTabs->addSubTabTarget(
1829 'rbac_repository_permissions',
1830 $this->ctrl->getLinkTarget($this,
'perm')
1832 $ilTabs->addSubTabTarget(
1833 'rbac_admin_permissions',
1834 $this->ctrl->getLinkTarget($this,
'adminPerm')