4 include_once
"./classes/class.ilObjectGUI.php";
5 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
52 function __construct($a_data,$a_id,$a_call_by_reference =
false,$a_prepare_output =
true)
56 $lng->loadLanguageModule(
'rbac');
59 define(
"USER_FOLDER_ID",7);
61 if(
$_GET[
'rolf_ref_id'] !=
'')
63 $this->rolf_ref_id =
$_GET[
'rolf_ref_id'];
67 $this->rolf_ref_id =
$_GET[
'ref_id'];
70 $this->obj_ref_id = $tree->getParentId($this->rolf_ref_id);
77 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
78 $this->ctrl->saveParameter($this, array(
"obj_id",
"rolf_ref_id"));
88 $next_class = $this->ctrl->getNextClass($this);
89 $cmd = $this->ctrl->getCmd();
93 case 'ilrepositorysearchgui':
94 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
96 $rep_search->setCallback($this,
'addUserObject');
99 $this->tabs_gui->setTabActive(
'user_assignment');
100 $this->ctrl->setReturn($this,
'userassignment');
101 $ret =& $this->ctrl->forwardCommand($rep_search);
113 $cmd =
'userassignment';
157 $this->back_target = array(
"text" => $a_text,
163 return $this->back_target ? $this->back_target : array();
197 global $rbacsystem,$rbacreview,
$tree;
200 #if(!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
209 $this->rolf_ref_id != ROLE_FOLDER_ID)
216 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
221 $this->
__showButton(
'selectDesktopItem',$this->lng->txt(
'role_desk_add'));
223 if(!count($items = $role_desk_item_obj->getAll()))
228 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_desktop_item_list.html");
229 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
231 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_role'));
232 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'role_assigned_desk_items').
' ('.$this->
object->getTitle().
')');
233 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
234 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
239 foreach($items as $role_item_id => $item)
243 if(strlen($desc = $tmp_obj->getDescription()))
245 $this->tpl->setCurrentBlock(
"description");
246 $this->tpl->setVariable(
"DESCRIPTION_DESK",$desc);
247 $this->tpl->parseCurrentBlock();
249 $this->tpl->setCurrentBlock(
"desk_row");
250 $this->tpl->setVariable(
"DESK_TITLE",$tmp_obj->getTitle());
252 $this->tpl->setVariable(
"CHECK_DESK",ilUtil::formCheckBox(0,
'del_desk_item[]',$role_item_id));
253 $this->tpl->setVariable(
"TXT_PATH",$this->lng->txt(
'path').
':');
254 $this->tpl->setVariable(
"PATH",$this->
__formatPath($tree->getPathFull($item[
'item_id'])));
255 $this->tpl->parseCurrentBlock();
266 #if(!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
269 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
271 if(!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
273 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
275 if(!count(
$_POST[
'del_desk_item']))
285 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_ask_delete_desktop_item.html");
286 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
288 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_role'));
289 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'role_assigned_desk_items').
' ('.$this->
object->getTitle().
')');
290 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
291 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
292 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
294 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
300 foreach(
$_POST[
'del_desk_item'] as $role_item_id)
302 $item_data = $role_desk_item_obj->
getItem($role_item_id);
305 if(strlen($desc = $tmp_obj->getDescription()))
307 $this->tpl->setCurrentBlock(
"description");
308 $this->tpl->setVariable(
"DESCRIPTION_DESK",$desc);
309 $this->tpl->parseCurrentBlock();
311 $this->tpl->setCurrentBlock(
"desk_row");
312 $this->tpl->setVariable(
"DESK_TITLE",$tmp_obj->getTitle());
314 $this->tpl->parseCurrentBlock();
326 #if (!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
329 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
332 if (!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
334 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
337 if (!count(
$_SESSION[
'role_del_desk_items']))
346 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
350 foreach (
$_SESSION[
'role_del_desk_items'] as $role_item_id)
352 $role_desk_item_obj->
delete($role_item_id);
364 global $rbacsystem,
$tree;
366 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItemSelector.php';
367 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
369 if(!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
371 #$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
377 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_desktop_item_selector.html");
378 $this->
__showButton(
'listDesktopItems',$this->lng->txt(
'back'));
384 $exp->setExpand(
$_GET[
"role_desk_item_link_expand"] ?
$_GET[
"role_desk_item_link_expand"] : $tree->readRootId());
385 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'selectDesktopItem'));
389 $output = $exp->getOutput();
390 $this->tpl->setVariable(
"EXPLORER",$output);
400 if (!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
402 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
407 if (!isset(
$_GET[
'item_id']))
415 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
422 $this->ctrl->redirect($this,
'listDesktopItems');
433 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
436 if($this->creation_mode)
438 $this->ctrl->setParameter($this,
"new_type",
'role');
440 $this->form->setFormAction($this->ctrl->getFormAction($this));
444 case self::MODE_GLOBAL_CREATE:
445 $this->form->setTitle($this->lng->txt(
'role_new'));
446 $this->form->addCommandButton(
'save',$this->lng->txt(
'role_new'));
449 case self::MODE_GLOBAL_UPDATE:
450 $this->form->setTitle($this->lng->txt(
'role_edit'));
451 $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
454 case self::MODE_LOCAL_CREATE:
455 case self::MODE_LOCAL_UPDATE:
458 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
463 $title->setDisabled(
true);
465 $title->setValidationRegexp(
'/^(?!il_).*$/');
466 $title->setValidationFailureMessage($this->lng->txt(
'msg_role_reserved_prefix'));
469 $title->setRequired(
true);
470 $this->form->addItem(
$title);
479 $this->form->addItem($desc);
481 if($this->rolf_ref_id == ROLE_FOLDER_ID)
485 #$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info'));
486 $this->form->addItem($reg);
490 #$la->setInfo($this->lng->txt('rbac_local_admin_info'));
491 $this->form->addItem($la);
496 #$pro->setInfo($this->lng->txt('role_protext_permission_info'));
497 $this->form->addItem($pro);
499 include_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
505 $quo->setInfo($this->lng->txt(
'enter_in_mb_desc').
'<br />'.$this->lng->txt(
'disk_quota_on_role_desc'));
506 $this->form->addItem($quo);
519 $role->
setTitle($this->form->getInput(
'title'));
536 include_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
546 $data[
'pro'] = $rbacreview->isProtected($this->rolf_ref_id, $role->
getId());
548 $this->form->setValuesByArray(
$data);
563 if(!$rbacsystem->checkAccess(
'create_role',$this->rolf_ref_id))
565 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
569 $this->tpl->setContent($this->form->getHTML());
582 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
586 $this->tpl->setContent($this->form->getHTML());
597 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
598 require_once
'classes/class.ilFormat.php';
600 #if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
603 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
611 if (substr($this->object->getTitle(
false),0,3) !=
"il_")
617 $allow_register = (
$_SESSION[
"error_post_vars"][
"Fobject"][
"allow_register"]) ?
"checked=\"checked\"" :
"";
618 $assign_users = (
$_SESSION[
"error_post_vars"][
"Fobject"][
"assign_users"]) ?
"checked=\"checked\"" :
"";
619 $protect_permissions = (
$_SESSION[
"error_post_vars"][
"Fobject"][
"protect_permissions"]) ?
"checked=\"checked\"" :
"";
622 $disk_quota =
$_SESSION[
"error_post_vars"][
"Fobject"][
"disk_quota"];
627 if (substr($this->object->getTitle(),0,3) !=
"il_")
633 $allow_register = ($this->
object->getAllowRegister()) ?
"checked=\"checked\"" :
"";
634 $assign_users = $this->
object->getAssignUsersStatus() ?
"checked=\"checked\"" :
"";
639 $protect_permissions = $rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()) ?
"checked=\"checked\"" :
"";
643 $obj_str =
"&obj_id=".$this->obj_id;
645 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
"title"));
646 $this->tpl->setVariable(
"TXT_DESC",$this->lng->txt(
"desc"));
649 $global_roles = $rbacreview->getGlobalRoles();
651 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
652 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($this->object->getType().
"_edit"));
653 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
654 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
655 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
656 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
657 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
659 if (substr($this->object->getTitle(),0,3) ==
"il_")
661 $this->tpl->setVariable(
"SHOW_TITLE",
ilObjRole::_getTranslation($this->object->getTitle()).
" (".$this->object->getTitle().
")");
663 $rolf = $rbacreview->getFoldersAssignedToRole($this->object->getId(),
true);
664 $parent_node = $this->tree->getParentNodeData($rolf[0]);
666 $this->tpl->setVariable(
"SHOW_DESC",$this->lng->txt(
"obj_".$parent_node[
'type']).
" (".$parent_node[
'obj_id'].
") <br/>".$parent_node[
'title']);
668 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
669 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"back"));
670 $this->tpl->setVariable(
"CMD_SUBMIT",
"cancel");
673 if ($this->object->getId() != ANONYMOUS_ROLE_ID and
674 $this->
object->getId() != SYSTEM_ROLE_ID and
675 in_array($this->object->getId(),$global_roles))
677 $this->tpl->setCurrentBlock(
"allow_register");
678 $this->tpl->setVariable(
"TXT_ALLOW_REGISTER",$this->lng->txt(
"allow_register"));
679 $this->tpl->setVariable(
"ALLOW_REGISTER",$allow_register);
680 $this->tpl->parseCurrentBlock();
682 $this->tpl->setCurrentBlock(
"assign_users");
683 $this->tpl->setVariable(
"TXT_ASSIGN_USERS",$this->lng->txt(
'allow_assign_users'));
684 $this->tpl->setVariable(
"ASSIGN_USERS",$assign_users);
685 $this->tpl->parseCurrentBlock();
687 $this->tpl->setCurrentBlock(
"protect_permissions");
688 $this->tpl->setVariable(
"TXT_PROTECT_PERMISSIONS",$this->lng->txt(
'role_protect_permissions'));
689 $this->tpl->setVariable(
"PROTECT_PERMISSIONS",$protect_permissions);
690 $this->tpl->parseCurrentBlock();
692 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
695 $this->tpl->setCurrentBlock(
"disk_quota");
696 $this->tpl->setVariable(
"TXT_DISK_QUOTA",$this->lng->txt(
"disk_quota"));
697 $this->tpl->setVariable(
"TXT_DISK_QUOTA_DESC",$this->lng->txt(
"enter_in_mb_desc").
'<br>'.$this->lng->txt(
"disk_quota_on_role_desc"));
698 $this->tpl->setVariable(
"DISK_QUOTA",$disk_quota);
699 $this->tpl->parseCurrentBlock();
711 global $rbacadmin,$rbacreview;
716 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
718 $this->role->create();
720 $rbacadmin->setProtected(
722 $this->role->getId(),
723 $this->form->getInput(
'pro') ?
'y' :
'n'
726 $this->ctrl->returnToParent($this);
730 $this->form->setValuesByPost();
731 $this->tpl->setContent($this->form->getHTML());
743 foreach($rbacreview->getRolesOfRoleFolder($this->rolf_ref_id) as $role_id)
745 if($role_id == $a_role_id)
751 if(strcmp(
$title, trim($this->form->getInput(
'title'))) === 0)
753 $this->form->getItemByPostVar(
'title')->setAlert($this->lng->txt(
'rbac_role_exists_alert'));
769 if($this->form->checkInput() and !$this->
checkDuplicate($this->object->getId()))
771 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
773 $this->
object->update();
774 $rbacadmin->setProtected(
776 $this->object->getId(),
777 $this->form->getInput(
'pro') ?
'y' :
'n'
780 $this->ctrl->redirect($this,
'edit');
784 $this->form->setValuesByPost();
785 $this->tpl->setContent($this->form->getHTML());
793 protected function permObject($a_show_admin_permissions =
false)
797 $ilTabs->setTabActive(
'default_perm_settings');
801 if($a_show_admin_permissions)
803 $ilTabs->setSubTabActive(
'rbac_admin_permissions');
807 $ilTabs->setSubTabActive(
'rbac_repository_permissions');
812 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->MESSAGE);
817 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
818 $ilToolbar->addButton(
819 $this->lng->txt(
"adopt_perm_from_template"),
820 $this->ctrl->getLinkTarget($this,
'adoptPerm')
824 $ilToolbar->addButton(
825 $this->lng->txt(
'rbac_delete_role'),
826 $this->ctrl->getLinkTarget($this,
'confirmDeleteRole')
830 $this->tpl->addBlockFile(
833 'tpl.rbac_template_permissions.html',
834 'Services/AccessControl'
837 $this->tpl->setVariable(
'PERM_ACTION',$this->ctrl->getFormAction($this));
839 include_once
'./Services/Accordion/classes/class.ilAccordionGUI.php';
844 if($this->rolf_ref_id == ROLE_FOLDER_ID)
846 if($a_show_admin_permissions)
848 $subs = $objDefinition->getSubObjectsRecursively(
'adm',
true,
true);
852 $subs = $objDefinition->getSubObjectsRecursively(
'root',
true,$a_show_admin_permissions);
857 $subs = $objDefinition->getSubObjectsRecursively($this->
getParentType(),
true,$a_show_admin_permissions);
861 foreach($subs as $subtype => $def)
863 if($objDefinition->isPlugin($subtype))
867 elseif($objDefinition->isSystemObject($subtype))
869 $translation = $this->lng->txt(
"obj_".$subtype);
873 $translation = $this->lng->txt(
'objs_'.$subtype);
876 $sorted[$subtype] = $def;
877 $sorted[$subtype][
'translation'] = $translation;
882 foreach($sorted as $subtype => $def)
884 if($objDefinition->isPlugin($subtype))
888 elseif($objDefinition->isSystemObject($subtype))
890 $translation = $this->lng->txt(
"obj_".$subtype);
894 $translation = $this->lng->txt(
'objs_'.$subtype);
897 include_once
'Services/AccessControl/classes/class.ilObjectRoleTemplatePermissionTableGUI.php';
902 $this->object->getId(),
904 $a_show_admin_permissions
908 $acc->addItem($translation, $tbl->getHTML());
911 $this->tpl->setVariable(
'ACCORDION',$acc->getHTML());
914 include_once
'./Services/AccessControl/classes/class.ilObjectRoleTemplateOptionsTableGUI.php';
919 $this->object->getId(),
920 $a_show_admin_permissions
923 $a_show_admin_permissions ?
'adminPermSave' :
'permSave',
924 $this->lng->txt(
'save')
928 $this->tpl->setVariable(
'OPTIONS_TABLE',$options->getHTML());
958 $ilTabs->setTabActive(
'default_perm_settings');
960 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
963 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
967 $perm_def = $this->
object->__getPermissionDefinitions();
969 $rbac_objects =& $perm_def[0];
970 $rbac_operations =& $perm_def[1];
972 foreach ($rbac_objects as $key => $obj_data)
974 if ($objDefinition->isPlugin($obj_data[
"type"]))
977 "obj_".$obj_data[
"type"]);
981 $rbac_objects[$key][
"name"] = $this->lng->txt(
"obj_".$obj_data[
"type"]);
983 $rbac_objects[$key][
"ops"] = $rbac_operations[$key];
987 if ($this->rolf_ref_id != ROLE_FOLDER_ID)
990 $parent_data = $this->tree->getParentNodeData($this->rolf_ref_id);
992 $subobj_data = $this->objDefinition->getSubObjectsRecursively($parent_data[
"type"]);
995 foreach ($rbac_objects as $key => $obj_data)
997 if ($obj_data[
"type"] ==
"rolf")
999 unset($rbac_objects[$key]);
1003 if (!$subobj_data[$obj_data[
"type"]] and $parent_data[
"type"] != $obj_data[
"type"])
1005 unset($rbac_objects[$key]);
1022 foreach ($rbac_objects as $key => $obj_data)
1024 $arr_selected = $rbacreview->getOperationsOfRole($this->object->getId(), $obj_data[
"type"],
$this->rolf_ref_id);
1025 $arr_checked = array_intersect($arr_selected,array_keys($rbac_operations[$obj_data[
"obj_id"]]));
1027 foreach ($rbac_operations[$obj_data[
"obj_id"]] as $operation)
1030 if ($this->object->getId() == SYSTEM_ROLE_ID)
1037 $checked = in_array($operation[
"ops_id"],$arr_checked);
1042 $box = ilUtil::formCheckBox($checked,
"template_perm[".$obj_data[
"type"].
"][]",$operation[
"ops_id"],$disabled);
1043 $output[
"perm"][$obj_data[
"obj_id"]][$operation[
"ops_id"]] = $box;
1048 $output[
"col_anz"] = count($rbac_objects);
1049 $output[
"txt_save"] = $this->lng->txt(
"save");
1050 $output[
"check_recursive"] = ilUtil::formCheckBox(0,
"recursive",1);
1051 $output[
"text_recursive"] = $this->lng->txt(
"change_existing_objects");
1052 $output[
"text_recursive_desc"] = $this->lng->txt(
"change_existing_objects_desc");
1054 $protected_disabled =
true;
1056 if ($this->rolf_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(),
$this->rolf_ref_id))
1058 $protected_disabled =
false;
1061 $output[
"check_protected"] = ilUtil::formCheckBox($rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()),
1064 $protected_disabled);
1066 $output[
"text_protected"] = $this->lng->txt(
"role_protect_permissions");
1067 $output[
"text_protected_desc"] = $this->lng->txt(
"role_protect_permissions_desc");
1077 $output[
"formaction"] = $this->ctrl->getFormAction($this);
1079 $this->data = $output;
1086 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.adm_perm_role.html');
1089 if($access and $this->object->isDeletable($this->rolf_ref_id))
1091 $this->tpl->setVariable(
'LINK_DELETE_ROLE',$this->ctrl->getLinkTarget($this,
'confirmDeleteRole'));
1092 $this->tpl->setVariable(
'TXT_DELETE_ROLE',$this->lng->txt(
'rbac_delete_role'));
1093 $this->tpl->setVariable(
'TXT_FOOTER_DELETE_ROLE',$this->lng->txt(
'rbac_delete_role'));
1096 foreach ($rbac_objects as $obj_data)
1099 $this->tpl->setCurrentBlock(
"object_operations");
1103 foreach ($obj_data[
"ops"] as $operation)
1105 $ops_ids[] = $operation[
"ops_id"];
1108 $css_row =
"tblrow1";
1109 $this->tpl->setVariable(
"CSS_ROW",$css_row);
1110 $this->tpl->setVariable(
"PERMISSION",$operation[
"name"]);
1111 if (substr($operation[
"title"], 0, 7) ==
"create_")
1113 if ($this->objDefinition->getDevMode(substr($operation[
"title"], 7, strlen($operation[
"title"]) -7)))
1115 $this->tpl->setVariable(
"TXT_NOT_IMPL",
"(".$this->lng->txt(
"not_implemented_yet").
")");
1118 $this->tpl->setVariable(
"CHECK_PERMISSION",$this->data[
"perm"][$obj_data[
"obj_id"]][$operation[
"ops_id"]]);
1119 $this->tpl->setVariable(
"LABEL_ID",
"template_perm_".$obj_data[
"type"].
"_".$operation[
"ops_id"]);
1120 $this->tpl->parseCurrentBlock();
1124 $this->tpl->setCurrentBlock(
"object_type");
1127 if ($objDefinition->isSystemObject($obj_data[
"type"]) &&
1128 $obj_data[
"type"] !=
"root")
1130 $this->tpl->setVariable(
"TXT_ADMINIS",
"(".$this->lng->txt(
"administration").
") ");
1133 $this->tpl->setVariable(
"TXT_OBJ_TYPE",$obj_data[
"name"]);
1136 if ($this->objDefinition->getDevMode($obj_data[
"type"]))
1138 $this->tpl->setVariable(
"TXT_NOT_IMPL",
"(".$this->lng->txt(
"not_implemented_yet").
")");
1140 else if ($obj_data[
"type"] ==
"icrs" and !$this->ilias->getSetting(
"ilinc_active"))
1142 $this->tpl->setVariable(
"TXT_NOT_IMPL",
"(".$this->lng->txt(
"not_enabled_or_configured").
")");
1146 $this->tpl->setVariable(
"OBJ_TYPE",$obj_data[
"type"]);
1147 $this->tpl->setVariable(
"CHANGE_PERM_OBJ_TYPE_DESC",$this->lng->txt(
"change_existing_object_type_desc"));
1150 if ($objDefinition->isPlugin($obj_data[
"type"]))
1152 $this->tpl->setVariable(
"CHANGE_PERM_OBJ_TYPE",$this->lng->txt(
"change_existing_prefix").
" ".
1154 " ".$this->lng->txt(
"change_existing_suffix"));
1156 else if ($objDefinition->isSystemObject($obj_data[
"type"]))
1158 $this->tpl->setVariable(
"CHANGE_PERM_OBJ_TYPE",$this->lng->txt(
"change_existing_prefix_single").
" ".$this->lng->txt(
"obj_".$obj_data[
"type"]).
" ".$this->lng->txt(
"change_existing_suffix_single"));
1163 $this->tpl->setVariable(
"CHANGE_PERM_OBJ_TYPE",$this->lng->txt(
"change_existing_prefix").
" ".$this->lng->txt(
"objs_".$obj_data[
"type"]).
" ".$this->lng->txt(
"change_existing_suffix"));
1167 $this->tpl->setVariable(
"JS_VARNAME",
"template_perm_".$obj_data[
"type"]);
1169 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
1170 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
1172 $this->tpl->parseCurrentBlock();
1177 if ($this->object->getId() != SYSTEM_ROLE_ID)
1179 $this->tpl->setCurrentBlock(
"tblfooter_special_options");
1180 $this->tpl->setVariable(
"TXT_PERM_SPECIAL_OPTIONS",$this->lng->txt(
"perm_special_options"));
1181 $this->tpl->parseCurrentBlock();
1183 $this->tpl->setCurrentBlock(
"tblfooter_recursive");
1184 $this->tpl->setVariable(
"COL_ANZ",3);
1185 $this->tpl->setVariable(
"CHECK_RECURSIVE",$this->data[
"check_recursive"]);
1186 $this->tpl->setVariable(
"TXT_RECURSIVE",$this->data[
"text_recursive"]);
1187 $this->tpl->setVariable(
"TXT_RECURSIVE_DESC",$this->data[
"text_recursive_desc"]);
1188 $this->tpl->parseCurrentBlock();
1190 $this->tpl->setCurrentBlock(
"tblfooter_protected");
1191 $this->tpl->setVariable(
"COL_ANZ",3);
1192 $this->tpl->setVariable(
"CHECK_PROTECTED",$this->data[
"check_protected"]);
1193 $this->tpl->setVariable(
"TXT_PROTECTED",$this->data[
"text_protected"]);
1194 $this->tpl->setVariable(
"TXT_PROTECTED_DESC",$this->data[
"text_protected_desc"]);
1195 $this->tpl->parseCurrentBlock();
1197 $this->tpl->setCurrentBlock(
"tblfooter_standard");
1198 $this->tpl->setVariable(
"COL_ANZ_PLUS",3);
1199 $this->tpl->setVariable(
"TXT_SAVE",$this->data[
"txt_save"]);
1200 $this->tpl->parseCurrentBlock();
1203 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
1204 $ilToolbar->addButton($this->lng->txt(
"adopt_perm_from_template"),$this->ctrl->getLinkTarget($this,
'adoptPerm'));
1209 $this->tpl->setCurrentBlock(
"tblfooter_sysrole");
1210 $this->tpl->setVariable(
"COL_ANZ_SYS",3);
1211 $this->tpl->parseCurrentBlock();
1214 $this->tpl->setCurrentBlock(
"sysrole_msg");
1215 $this->tpl->setVariable(
"TXT_SYSROLE_MSG",$this->data[
"sysrole_msg"]);
1216 $this->tpl->parseCurrentBlock();
1219 $this->tpl->setCurrentBlock(
"adm_content");
1220 $this->tpl->setVariable(
"TBL_TITLE_IMG",
ilUtil::getImagePath(
"icon_".$this->object->getType().
".gif"));
1221 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt($this->object->getType()));
1223 $this->tpl->setVariable(
"TBL_HELP_LINK",
"tbl_help.php");
1224 $this->tpl->setVariable(
"TBL_HELP_IMG_ALT",$this->lng->txt(
"help"));
1227 $global_roles = $rbacreview->getGlobalRoles();
1229 if (in_array($this->object->getId(),$global_roles))
1236 if($rolf = $rbacreview->getFoldersAssignedToRole($this->object->getId(),
true))
1238 $parent_node = $this->tree->getParentNodeData($rolf[0]);
1239 $desc = $this->lng->txt(
"obj_".$parent_node[
'type']).
" (#".$parent_node[
'obj_id'].
") : ".$parent_node[
'title'];
1243 $description =
" <span class=\"small\">(".$desc.
")</span>";
1246 if (substr($this->object->getTitle(),0,3) ==
"il_")
1252 $title = $this->
object->getTitle();
1255 $this->tpl->setVariable(
"TBL_TITLE",
$title.$description);
1258 $pid = $tree->getParentId($this->rolf_ref_id);
1260 if ($this->rolf_ref_id != ROLE_FOLDER_ID)
1262 $info = sprintf($this->lng->txt(
"perm_role_info_1"),
1263 $this->
object->getTitle(), $ptitle).
" ".
1264 sprintf($this->lng->txt(
"perm_role_info_2"),
1265 $this->
object->getTitle(), $ptitle);
1269 $info = sprintf($this->lng->txt(
"perm_role_info_glob_1"),
1270 $this->
object->getTitle(), $ptitle).
" ".
1271 sprintf($this->lng->txt(
"perm_role_info_glob_2"),
1272 $this->
object->getTitle(), $ptitle);
1274 $this->tpl->setVariable(
"TXT_TITLE_INFO", $info);
1276 $this->tpl->setVariable(
"TXT_PERMISSION",$this->data[
"txt_permission"]);
1277 $this->tpl->setVariable(
"FORMACTION",$this->data[
"formaction"]);
1278 $this->tpl->parseCurrentBlock();
1287 $parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id,
true);
1289 foreach($parent_role_ids as $id => $tmp)
1297 foreach($sorted_ids as $id)
1299 $par = $parent_role_ids[$id];
1300 if ($par[
"obj_id"] != SYSTEM_ROLE_ID && $this->object->getId() != $par[
"obj_id"])
1303 $output[
"adopt"][$key][
"css_row_adopt"] = ($key % 2 == 0) ?
"tblrow1" :
"tblrow2";
1304 $output[
"adopt"][$key][
"check_adopt"] = $radio;
1305 $output[
"adopt"][$key][
"role_id"] = $par[
"obj_id"];
1306 $output[
"adopt"][$key][
"type"] = ($par[
"type"] ==
'role' ? $this->lng->txt(
'obj_role') : $this->lng->txt(
'obj_rolt'));
1308 $output[
"adopt"][$key][
"role_desc"] = $par[
"desc"];
1313 $output[
"formaction_adopt"] = $this->ctrl->getFormAction($this);
1314 $output[
"message_middle"] = $this->lng->txt(
"adopt_perm_from_template");
1317 $tpl =
new ilTemplate(
"tpl.adm_copy_role.html",
true,
true,
"Services/AccessControl");
1319 $tpl->setCurrentBlock(
"ADOPT_PERM_ROW");
1320 foreach ($output[
"adopt"] as $key => $value)
1322 $tpl->setVariable(
"CSS_ROW_ADOPT",$value[
"css_row_adopt"]);
1323 $tpl->setVariable(
"CHECK_ADOPT",$value[
"check_adopt"]);
1324 $tpl->setVariable(
"LABEL_ID",$value[
"role_id"]);
1325 $tpl->setVariable(
"TYPE",$value[
"type"]);
1326 $tpl->setVariable(
"ROLE_NAME",$value[
"role_name"]);
1327 if(strlen($value[
'role_desc']))
1329 $tpl->setVariable(
'ROLE_DESC',$value[
'role_desc']);
1331 $tpl->parseCurrentBlock();
1334 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
1335 $tpl->setVariable(
"MESSAGE_MIDDLE",$output[
"message_middle"]);
1336 $tpl->setVariable(
"FORMACTION_ADOPT",$output[
"formaction_adopt"]);
1337 $tpl->setVariable(
"ADOPT",$this->lng->txt(
'copy'));
1338 $tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
1340 $tpl->setVariable(
'HEAD_ROLE',$this->lng->txt(
'title'));
1341 $tpl->setVariable(
'HEAD_TYPE',$this->lng->txt(
'type'));
1343 $this->tpl->setContent(
$tpl->get());
1352 global
$ilErr,$rbacreview,$ilUser;
1354 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1357 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->WARNING);
1360 $question = $this->lng->txt(
'rbac_role_delete_qst');
1361 if($rbacreview->isAssigned($ilUser->getId(), $this->
object->getId()))
1363 $question .= (
'<br />'.$this->lng->txt(
'rbac_role_delete_self'));
1367 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1370 $confirm->setFormAction($this->ctrl->getFormAction($this));
1371 $confirm->setHeaderText($question);
1372 $confirm->setCancel($this->lng->txt(
'cancel'),
'perm');
1373 $confirm->setConfirm($this->lng->txt(
'rbac_delete_role'),
'performDeleteRole');
1377 $this->object->getId(),
1378 $this->
object->getTitle(),
1382 $this->tpl->setContent($confirm->getHTML());
1395 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1398 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->WARNING);
1401 $this->
object->setParent((
int)
$_GET[
'rolf_ref_id']);
1402 $this->
object->delete();
1411 $this->ctrl->returnToParent($this);
1435 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1439 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
1443 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
1445 if($rbac_log_active)
1451 if($this->rolf_ref_id == ROLE_FOLDER_ID)
1453 if($a_show_admin_permissions)
1455 $subs = $objDefinition->getSubObjectsRecursively(
'adm',
true,
true);
1459 $subs = $objDefinition->getSubObjectsRecursively(
'root',
true,
false);
1464 $subs = $objDefinition->getSubObjectsRecursively($this->
getParentType(),
true,
false);
1467 foreach($subs as $subtype => $def)
1470 $rbacadmin->deleteRolePermission($this->object->getId(),
$this->rolf_ref_id,$subtype);
1473 if (empty(
$_POST[
"template_perm"]))
1475 $_POST[
"template_perm"] = array();
1478 foreach (
$_POST[
"template_perm"] as $key => $ops_array)
1481 $rbacadmin->setRolePermission($this->object->getId(), $key, $ops_array,
$this->rolf_ref_id);
1484 if($rbac_log_active)
1492 $this->
object->update();
1495 if ($this->rolf_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(),
$this->rolf_ref_id))
1497 $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),
ilUtil::tf2yn(
$_POST[
'protected']));
1500 if($a_show_admin_permissions)
1502 $_POST[
'recursive'] =
true;
1506 if(!
$_POST[
'recursive'] and !is_array(
$_POST[
'recursive_list']))
1509 if($a_show_admin_permissions)
1511 $this->ctrl->redirect($this,
'adminPerm');
1515 $this->ctrl->redirect($this,
'perm');
1525 $start = ($this->rolf_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $tree->getParentId($this->rolf_ref_id));
1526 if($a_show_admin_permissions)
1528 $start = $tree->getParentId($this->rolf_ref_id);
1533 $this->
object->changeExistingObjects(
1538 #$a_show_admin_permissions ? array(
'adm') : array()
1543 $this->
object->changeExistingObjects(
1548 #$a_show_admin_permissions ? array(
'adm') : array()
1553 if($a_show_admin_permissions)
1555 $this->ctrl->redirect($this,
'adminPerm');
1559 $this->ctrl->redirect($this,
'perm');
1572 global $rbacadmin, $rbacsystem, $rbacreview,
$tree;
1581 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1584 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
1587 if ($this->object->getId() ==
$_POST[
"adopt"])
1594 $parentRoles = $rbacreview->getParentRoleIds($this->rolf_ref_id,
true);
1595 $rbacadmin->copyRoleTemplatePermissions(
1597 $parentRoles[
$_POST[
"adopt"]][
"parent"],
1599 $this->object->getId(),
1603 $this->
object->update();
1606 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_POST[
"adopt"]);
1607 ilUtil::sendSuccess($this->lng->txt(
"msg_perm_adopted_from1").
" '".$obj_data->getTitle().
"'.<br/>".
1608 $this->lng->txt(
"msg_perm_adopted_from2"),
true);
1611 $this->ctrl->redirect($this,
"perm");
1633 global $rbacsystem, $rbacadmin, $rbacreview;
1635 #if (!$rbacsystem->checkAccess("edit_userassignment", $this->rolf_ref_id))
1636 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1638 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1642 $this->rolf_ref_id != ROLE_FOLDER_ID)
1644 $this->ilias->raiseError($this->lng->txt(
"err_role_not_assignable"),$this->ilias->error_obj->MESSAGE);
1647 if(!isset(
$_POST[
"user"]))
1655 $selected_users =
$_POST[
"user"];
1656 $assigned_users_all = $rbacreview->assignedUsers($this->object->getId());
1659 $assigned_users_new = array_diff($selected_users,array_intersect($selected_users,$assigned_users_all));
1662 if (count($assigned_users_new) == 0)
1671 foreach ($assigned_users_new as
$user)
1673 $rbacadmin->assignUser($this->object->getId(),
$user,
false);
1677 $this->
object->update();
1681 $this->ctrl->redirect($this,
'userassignment');
1691 global $rbacreview,$rbacadmin;
1693 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1699 $this->rolf_ref_id != ROLE_FOLDER_ID)
1710 $assigned_users_all = $rbacreview->assignedUsers($this->object->getId());
1713 $assigned_users_new = array_diff($a_user_ids,array_intersect($a_user_ids,$assigned_users_all));
1716 if (count($assigned_users_new) == 0)
1723 foreach ($assigned_users_new as
$user)
1725 $rbacadmin->assignUser($this->object->getId(),
$user,
false);
1729 $this->
object->update();
1732 $this->ctrl->redirect($this,
'userassignment');
1742 global $rbacsystem, $rbacadmin, $rbacreview;
1744 #if (!$rbacsystem->checkAccess("edit_userassignment", $this->rolf_ref_id))
1745 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1747 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1750 $selected_users = (
$_POST[
"user_id"]) ?
$_POST[
"user_id"] : array(
$_GET[
"user_id"]);
1752 if ($selected_users[0]=== NULL)
1754 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1758 if ($this->object->getId() == SYSTEM_ROLE_ID)
1760 if ($admin = array_search(SYSTEM_USER_ID,$selected_users) !==
false)
1761 unset($selected_users[$admin]);
1765 $last_role = array();
1766 $global_roles = $rbacreview->getGlobalRoles();
1768 foreach ($selected_users as
$user)
1770 $assigned_roles = $rbacreview->assignedRoles($user);
1771 $assigned_global_roles = array_intersect($assigned_roles,$global_roles);
1773 if (count($assigned_roles) == 1 or (count($assigned_global_roles) == 1 and in_array($this->object->getId(),$assigned_global_roles)))
1775 $userObj = $this->ilias->obj_factory->getInstanceByObjId($user);
1776 $last_role[
$user] = $userObj->getFullName();
1783 foreach ($selected_users as $user)
1785 if(!isset($last_role[$user]))
1787 $rbacadmin->deassignUser($this->object->getId(),
$user);
1792 $this->
object->update();
1795 if(count($last_role))
1797 $user_list = implode(
", ",$last_role);
1798 ilUtil::sendFailure($this->lng->txt(
'msg_is_last_role').
': '.$user_list.
'<br />'.$this->lng->txt(
'msg_min_one_role'),
true);
1804 $this->ctrl->redirect($this,
'userassignment');
1814 global $rbacsystem, $rbacreview, $rbacadmin,
$tree;
1815 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1816 require_once
'classes/class.ilFormat.php';
1829 $access = $this->
checkAccess(
'write',
'edit_permission');
1832 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_role"),$this->ilias->error_obj->MESSAGE);
1835 if (substr($this->object->getTitle(),0,3) !=
"il_")
1838 if (empty(
$_POST[
"Fobject"][
"title"]))
1840 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
1844 if (substr(
$_POST[
"Fobject"][
"title"],0,3) ==
"il_")
1846 $this->ilias->raiseError($this->lng->txt(
"msg_role_reserved_prefix"),$this->ilias->error_obj->MESSAGE);
1851 if (! is_numeric(trim(
$_POST[
"Fobject"][
"disk_quota"])) ||
1852 trim(
$_POST[
"Fobject"][
"disk_quota"]) < 0
1855 $this->ilias->raiseError($this->lng->txt(
"msg_disk_quota_illegal_value"),$this->ilias->error_obj->MESSAGE);
1873 if (
$_POST[
"Fobject"][
"allow_register"] ==
"")
1875 $roles_allowed = $this->
object->_lookupRegisterAllowed();
1877 if (count($roles_allowed) == 1 and $roles_allowed[0][
'id'] == $this->object->getId())
1879 $this->ilias->raiseError($this->lng->txt(
"msg_last_role_for_registration"),$this->ilias->error_obj->MESSAGE);
1883 $this->
object->setAllowRegister(
$_POST[
"Fobject"][
"allow_register"]);
1884 $this->
object->toggleAssignUsersStatus(
$_POST[
"Fobject"][
"assign_users"]);
1885 $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),
ilUtil::tf2yn(
$_POST[
"Fobject"][
"protect_permissions"]));
1886 $this->
object->update();
1890 $this->ctrl->redirect($this,
'edit');
1899 global $rbacreview, $rbacsystem;
1902 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1904 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1907 $this->tabs_gui->setTabActive(
'user_assignment');
1909 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.rbac_ua.html',
'Services/AccessControl');
1911 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1913 $tb->setFormAction($this->ctrl->getFormAction($this));
1915 $this->lng->txt(
'role_add_user'),
1916 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start')
1920 $this->lng->txt(
'role_mailto'),
1921 $this->ctrl->getLinkTarget($this,
'mailToRole')
1923 $this->tpl->setVariable(
'BUTTONS_UA',$tb->getHTML());
1925 include_once
'./Services/AccessControl/classes/class.ilAssignedUsersTableGUI.php';
1928 $this->tpl->setVariable(
'TABLE_UA',$ut->getHTML());
1938 $actions = array(
"deassignUser" => $this->lng->txt(
"remove"));
1941 $tpl =& $tbl->getTemplateObject();
1943 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1946 $this->tpl->setCurrentBlock(
"btn_cell");
1947 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
1948 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
'role_add_user'));
1949 $this->tpl->parseCurrentBlock();
1951 $this->
__showButton(
'mailToRole',$this->lng->txt(
'role_mailto'),
'_blank');
1953 $tpl->setCurrentBlock(
"tbl_form_header");
1954 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1955 $tpl->parseCurrentBlock();
1957 $tpl->setCurrentBlock(
"tbl_action_row");
1959 $tpl->setVariable(
"COLUMN_COUNTS",5);
1962 foreach (
$actions as $name => $value)
1964 $tpl->setCurrentBlock(
"tbl_action_btn");
1965 $tpl->setVariable(
"BTN_NAME",$name);
1966 $tpl->setVariable(
"BTN_VALUE",$value);
1967 $tpl->parseCurrentBlock();
1970 if (!empty($a_user_ids))
1973 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
1974 $tpl->setVariable(
"JS_VARNAME",
"user_id");
1976 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
1977 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
1978 $tpl->parseCurrentBlock();
1981 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
1982 $this->ctrl->setParameter($this,
"cmd",
"userassignment");
1985 $tbl->setTitle($this->lng->txt(
"assigned_users"),
"icon_usr.gif",$this->lng->txt(
"users"));
1988 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"username"),$this->lng->txt(
"firstname"),
1989 $this->lng->txt(
"lastname"),$this->lng->txt(
"grp_options")));
1990 $tbl->setHeaderVars(array(
"",
"login",
"firstname",
"lastname",
"functions"),
1991 $this->ctrl->getParameterArray($this,
"",
false));
1992 $tbl->setColumnWidth(array(
"",
"20%",
"25%",
"25%",
"30%"));
1996 $this->tpl->setVariable(
"ADM_CONTENT",$tbl->tpl->get());
2003 include_once
"./Services/Table/classes/class.ilTableGUI.php";
2013 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
2017 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
2022 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
2024 $_GET[
"sort_by"] =
"login";
2026 $order =
$_GET[
"sort_by"];
2030 $tbl->setOrderColumn($order);
2031 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
2032 $tbl->setOffset(
$_GET[
"offset"]);
2033 $tbl->setLimit(
$_GET[
"limit"]);
2034 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2035 $tbl->setData($result_set);
2043 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
2045 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
2048 $this->lng->loadLanguageModule(
'search');
2050 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_users_search.html");
2052 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
2053 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"role_search_users"));
2054 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
2055 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"role_search_str"] ?
$_SESSION[
"role_search_str"] :
"");
2056 $this->tpl->setVariable(
"SEARCH_FOR",$this->lng->txt(
"exc_search_for"));
2057 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER",$this->lng->txt(
"exc_users"));
2058 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE",$this->lng->txt(
"exc_roles"));
2059 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP",$this->lng->txt(
"exc_groups"));
2060 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
2061 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
2063 $usr = (
$_POST[
"search_for"] ==
"usr" ||
$_POST[
"search_for"] ==
"") ? 1 : 0;
2064 $grp = (
$_POST[
"search_for"] ==
"grp") ? 1 : 0;
2065 $role = (
$_POST[
"search_for"] ==
"role") ? 1 : 0;
2076 unset(
$_SESSION[
"role_delete_member_ids"]);
2077 unset(
$_SESSION[
"role_delete_subscriber_ids"]);
2091 if (
$_GET[
"new_type"] !=
"role")
2093 $this->ctrl->redirect($this,
"userassignment");
2097 $this->ctrl->redirectByClass(
"ilobjrolefoldergui",
"view");
2103 global $rbacsystem,
$tree;
2105 #if (!$rbacsystem->checkAccess("edit_userassignment", $this->rolf_ref_id))
2106 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
2108 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
2114 if (!isset(
$_POST[
"search_for"]) or !isset(
$_POST[
"search_str"]))
2130 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_usr_selection.html");
2131 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"role_new_search"));
2134 $f_result = array();
2136 switch(
$_POST[
"search_for"])
2146 $user_ids[$counter] = $user[
"id"];
2149 $f_result[$counter][] = $tmp_obj->getLogin();
2150 $f_result[$counter][] = $tmp_obj->getFirstname();
2151 $f_result[$counter][] = $tmp_obj->getLastname();
2164 if ($role[
"id"] == ANONYMOUS_ROLE_ID)
2175 if ($tmp_obj->getCountMembers() == 0)
2180 $role_ids[$counter] = $role[
"id"];
2183 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
2184 $f_result[$counter][] = $tmp_obj->getCountMembers();
2197 if(!$tree->isInTree($group[
"id"]))
2208 if ($tmp_obj->getId() == $this->
object->getId())
2213 $grp_ids[$counter] = $group[
"id"];
2216 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
2217 $f_result[$counter][] = $tmp_obj->getCountMembers();
2230 include_once(
"./classes/class.ilSearch.php");
2232 $this->lng->loadLanguageModule(
"content");
2234 $search->setPerformUpdate(
false);
2236 $search->setCombination(
"and");
2237 $search->setSearchFor(array(0 => $a_search_for));
2238 $search->setSearchType(
'new');
2240 if ($search->validate($message))
2242 $search->performSearch();
2247 $this->ctrl->redirect($this,
"searchUserForm");
2250 return $search->getResultByType($a_search_for);
2255 $return_to =
"searchUserForm";
2257 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup")
2259 $return_to =
"search";
2263 $tpl =& $tbl->getTemplateObject();
2266 $tpl->setCurrentBlock(
"tbl_form_header");
2267 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2268 $tpl->parseCurrentBlock();
2270 $tpl->setCurrentBlock(
"tbl_action_btn");
2271 $tpl->setVariable(
"BTN_NAME",$return_to);
2272 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
2273 $tpl->parseCurrentBlock();
2275 $tpl->setCurrentBlock(
"tbl_action_btn");
2276 $tpl->setVariable(
"BTN_NAME",
"assignUser");
2277 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
2278 $tpl->parseCurrentBlock();
2280 if (!empty($a_user_ids))
2283 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
2284 $tpl->setVariable(
"JS_VARNAME",
"user");
2286 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
2287 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
2288 $tpl->parseCurrentBlock();
2291 $tpl->setCurrentBlock(
"tbl_action_row");
2292 $tpl->setVariable(
"COLUMN_COUNTS",4);
2294 $tpl->parseCurrentBlock();
2296 $tbl->setTitle($this->lng->txt(
"role_header_edit_users"),
"icon_usr.gif",$this->lng->txt(
"role_header_edit_users"));
2297 $tbl->setHeaderNames(array(
"",
2298 $this->lng->txt(
"username"),
2299 $this->lng->txt(
"firstname"),
2300 $this->lng->txt(
"lastname")));
2301 $tbl->setHeaderVars(array(
"",
2305 $this->ctrl->getParameterArray($this,$a_cmd,
false));
2312 $tbl->setColumnWidth(array(
"",
"33%",
"33%",
"33%"));
2317 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
2325 $tpl =& $tbl->getTemplateObject();
2327 $tpl->setCurrentBlock(
"tbl_form_header");
2328 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2329 $tpl->parseCurrentBlock();
2331 $tpl->setCurrentBlock(
"tbl_action_btn");
2332 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
2333 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
2334 $tpl->parseCurrentBlock();
2336 $tpl->setCurrentBlock(
"tbl_action_btn");
2337 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
2338 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"role_list_users"));
2339 $tpl->parseCurrentBlock();
2341 if (!empty($a_role_ids))
2344 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
2345 $tpl->setVariable(
"JS_VARNAME",
"role");
2347 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
2348 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
2349 $tpl->parseCurrentBlock();
2352 $tpl->setCurrentBlock(
"tbl_action_row");
2353 $tpl->setVariable(
"COLUMN_COUNTS",4);
2355 $tpl->parseCurrentBlock();
2357 $tbl->setTitle($this->lng->txt(
"role_header_edit_users"),
"icon_usr.gif",$this->lng->txt(
"role_header_edit_users"));
2358 $tbl->setHeaderNames(array(
"",
2359 $this->lng->txt(
"obj_role"),
2360 $this->lng->txt(
"role_count_users")));
2361 $tbl->setHeaderVars(array(
"",
2364 $this->ctrl->getParameterArray($this,
"search",
false));
2371 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
2377 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
2385 $tpl =& $tbl->getTemplateObject();
2387 $tpl->setCurrentBlock(
"tbl_form_header");
2388 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2389 $tpl->parseCurrentBlock();
2391 $tpl->setCurrentBlock(
"tbl_action_btn");
2392 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
2393 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
2394 $tpl->parseCurrentBlock();
2396 $tpl->setCurrentBlock(
"tbl_action_btn");
2397 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
2398 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
2399 $tpl->parseCurrentBlock();
2401 if (!empty($a_grp_ids))
2404 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
2405 $tpl->setVariable(
"JS_VARNAME",
"group");
2407 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
2408 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
2409 $tpl->parseCurrentBlock();
2412 $tpl->setCurrentBlock(
"tbl_action_row");
2413 $tpl->setVariable(
"COLUMN_COUNTS",4);
2415 $tpl->parseCurrentBlock();
2417 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr.gif",$this->lng->txt(
"grp_header_edit_members"));
2418 $tbl->setHeaderNames(array(
"",
2419 $this->lng->txt(
"obj_grp"),
2420 $this->lng->txt(
"grp_count_members")));
2421 $tbl->setHeaderVars(array(
"",
2424 array(
"ref_id" => $this->rolf_ref_id,
2425 "obj_id" => $this->object->getId(),
2427 "cmdClass" =>
"ilobjrolegui",
2428 "cmdNode" =>
$_GET[
"cmdNode"]));
2430 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
2436 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
2443 global $rbacsystem,$rbacreview;
2447 if (!is_array(
$_POST[
"role"]))
2455 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_usr_selection.html");
2456 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"role_new_search"));
2461 foreach (
$_POST[
"role"] as $role_id)
2463 $members = array_merge($rbacreview->assignedUsers($role_id),$members);
2466 $members = array_unique($members);
2470 $f_result = array();
2472 foreach($members as
$user)
2479 $user_ids[$counter] =
$user;
2483 $f_result[$counter][] = $tmp_obj->getLogin();
2484 $f_result[$counter][] = $tmp_obj->getFirstname();
2485 $f_result[$counter][] = $tmp_obj->getLastname();
2498 global $rbacsystem,$rbacreview,
$tree;
2502 if (!is_array(
$_POST[
"group"]))
2510 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_usr_selection.html");
2511 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"role_new_search"));
2516 foreach (
$_POST[
"group"] as $group_id)
2518 if (!$tree->isInTree($group_id))
2527 $members = array_merge($tmp_obj->getGroupMemberIds(),$members);
2532 $members = array_unique($members);
2536 $f_result = array();
2538 foreach($members as
$user)
2545 $user_ids[$counter] =
$user;
2548 $f_result[$counter][] = $tmp_obj->getLogin();
2549 $f_result[$counter][] = $tmp_obj->getFirstname();
2550 $f_result[$counter][] = $tmp_obj->getLastname();
2566 foreach ($a_path_arr as
$data)
2573 $path .= $data[
'title'];
2576 if (strlen(
$path) > 50)
2578 return '...'.substr(
$path,-50);
2588 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2589 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
2609 include_once
'./classes/class.ilTabsGUI.php';
2611 $this->tpl->setTitle($this->lng->txt(
'role'));
2612 $this->tpl->setDescription($this->object->getTitle());
2615 #$tabs_gui =& new ilTabsGUI();
2616 $this->
getTabs($this->tabs_gui);
2619 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
2624 global
$tree, $ilias_locator;
2628 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html",
"Services/Locator");
2632 foreach ($tree->getPathFull($this->rolf_ref_id) as $key =>
$row)
2636 $this->tpl->touchBlock(
'locator_separator_prefix');
2639 $this->tpl->setCurrentBlock(
"locator_item");
2641 if (
$row[
"type"] ==
'rolf')
2643 $this->tpl->setVariable(
"ITEM",$this->object->getTitle());
2644 $this->tpl->setVariable(
"LINK_ITEM",$this->ctrl->getLinkTarget($this));
2646 elseif (
$row[
"child"] != $tree->getRootId())
2648 $this->tpl->setVariable(
"ITEM",
$row[
"title"]);
2649 $this->tpl->setVariable(
"LINK_ITEM",
"repository.php?ref_id=".
$row[
"child"]);
2653 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"repository"));
2654 $this->tpl->setVariable(
"LINK_ITEM",
"repository.php?ref_id=".
$row[
"child"]);
2657 $this->tpl->parseCurrentBlock();
2660 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
2661 $this->tpl->parseCurrentBlock();
2672 if (
$_GET[
"admin_mode"] ==
"settings"
2673 &&
$_GET[
"ref_id"] == ROLE_FOLDER_ID)
2675 $ilLocator->addItem($this->lng->txt(
"administration"),
2676 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
2679 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2681 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
2683 if (
$_GET[
"obj_id"] > 0)
2685 $ilLocator->addItem($this->object->getTitle(),
2686 $this->ctrl->getLinkTarget($this,
"view"));
2701 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
2703 if (
$_GET[
"admin_mode"] ==
"settings"
2704 &&
$_GET[
"ref_id"] != SYSTEM_FOLDER_ID)
2707 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
2712 if ($this->object->getRefId() != ROOT_FOLDER_ID &&
2713 $this->
object->getRefId() != SYSTEM_FOLDER_ID)
2715 $par_id = $tree->getParentId($this->object->getRefId());
2716 $tpl->setUpperIcon(
"repository.php?ref_id=".$par_id);
2725 global $rbacsystem,$rbacreview;
2727 $base_role_folder = $rbacreview->getFoldersAssignedToRole($this->object->getId(),
true);
2732 $activate_role_edit =
false;
2737 if (in_array($this->rolf_ref_id,$base_role_folder) ||
2738 (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" &&
2739 $_GET[
"admin_mode"] ==
"settings"))
2741 $activate_role_edit =
true;
2745 $tabs_gui->clearTargets();
2747 if ($this->back_target !=
"")
2749 $tabs_gui->setBackTarget(
2750 $this->back_target[
"text"],$this->back_target[
"link"]);
2753 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit)
2755 $tabs_gui->addTarget(
"edit_properties",
2756 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"update"), get_class($this));
2772 $tabs_gui->addTarget(
2773 "default_perm_settings",
2774 $this->ctrl->getLinkTarget($this,
"perm"), array(),get_class($this)
2778 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit && $this->
object->getId() != ANONYMOUS_ROLE_ID)
2780 $tabs_gui->addTarget(
"user_assignment",
2781 $this->ctrl->getLinkTarget($this,
"userassignment"),
2782 array(
"deassignUser",
"userassignment",
"assignUser",
"searchUserForm",
"search"),
2786 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit && $this->
object->getId() != ANONYMOUS_ROLE_ID)
2788 $tabs_gui->addTarget(
"desktop_items",
2789 $this->ctrl->getLinkTarget($this,
"listDesktopItems"),
2790 array(
"listDesktopItems",
"deleteDesktopItems",
"selectDesktopItem",
"askDeleteDesktopItem"),
2800 if(count($obj_ids) > 1)
2802 $_SESSION[
'mail_roles'][] =
'#il_role_'.$this->object->getId();
2806 $_SESSION[
'mail_roles'][] = $rbacreview->getRoleMailboxAddress($this->object->getId());
2809 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
2816 global $rbacsystem,$ilAccess;
2818 $a_perm_obj = $a_perm_obj ? $a_perm_obj : $a_perm_global;
2820 if($this->rolf_ref_id == ROLE_FOLDER_ID)
2822 return $rbacsystem->checkAccess($a_perm_global,$this->rolf_ref_id);
2826 return $ilAccess->checkAccess($a_perm_obj,
'',$this->obj_ref_id);
2838 if(!(
int)
$_POST[
'recursive'] and !is_array(
$_POST[
'recursive_list']))
2844 if($rbacreview->isProtected($this->rolf_ref_id, $this->object->getId()))
2848 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
2854 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
2864 $protected =
$_POST[
'protected'];
2866 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
2868 $form->setFormAction($this->ctrl->getFormAction($this,
'changeExistingObjects'));
2869 $form->setTitle($this->lng->txt(
'rbac_change_existing_confirm_tbl'));
2871 $form->addCommandButton(
'changeExistingObjects', $this->lng->txt(
'change_existing_objects'));
2872 $form->addCommandButton(
'perm',$this->lng->txt(
'cancel'));
2877 serialize(array(
'all')) :
2878 serialize(
$_POST[
'recursive_list'])
2880 $form->addItem($hidden);
2888 $this->lng->txt(
'rbac_keep_local_policies'),
2890 $this->lng->txt(
'rbac_keep_local_policies_info')
2897 $this->lng->txt(
'rbac_keep_local_policies'),
2899 $this->lng->txt(
'rbac_unprotected_keep_local_policies_info')
2903 $rad->addOption($keep);
2908 $this->lng->txt(
'rbac_delete_local_policies'),
2910 $this->lng->txt(
'rbac_delete_local_policies_info')
2916 $this->lng->txt(
'rbac_delete_local_policies'),
2918 $this->lng->txt(
'rbac_unprotected_delete_local_policies_info')
2921 $rad->addOption($del);
2923 $form->addItem($rad);
2924 $this->tpl->setContent($form->getHTML());
2933 global
$tree,$rbacreview,$rbacadmin;
2935 $mode = (int)
$_POST[
'mode'];
2936 $start = ($this->rolf_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $tree->getParentId($this->rolf_ref_id));
2940 $this->ctrl->redirect($this,
'perm');
2954 case 'default_perm_settings':
2955 if($this->rolf_ref_id != ROLE_FOLDER_ID)
2959 $ilTabs->addSubTabTarget(
2960 'rbac_repository_permissions',
2961 $this->ctrl->getLinkTarget($this,
'perm')
2963 $ilTabs->addSubTabTarget(
2964 'rbac_admin_permissions',
2965 $this->ctrl->getLinkTarget($this,
'adminPerm')