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->setTitle($this->lng->txt(
'role_add_user'));
97 $rep_search->setCallback($this,
'addUserObject');
100 $this->tabs_gui->setTabActive(
'user_assignment');
101 $this->ctrl->setReturn($this,
'userassignment');
102 $ret =& $this->ctrl->forwardCommand($rep_search);
114 $cmd =
'userassignment';
158 $this->back_target = array(
"text" => $a_text,
164 return $this->back_target ? $this->back_target : array();
198 global $rbacsystem,$rbacreview,
$tree;
201 #if(!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
210 $this->rolf_ref_id != ROLE_FOLDER_ID)
217 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
222 $this->
__showButton(
'selectDesktopItem',$this->lng->txt(
'role_desk_add'));
224 if(!count($items = $role_desk_item_obj->getAll()))
229 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_desktop_item_list.html");
230 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
232 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_role'));
233 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'role_assigned_desk_items').
' ('.$this->
object->getTitle().
')');
234 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
235 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
240 foreach($items as $role_item_id => $item)
244 if(strlen($desc = $tmp_obj->getDescription()))
246 $this->tpl->setCurrentBlock(
"description");
247 $this->tpl->setVariable(
"DESCRIPTION_DESK",$desc);
248 $this->tpl->parseCurrentBlock();
250 $this->tpl->setCurrentBlock(
"desk_row");
251 $this->tpl->setVariable(
"DESK_TITLE",$tmp_obj->getTitle());
253 $this->tpl->setVariable(
"CHECK_DESK",ilUtil::formCheckBox(0,
'del_desk_item[]',$role_item_id));
254 $this->tpl->setVariable(
"TXT_PATH",$this->lng->txt(
'path').
':');
255 $this->tpl->setVariable(
"PATH",$this->
__formatPath($tree->getPathFull($item[
'item_id'])));
256 $this->tpl->parseCurrentBlock();
267 #if(!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
270 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
272 if(!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
274 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
276 if(!count(
$_POST[
'del_desk_item']))
286 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_ask_delete_desktop_item.html");
287 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
289 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt(
'obj_role'));
290 $this->tpl->setVariable(
"TBL_TITLE",$this->lng->txt(
'role_assigned_desk_items').
' ('.$this->
object->getTitle().
')');
291 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
292 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
293 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
295 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
301 foreach(
$_POST[
'del_desk_item'] as $role_item_id)
303 $item_data = $role_desk_item_obj->
getItem($role_item_id);
306 if(strlen($desc = $tmp_obj->getDescription()))
308 $this->tpl->setCurrentBlock(
"description");
309 $this->tpl->setVariable(
"DESCRIPTION_DESK",$desc);
310 $this->tpl->parseCurrentBlock();
312 $this->tpl->setCurrentBlock(
"desk_row");
313 $this->tpl->setVariable(
"DESK_TITLE",$tmp_obj->getTitle());
315 $this->tpl->parseCurrentBlock();
327 #if (!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
330 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
333 if (!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
335 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
338 if (!count(
$_SESSION[
'role_del_desk_items']))
347 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
351 foreach (
$_SESSION[
'role_del_desk_items'] as $role_item_id)
353 $role_desk_item_obj->
delete($role_item_id);
365 global $rbacsystem,
$tree;
367 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItemSelector.php';
368 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
370 if(!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
372 #$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
378 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_desktop_item_selector.html");
379 $this->
__showButton(
'listDesktopItems',$this->lng->txt(
'back'));
385 $exp->setExpand(
$_GET[
"role_desk_item_link_expand"] ?
$_GET[
"role_desk_item_link_expand"] : $tree->readRootId());
386 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'selectDesktopItem'));
390 $output = $exp->getOutput();
391 $this->tpl->setVariable(
"EXPLORER",$output);
401 if (!$rbacsystem->checkAccess(
'push_desktop_items',
USER_FOLDER_ID))
403 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
408 if (!isset(
$_GET[
'item_id']))
416 include_once
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
423 $this->ctrl->redirect($this,
'listDesktopItems');
434 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
437 if($this->creation_mode)
439 $this->ctrl->setParameter($this,
"new_type",
'role');
441 $this->form->setFormAction($this->ctrl->getFormAction($this));
445 case self::MODE_GLOBAL_CREATE:
446 $this->form->setTitle($this->lng->txt(
'role_new'));
447 $this->form->addCommandButton(
'save',$this->lng->txt(
'role_new'));
450 case self::MODE_GLOBAL_UPDATE:
451 $this->form->setTitle($this->lng->txt(
'role_edit'));
452 $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
455 case self::MODE_LOCAL_CREATE:
456 case self::MODE_LOCAL_UPDATE:
459 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
464 $title->setDisabled(
true);
466 $title->setValidationRegexp(
'/^(?!il_).*$/');
467 $title->setValidationFailureMessage($this->lng->txt(
'msg_role_reserved_prefix'));
470 $title->setRequired(
true);
471 $this->form->addItem(
$title);
480 $this->form->addItem($desc);
482 if($this->rolf_ref_id == ROLE_FOLDER_ID)
486 #$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info'));
487 $this->form->addItem($reg);
491 #$la->setInfo($this->lng->txt('rbac_local_admin_info'));
492 $this->form->addItem($la);
497 #$pro->setInfo($this->lng->txt('role_protext_permission_info'));
498 $this->form->addItem($pro);
500 include_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
506 $quo->setInfo($this->lng->txt(
'enter_in_mb_desc').
'<br />'.$this->lng->txt(
'disk_quota_on_role_desc'));
507 $this->form->addItem($quo);
520 $role->
setTitle($this->form->getInput(
'title'));
537 include_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
547 $data[
'pro'] = $rbacreview->isProtected($this->rolf_ref_id, $role->
getId());
549 $this->form->setValuesByArray(
$data);
564 if(!$rbacsystem->checkAccess(
'create_role',$this->rolf_ref_id))
566 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
570 $this->tpl->setContent($this->form->getHTML());
583 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
587 $this->tpl->setContent($this->form->getHTML());
598 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
599 require_once
'classes/class.ilFormat.php';
601 #if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
604 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
612 if (substr($this->object->getTitle(
false),0,3) !=
"il_")
618 $allow_register = (
$_SESSION[
"error_post_vars"][
"Fobject"][
"allow_register"]) ?
"checked=\"checked\"" :
"";
619 $assign_users = (
$_SESSION[
"error_post_vars"][
"Fobject"][
"assign_users"]) ?
"checked=\"checked\"" :
"";
620 $protect_permissions = (
$_SESSION[
"error_post_vars"][
"Fobject"][
"protect_permissions"]) ?
"checked=\"checked\"" :
"";
623 $disk_quota =
$_SESSION[
"error_post_vars"][
"Fobject"][
"disk_quota"];
628 if (substr($this->object->getTitle(),0,3) !=
"il_")
634 $allow_register = ($this->
object->getAllowRegister()) ?
"checked=\"checked\"" :
"";
635 $assign_users = $this->
object->getAssignUsersStatus() ?
"checked=\"checked\"" :
"";
640 $protect_permissions = $rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()) ?
"checked=\"checked\"" :
"";
644 $obj_str =
"&obj_id=".$this->obj_id;
646 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
"title"));
647 $this->tpl->setVariable(
"TXT_DESC",$this->lng->txt(
"desc"));
650 $global_roles = $rbacreview->getGlobalRoles();
652 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
653 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($this->object->getType().
"_edit"));
654 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
655 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
656 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
657 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
658 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
660 if (substr($this->object->getTitle(),0,3) ==
"il_")
662 $this->tpl->setVariable(
"SHOW_TITLE",
ilObjRole::_getTranslation($this->object->getTitle()).
" (".$this->object->getTitle().
")");
664 $rolf = $rbacreview->getFoldersAssignedToRole($this->object->getId(),
true);
665 $parent_node = $this->tree->getParentNodeData($rolf[0]);
667 $this->tpl->setVariable(
"SHOW_DESC",$this->lng->txt(
"obj_".$parent_node[
'type']).
" (".$parent_node[
'obj_id'].
") <br/>".$parent_node[
'title']);
669 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
670 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"back"));
671 $this->tpl->setVariable(
"CMD_SUBMIT",
"cancel");
674 if ($this->object->getId() != ANONYMOUS_ROLE_ID and
675 $this->
object->getId() != SYSTEM_ROLE_ID and
676 in_array($this->object->getId(),$global_roles))
678 $this->tpl->setCurrentBlock(
"allow_register");
679 $this->tpl->setVariable(
"TXT_ALLOW_REGISTER",$this->lng->txt(
"allow_register"));
680 $this->tpl->setVariable(
"ALLOW_REGISTER",$allow_register);
681 $this->tpl->parseCurrentBlock();
683 $this->tpl->setCurrentBlock(
"assign_users");
684 $this->tpl->setVariable(
"TXT_ASSIGN_USERS",$this->lng->txt(
'allow_assign_users'));
685 $this->tpl->setVariable(
"ASSIGN_USERS",$assign_users);
686 $this->tpl->parseCurrentBlock();
688 $this->tpl->setCurrentBlock(
"protect_permissions");
689 $this->tpl->setVariable(
"TXT_PROTECT_PERMISSIONS",$this->lng->txt(
'role_protect_permissions'));
690 $this->tpl->setVariable(
"PROTECT_PERMISSIONS",$protect_permissions);
691 $this->tpl->parseCurrentBlock();
693 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
696 $this->tpl->setCurrentBlock(
"disk_quota");
697 $this->tpl->setVariable(
"TXT_DISK_QUOTA",$this->lng->txt(
"disk_quota"));
698 $this->tpl->setVariable(
"TXT_DISK_QUOTA_DESC",$this->lng->txt(
"enter_in_mb_desc").
'<br>'.$this->lng->txt(
"disk_quota_on_role_desc"));
699 $this->tpl->setVariable(
"DISK_QUOTA",$disk_quota);
700 $this->tpl->parseCurrentBlock();
712 global $rbacadmin,$rbacreview;
717 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
719 $this->role->create();
721 $rbacadmin->setProtected(
723 $this->role->getId(),
724 $this->form->getInput(
'pro') ?
'y' :
'n'
727 $this->ctrl->returnToParent($this);
731 $this->form->setValuesByPost();
732 $this->tpl->setContent($this->form->getHTML());
744 foreach($rbacreview->getRolesOfRoleFolder($this->rolf_ref_id) as $role_id)
746 if($role_id == $a_role_id)
752 if(strcmp(
$title, trim($this->form->getInput(
'title'))) === 0)
754 $this->form->getItemByPostVar(
'title')->setAlert($this->lng->txt(
'rbac_role_exists_alert'));
770 if($this->form->checkInput() and !$this->
checkDuplicate($this->object->getId()))
772 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
774 $this->
object->update();
775 $rbacadmin->setProtected(
777 $this->object->getId(),
778 $this->form->getInput(
'pro') ?
'y' :
'n'
781 $this->ctrl->redirect($this,
'edit');
785 $this->form->setValuesByPost();
786 $this->tpl->setContent($this->form->getHTML());
794 protected function permObject($a_show_admin_permissions =
false)
798 $ilTabs->setTabActive(
'default_perm_settings');
802 if($a_show_admin_permissions)
804 $ilTabs->setSubTabActive(
'rbac_admin_permissions');
808 $ilTabs->setSubTabActive(
'rbac_repository_permissions');
813 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->MESSAGE);
818 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
819 $ilToolbar->addButton(
820 $this->lng->txt(
"adopt_perm_from_template"),
821 $this->ctrl->getLinkTarget($this,
'adoptPerm')
825 $ilToolbar->addButton(
826 $this->lng->txt(
'rbac_delete_role'),
827 $this->ctrl->getLinkTarget($this,
'confirmDeleteRole')
831 $this->tpl->addBlockFile(
834 'tpl.rbac_template_permissions.html',
835 'Services/AccessControl'
838 $this->tpl->setVariable(
'PERM_ACTION',$this->ctrl->getFormAction($this));
840 include_once
'./Services/Accordion/classes/class.ilAccordionGUI.php';
845 if($this->rolf_ref_id == ROLE_FOLDER_ID)
847 if($a_show_admin_permissions)
849 $subs = $objDefinition->getSubObjectsRecursively(
'adm',
true,
true);
853 $subs = $objDefinition->getSubObjectsRecursively(
'root',
true,$a_show_admin_permissions);
858 $subs = $objDefinition->getSubObjectsRecursively($this->
getParentType(),
true,$a_show_admin_permissions);
862 foreach($subs as $subtype => $def)
864 if($objDefinition->isPlugin($subtype))
868 elseif($objDefinition->isSystemObject($subtype))
870 $translation = $this->lng->txt(
"obj_".$subtype);
874 $translation = $this->lng->txt(
'objs_'.$subtype);
877 $sorted[$subtype] = $def;
878 $sorted[$subtype][
'translation'] = $translation;
883 foreach($sorted as $subtype => $def)
885 if($objDefinition->isPlugin($subtype))
889 elseif($objDefinition->isSystemObject($subtype))
891 $translation = $this->lng->txt(
"obj_".$subtype);
895 $translation = $this->lng->txt(
'objs_'.$subtype);
898 include_once
'Services/AccessControl/classes/class.ilObjectRoleTemplatePermissionTableGUI.php';
903 $this->object->getId(),
905 $a_show_admin_permissions
909 $acc->addItem($translation, $tbl->getHTML());
912 $this->tpl->setVariable(
'ACCORDION',$acc->getHTML());
915 include_once
'./Services/AccessControl/classes/class.ilObjectRoleTemplateOptionsTableGUI.php';
920 $this->object->getId(),
921 $a_show_admin_permissions
924 $a_show_admin_permissions ?
'adminPermSave' :
'permSave',
925 $this->lng->txt(
'save')
929 $this->tpl->setVariable(
'OPTIONS_TABLE',$options->getHTML());
959 $ilTabs->setTabActive(
'default_perm_settings');
961 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
964 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
968 $perm_def = $this->
object->__getPermissionDefinitions();
970 $rbac_objects =& $perm_def[0];
971 $rbac_operations =& $perm_def[1];
973 foreach ($rbac_objects as $key => $obj_data)
975 if ($objDefinition->isPlugin($obj_data[
"type"]))
978 "obj_".$obj_data[
"type"]);
982 $rbac_objects[$key][
"name"] = $this->lng->txt(
"obj_".$obj_data[
"type"]);
984 $rbac_objects[$key][
"ops"] = $rbac_operations[$key];
988 if ($this->rolf_ref_id != ROLE_FOLDER_ID)
991 $parent_data = $this->tree->getParentNodeData($this->rolf_ref_id);
993 $subobj_data = $this->objDefinition->getSubObjectsRecursively($parent_data[
"type"]);
996 foreach ($rbac_objects as $key => $obj_data)
998 if ($obj_data[
"type"] ==
"rolf")
1000 unset($rbac_objects[$key]);
1004 if (!$subobj_data[$obj_data[
"type"]] and $parent_data[
"type"] != $obj_data[
"type"])
1006 unset($rbac_objects[$key]);
1023 foreach ($rbac_objects as $key => $obj_data)
1025 $arr_selected = $rbacreview->getOperationsOfRole($this->object->getId(), $obj_data[
"type"],
$this->rolf_ref_id);
1026 $arr_checked = array_intersect($arr_selected,array_keys($rbac_operations[$obj_data[
"obj_id"]]));
1028 foreach ($rbac_operations[$obj_data[
"obj_id"]] as $operation)
1031 if ($this->object->getId() == SYSTEM_ROLE_ID)
1038 $checked = in_array($operation[
"ops_id"],$arr_checked);
1043 $box = ilUtil::formCheckBox($checked,
"template_perm[".$obj_data[
"type"].
"][]",$operation[
"ops_id"],$disabled);
1044 $output[
"perm"][$obj_data[
"obj_id"]][$operation[
"ops_id"]] = $box;
1049 $output[
"col_anz"] = count($rbac_objects);
1050 $output[
"txt_save"] = $this->lng->txt(
"save");
1051 $output[
"check_recursive"] = ilUtil::formCheckBox(0,
"recursive",1);
1052 $output[
"text_recursive"] = $this->lng->txt(
"change_existing_objects");
1053 $output[
"text_recursive_desc"] = $this->lng->txt(
"change_existing_objects_desc");
1055 $protected_disabled =
true;
1057 if ($this->rolf_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(),
$this->rolf_ref_id))
1059 $protected_disabled =
false;
1062 $output[
"check_protected"] = ilUtil::formCheckBox($rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()),
1065 $protected_disabled);
1067 $output[
"text_protected"] = $this->lng->txt(
"role_protect_permissions");
1068 $output[
"text_protected_desc"] = $this->lng->txt(
"role_protect_permissions_desc");
1078 $output[
"formaction"] = $this->ctrl->getFormAction($this);
1080 $this->data = $output;
1087 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.adm_perm_role.html');
1090 if($access and $this->object->isDeletable($this->rolf_ref_id))
1092 $this->tpl->setVariable(
'LINK_DELETE_ROLE',$this->ctrl->getLinkTarget($this,
'confirmDeleteRole'));
1093 $this->tpl->setVariable(
'TXT_DELETE_ROLE',$this->lng->txt(
'rbac_delete_role'));
1094 $this->tpl->setVariable(
'TXT_FOOTER_DELETE_ROLE',$this->lng->txt(
'rbac_delete_role'));
1097 foreach ($rbac_objects as $obj_data)
1100 $this->tpl->setCurrentBlock(
"object_operations");
1104 foreach ($obj_data[
"ops"] as $operation)
1106 $ops_ids[] = $operation[
"ops_id"];
1109 $css_row =
"tblrow1";
1110 $this->tpl->setVariable(
"CSS_ROW",$css_row);
1111 $this->tpl->setVariable(
"PERMISSION",$operation[
"name"]);
1112 if (substr($operation[
"title"], 0, 7) ==
"create_")
1114 if ($this->objDefinition->getDevMode(substr($operation[
"title"], 7, strlen($operation[
"title"]) -7)))
1116 $this->tpl->setVariable(
"TXT_NOT_IMPL",
"(".$this->lng->txt(
"not_implemented_yet").
")");
1119 $this->tpl->setVariable(
"CHECK_PERMISSION",$this->data[
"perm"][$obj_data[
"obj_id"]][$operation[
"ops_id"]]);
1120 $this->tpl->setVariable(
"LABEL_ID",
"template_perm_".$obj_data[
"type"].
"_".$operation[
"ops_id"]);
1121 $this->tpl->parseCurrentBlock();
1125 $this->tpl->setCurrentBlock(
"object_type");
1128 if ($objDefinition->isSystemObject($obj_data[
"type"]) &&
1129 $obj_data[
"type"] !=
"root")
1131 $this->tpl->setVariable(
"TXT_ADMINIS",
"(".$this->lng->txt(
"administration").
") ");
1134 $this->tpl->setVariable(
"TXT_OBJ_TYPE",$obj_data[
"name"]);
1137 if ($this->objDefinition->getDevMode($obj_data[
"type"]))
1139 $this->tpl->setVariable(
"TXT_NOT_IMPL",
"(".$this->lng->txt(
"not_implemented_yet").
")");
1141 else if ($obj_data[
"type"] ==
"icrs" and !$this->ilias->getSetting(
"ilinc_active"))
1143 $this->tpl->setVariable(
"TXT_NOT_IMPL",
"(".$this->lng->txt(
"not_enabled_or_configured").
")");
1147 $this->tpl->setVariable(
"OBJ_TYPE",$obj_data[
"type"]);
1148 $this->tpl->setVariable(
"CHANGE_PERM_OBJ_TYPE_DESC",$this->lng->txt(
"change_existing_object_type_desc"));
1151 if ($objDefinition->isPlugin($obj_data[
"type"]))
1153 $this->tpl->setVariable(
"CHANGE_PERM_OBJ_TYPE",$this->lng->txt(
"change_existing_prefix").
" ".
1155 " ".$this->lng->txt(
"change_existing_suffix"));
1157 else if ($objDefinition->isSystemObject($obj_data[
"type"]))
1159 $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"));
1164 $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"));
1168 $this->tpl->setVariable(
"JS_VARNAME",
"template_perm_".$obj_data[
"type"]);
1170 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
1171 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
1173 $this->tpl->parseCurrentBlock();
1178 if ($this->object->getId() != SYSTEM_ROLE_ID)
1180 $this->tpl->setCurrentBlock(
"tblfooter_special_options");
1181 $this->tpl->setVariable(
"TXT_PERM_SPECIAL_OPTIONS",$this->lng->txt(
"perm_special_options"));
1182 $this->tpl->parseCurrentBlock();
1184 $this->tpl->setCurrentBlock(
"tblfooter_recursive");
1185 $this->tpl->setVariable(
"COL_ANZ",3);
1186 $this->tpl->setVariable(
"CHECK_RECURSIVE",$this->data[
"check_recursive"]);
1187 $this->tpl->setVariable(
"TXT_RECURSIVE",$this->data[
"text_recursive"]);
1188 $this->tpl->setVariable(
"TXT_RECURSIVE_DESC",$this->data[
"text_recursive_desc"]);
1189 $this->tpl->parseCurrentBlock();
1191 $this->tpl->setCurrentBlock(
"tblfooter_protected");
1192 $this->tpl->setVariable(
"COL_ANZ",3);
1193 $this->tpl->setVariable(
"CHECK_PROTECTED",$this->data[
"check_protected"]);
1194 $this->tpl->setVariable(
"TXT_PROTECTED",$this->data[
"text_protected"]);
1195 $this->tpl->setVariable(
"TXT_PROTECTED_DESC",$this->data[
"text_protected_desc"]);
1196 $this->tpl->parseCurrentBlock();
1198 $this->tpl->setCurrentBlock(
"tblfooter_standard");
1199 $this->tpl->setVariable(
"COL_ANZ_PLUS",3);
1200 $this->tpl->setVariable(
"TXT_SAVE",$this->data[
"txt_save"]);
1201 $this->tpl->parseCurrentBlock();
1204 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
1205 $ilToolbar->addButton($this->lng->txt(
"adopt_perm_from_template"),$this->ctrl->getLinkTarget($this,
'adoptPerm'));
1210 $this->tpl->setCurrentBlock(
"tblfooter_sysrole");
1211 $this->tpl->setVariable(
"COL_ANZ_SYS",3);
1212 $this->tpl->parseCurrentBlock();
1215 $this->tpl->setCurrentBlock(
"sysrole_msg");
1216 $this->tpl->setVariable(
"TXT_SYSROLE_MSG",$this->data[
"sysrole_msg"]);
1217 $this->tpl->parseCurrentBlock();
1220 $this->tpl->setCurrentBlock(
"adm_content");
1221 $this->tpl->setVariable(
"TBL_TITLE_IMG",
ilUtil::getImagePath(
"icon_".$this->object->getType().
".gif"));
1222 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT",$this->lng->txt($this->object->getType()));
1224 $this->tpl->setVariable(
"TBL_HELP_LINK",
"tbl_help.php");
1225 $this->tpl->setVariable(
"TBL_HELP_IMG_ALT",$this->lng->txt(
"help"));
1228 $global_roles = $rbacreview->getGlobalRoles();
1230 if (in_array($this->object->getId(),$global_roles))
1237 if($rolf = $rbacreview->getFoldersAssignedToRole($this->object->getId(),
true))
1239 $parent_node = $this->tree->getParentNodeData($rolf[0]);
1240 $desc = $this->lng->txt(
"obj_".$parent_node[
'type']).
" (#".$parent_node[
'obj_id'].
") : ".$parent_node[
'title'];
1244 $description =
" <span class=\"small\">(".$desc.
")</span>";
1247 if (substr($this->object->getTitle(),0,3) ==
"il_")
1253 $title = $this->
object->getTitle();
1256 $this->tpl->setVariable(
"TBL_TITLE",
$title.$description);
1259 $pid = $tree->getParentId($this->rolf_ref_id);
1261 if ($this->rolf_ref_id != ROLE_FOLDER_ID)
1263 $info = sprintf($this->lng->txt(
"perm_role_info_1"),
1264 $this->
object->getTitle(), $ptitle).
" ".
1265 sprintf($this->lng->txt(
"perm_role_info_2"),
1266 $this->
object->getTitle(), $ptitle);
1270 $info = sprintf($this->lng->txt(
"perm_role_info_glob_1"),
1271 $this->
object->getTitle(), $ptitle).
" ".
1272 sprintf($this->lng->txt(
"perm_role_info_glob_2"),
1273 $this->
object->getTitle(), $ptitle);
1275 $this->tpl->setVariable(
"TXT_TITLE_INFO", $info);
1277 $this->tpl->setVariable(
"TXT_PERMISSION",$this->data[
"txt_permission"]);
1278 $this->tpl->setVariable(
"FORMACTION",$this->data[
"formaction"]);
1279 $this->tpl->parseCurrentBlock();
1288 $parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id,
true);
1290 foreach($parent_role_ids as $id => $tmp)
1298 foreach($sorted_ids as $id)
1300 $par = $parent_role_ids[$id];
1301 if ($par[
"obj_id"] != SYSTEM_ROLE_ID && $this->object->getId() != $par[
"obj_id"])
1304 $output[
"adopt"][$key][
"css_row_adopt"] = ($key % 2 == 0) ?
"tblrow1" :
"tblrow2";
1305 $output[
"adopt"][$key][
"check_adopt"] = $radio;
1306 $output[
"adopt"][$key][
"role_id"] = $par[
"obj_id"];
1307 $output[
"adopt"][$key][
"type"] = ($par[
"type"] ==
'role' ? $this->lng->txt(
'obj_role') : $this->lng->txt(
'obj_rolt'));
1309 $output[
"adopt"][$key][
"role_desc"] = $par[
"desc"];
1314 $output[
"formaction_adopt"] = $this->ctrl->getFormAction($this);
1315 $output[
"message_middle"] = $this->lng->txt(
"adopt_perm_from_template");
1318 $tpl =
new ilTemplate(
"tpl.adm_copy_role.html",
true,
true,
"Services/AccessControl");
1320 $tpl->setCurrentBlock(
"ADOPT_PERM_ROW");
1321 foreach ($output[
"adopt"] as $key => $value)
1323 $tpl->setVariable(
"CSS_ROW_ADOPT",$value[
"css_row_adopt"]);
1324 $tpl->setVariable(
"CHECK_ADOPT",$value[
"check_adopt"]);
1325 $tpl->setVariable(
"LABEL_ID",$value[
"role_id"]);
1326 $tpl->setVariable(
"TYPE",$value[
"type"]);
1327 $tpl->setVariable(
"ROLE_NAME",$value[
"role_name"]);
1328 if(strlen($value[
'role_desc']))
1330 $tpl->setVariable(
'ROLE_DESC',$value[
'role_desc']);
1332 $tpl->parseCurrentBlock();
1335 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
1336 $tpl->setVariable(
"MESSAGE_MIDDLE",$output[
"message_middle"]);
1337 $tpl->setVariable(
"FORMACTION_ADOPT",$output[
"formaction_adopt"]);
1338 $tpl->setVariable(
"ADOPT",$this->lng->txt(
'copy'));
1339 $tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
1341 $tpl->setVariable(
'HEAD_ROLE',$this->lng->txt(
'title'));
1342 $tpl->setVariable(
'HEAD_TYPE',$this->lng->txt(
'type'));
1344 $this->tpl->setContent(
$tpl->get());
1353 global
$ilErr,$rbacreview,$ilUser;
1355 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1358 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->WARNING);
1361 $question = $this->lng->txt(
'rbac_role_delete_qst');
1362 if($rbacreview->isAssigned($ilUser->getId(), $this->
object->getId()))
1364 $question .= (
'<br />'.$this->lng->txt(
'rbac_role_delete_self'));
1368 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1371 $confirm->setFormAction($this->ctrl->getFormAction($this));
1372 $confirm->setHeaderText($question);
1373 $confirm->setCancel($this->lng->txt(
'cancel'),
'perm');
1374 $confirm->setConfirm($this->lng->txt(
'rbac_delete_role'),
'performDeleteRole');
1378 $this->object->getId(),
1379 $this->
object->getTitle(),
1383 $this->tpl->setContent($confirm->getHTML());
1396 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1399 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_perm'),$ilErr->WARNING);
1402 $this->
object->setParent((
int)
$_GET[
'rolf_ref_id']);
1403 $this->
object->delete();
1412 $this->ctrl->returnToParent($this);
1436 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1440 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
1444 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
1446 if($rbac_log_active)
1452 if($this->rolf_ref_id == ROLE_FOLDER_ID)
1454 if($a_show_admin_permissions)
1456 $subs = $objDefinition->getSubObjectsRecursively(
'adm',
true,
true);
1460 $subs = $objDefinition->getSubObjectsRecursively(
'root',
true,
false);
1465 $subs = $objDefinition->getSubObjectsRecursively($this->
getParentType(),
true,
false);
1468 foreach($subs as $subtype => $def)
1471 $rbacadmin->deleteRolePermission($this->object->getId(),
$this->rolf_ref_id,$subtype);
1474 if (empty(
$_POST[
"template_perm"]))
1476 $_POST[
"template_perm"] = array();
1479 foreach (
$_POST[
"template_perm"] as $key => $ops_array)
1482 $rbacadmin->setRolePermission($this->object->getId(), $key, $ops_array,
$this->rolf_ref_id);
1485 if($rbac_log_active)
1493 $this->
object->update();
1496 if ($this->rolf_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(),
$this->rolf_ref_id))
1498 $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),
ilUtil::tf2yn(
$_POST[
'protected']));
1501 if($a_show_admin_permissions)
1503 $_POST[
'recursive'] =
true;
1507 if(!
$_POST[
'recursive'] and !is_array(
$_POST[
'recursive_list']))
1510 if($a_show_admin_permissions)
1512 $this->ctrl->redirect($this,
'adminPerm');
1516 $this->ctrl->redirect($this,
'perm');
1526 $start = ($this->rolf_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $tree->getParentId($this->rolf_ref_id));
1527 if($a_show_admin_permissions)
1529 $start = $tree->getParentId($this->rolf_ref_id);
1534 $this->
object->changeExistingObjects(
1539 #$a_show_admin_permissions ? array(
'adm') : array()
1544 $this->
object->changeExistingObjects(
1549 #$a_show_admin_permissions ? array(
'adm') : array()
1554 if($a_show_admin_permissions)
1556 $this->ctrl->redirect($this,
'adminPerm');
1560 $this->ctrl->redirect($this,
'perm');
1573 global $rbacadmin, $rbacsystem, $rbacreview,
$tree;
1582 $access = $this->
checkAccess(
'visible,write',
'edit_permission');
1585 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
1588 if ($this->object->getId() ==
$_POST[
"adopt"])
1595 $parentRoles = $rbacreview->getParentRoleIds($this->rolf_ref_id,
true);
1596 $rbacadmin->copyRoleTemplatePermissions(
1598 $parentRoles[
$_POST[
"adopt"]][
"parent"],
1600 $this->object->getId(),
1604 $this->
object->update();
1607 $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_POST[
"adopt"]);
1608 ilUtil::sendSuccess($this->lng->txt(
"msg_perm_adopted_from1").
" '".$obj_data->getTitle().
"'.<br/>".
1609 $this->lng->txt(
"msg_perm_adopted_from2"),
true);
1612 $this->ctrl->redirect($this,
"perm");
1622 $this->assignUserObject();
1634 global $rbacreview,$rbacadmin;
1636 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1642 $this->rolf_ref_id != ROLE_FOLDER_ID)
1649 $GLOBALS[
'lng']->loadLanguageModule(
'search');
1654 $assigned_users_all = $rbacreview->assignedUsers($this->object->getId());
1657 $assigned_users_new = array_diff($a_user_ids,array_intersect($a_user_ids,$assigned_users_all));
1660 if (count($assigned_users_new) == 0)
1663 $this->ctrl->redirect($this,
'userassignment');
1667 foreach ($assigned_users_new as $user)
1669 $rbacadmin->assignUser($this->object->getId(),$user,
false);
1673 $this->
object->update();
1676 $this->ctrl->redirect($this,
'userassignment');
1686 global $rbacsystem, $rbacadmin, $rbacreview;
1688 #if (!$rbacsystem->checkAccess("edit_userassignment", $this->rolf_ref_id))
1689 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1691 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1694 $selected_users = (
$_POST[
"user_id"]) ?
$_POST[
"user_id"] : array(
$_GET[
"user_id"]);
1696 if ($selected_users[0]=== NULL)
1698 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1702 if ($this->object->getId() == SYSTEM_ROLE_ID)
1704 if ($admin = array_search(SYSTEM_USER_ID,$selected_users) !==
false)
1705 unset($selected_users[$admin]);
1709 $last_role = array();
1710 $global_roles = $rbacreview->getGlobalRoles();
1712 foreach ($selected_users as $user)
1714 $assigned_roles = $rbacreview->assignedRoles($user);
1715 $assigned_global_roles = array_intersect($assigned_roles,$global_roles);
1717 if (count($assigned_roles) == 1 or (count($assigned_global_roles) == 1 and in_array($this->object->getId(),$assigned_global_roles)))
1719 $userObj = $this->ilias->obj_factory->getInstanceByObjId($user);
1720 $last_role[$user] = $userObj->getFullName();
1727 foreach ($selected_users as $user)
1729 if(!isset($last_role[$user]))
1731 $rbacadmin->deassignUser($this->object->getId(), $user);
1736 $this->
object->update();
1739 if(count($last_role))
1741 $user_list = implode(
", ",$last_role);
1742 ilUtil::sendFailure($this->lng->txt(
'msg_is_last_role').
': '.$user_list.
'<br />'.$this->lng->txt(
'msg_min_one_role'),
true);
1748 $this->ctrl->redirect($this,
'userassignment');
1758 global $rbacsystem, $rbacreview, $rbacadmin,
$tree;
1759 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1760 require_once
'classes/class.ilFormat.php';
1773 $access = $this->
checkAccess(
'write',
'edit_permission');
1776 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_role"),$this->ilias->error_obj->MESSAGE);
1779 if (substr($this->object->getTitle(),0,3) !=
"il_")
1782 if (empty(
$_POST[
"Fobject"][
"title"]))
1784 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
1788 if (substr(
$_POST[
"Fobject"][
"title"],0,3) ==
"il_")
1790 $this->ilias->raiseError($this->lng->txt(
"msg_role_reserved_prefix"),$this->ilias->error_obj->MESSAGE);
1795 if (! is_numeric(trim(
$_POST[
"Fobject"][
"disk_quota"])) ||
1796 trim(
$_POST[
"Fobject"][
"disk_quota"]) < 0
1799 $this->ilias->raiseError($this->lng->txt(
"msg_disk_quota_illegal_value"),$this->ilias->error_obj->MESSAGE);
1817 if (
$_POST[
"Fobject"][
"allow_register"] ==
"")
1819 $roles_allowed = $this->
object->_lookupRegisterAllowed();
1821 if (count($roles_allowed) == 1 and $roles_allowed[0][
'id'] == $this->object->getId())
1823 $this->ilias->raiseError($this->lng->txt(
"msg_last_role_for_registration"),$this->ilias->error_obj->MESSAGE);
1827 $this->
object->setAllowRegister(
$_POST[
"Fobject"][
"allow_register"]);
1828 $this->
object->toggleAssignUsersStatus(
$_POST[
"Fobject"][
"assign_users"]);
1829 $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),
ilUtil::tf2yn(
$_POST[
"Fobject"][
"protect_permissions"]));
1830 $this->
object->update();
1834 $this->ctrl->redirect($this,
'edit');
1843 global $rbacreview, $rbacsystem,
$lng;
1846 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
1848 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1851 $this->tabs_gui->setTabActive(
'user_assignment');
1853 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.rbac_ua.html',
'Services/AccessControl');
1855 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1859 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1864 'auto_complete_name' => $lng->txt(
'user'),
1865 'submit_name' => $lng->txt(
'add')
1880 $this->lng->txt(
'search_user'),
1881 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start')
1885 $this->lng->txt(
'role_mailto'),
1886 $this->ctrl->getLinkTarget($this,
'mailToRole')
1888 $this->tpl->setVariable(
'BUTTONS_UA',$tb->getHTML());
1890 include_once
'./Services/AccessControl/classes/class.ilAssignedUsersTableGUI.php';
1893 $this->tpl->setVariable(
'TABLE_UA',$ut->getHTML());
1905 $actions = array(
"deassignUser" => $this->lng->txt(
"remove"));
1908 $tpl =& $tbl->getTemplateObject();
1910 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1913 $this->tpl->setCurrentBlock(
"btn_cell");
1914 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
1915 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
'role_add_user'));
1916 $this->tpl->parseCurrentBlock();
1918 $this->
__showButton(
'mailToRole',$this->lng->txt(
'role_mailto'),
'_blank');
1920 $tpl->setCurrentBlock(
"tbl_form_header");
1921 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1922 $tpl->parseCurrentBlock();
1924 $tpl->setCurrentBlock(
"tbl_action_row");
1926 $tpl->setVariable(
"COLUMN_COUNTS",5);
1929 foreach (
$actions as $name => $value)
1931 $tpl->setCurrentBlock(
"tbl_action_btn");
1932 $tpl->setVariable(
"BTN_NAME",$name);
1933 $tpl->setVariable(
"BTN_VALUE",$value);
1934 $tpl->parseCurrentBlock();
1937 if (!empty($a_user_ids))
1940 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
1941 $tpl->setVariable(
"JS_VARNAME",
"user_id");
1943 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
1944 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
1945 $tpl->parseCurrentBlock();
1948 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
1949 $this->ctrl->setParameter($this,
"cmd",
"userassignment");
1952 $tbl->setTitle($this->lng->txt(
"assigned_users"),
"icon_usr.gif",$this->lng->txt(
"users"));
1955 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"username"),$this->lng->txt(
"firstname"),
1956 $this->lng->txt(
"lastname"),$this->lng->txt(
"grp_options")));
1957 $tbl->setHeaderVars(array(
"",
"login",
"firstname",
"lastname",
"functions"),
1958 $this->ctrl->getParameterArray($this,
"",
false));
1959 $tbl->setColumnWidth(array(
"",
"20%",
"25%",
"25%",
"30%"));
1963 $this->tpl->setVariable(
"ADM_CONTENT",$tbl->tpl->get());
1970 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1980 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
1984 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
1989 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
1991 $_GET[
"sort_by"] =
"login";
1993 $order =
$_GET[
"sort_by"];
1997 $tbl->setOrderColumn($order);
1998 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
1999 $tbl->setOffset(
$_GET[
"offset"]);
2000 $tbl->setLimit(
$_GET[
"limit"]);
2001 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2002 $tbl->setData($result_set);
2010 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
2012 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
2015 $this->lng->loadLanguageModule(
'search');
2017 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_users_search.html");
2019 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
2020 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"role_search_users"));
2021 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
2022 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"role_search_str"] ?
$_SESSION[
"role_search_str"] :
"");
2023 $this->tpl->setVariable(
"SEARCH_FOR",$this->lng->txt(
"exc_search_for"));
2024 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER",$this->lng->txt(
"exc_users"));
2025 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE",$this->lng->txt(
"exc_roles"));
2026 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP",$this->lng->txt(
"exc_groups"));
2027 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
2028 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
2030 $usr = (
$_POST[
"search_for"] ==
"usr" ||
$_POST[
"search_for"] ==
"") ? 1 : 0;
2031 $grp = (
$_POST[
"search_for"] ==
"grp") ? 1 : 0;
2032 $role = (
$_POST[
"search_for"] ==
"role") ? 1 : 0;
2043 unset(
$_SESSION[
"role_delete_member_ids"]);
2044 unset(
$_SESSION[
"role_delete_subscriber_ids"]);
2058 if (
$_GET[
"new_type"] !=
"role")
2060 $this->ctrl->redirect($this,
"userassignment");
2064 $this->ctrl->redirectByClass(
"ilobjrolefoldergui",
"view");
2070 global $rbacsystem,
$tree;
2072 #if (!$rbacsystem->checkAccess("edit_userassignment", $this->rolf_ref_id))
2073 if(!$this->
checkAccess(
'edit_userassignment',
'edit_permission'))
2075 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
2081 if (!isset(
$_POST[
"search_for"]) or !isset(
$_POST[
"search_str"]))
2097 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_usr_selection.html");
2098 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"role_new_search"));
2101 $f_result = array();
2103 switch(
$_POST[
"search_for"])
2113 $user_ids[$counter] = $user[
"id"];
2116 $f_result[$counter][] = $tmp_obj->getLogin();
2117 $f_result[$counter][] = $tmp_obj->getFirstname();
2118 $f_result[$counter][] = $tmp_obj->getLastname();
2131 if ($role[
"id"] == ANONYMOUS_ROLE_ID)
2142 if ($tmp_obj->getCountMembers() == 0)
2147 $role_ids[$counter] = $role[
"id"];
2150 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
2151 $f_result[$counter][] = $tmp_obj->getCountMembers();
2164 if(!$tree->isInTree($group[
"id"]))
2175 if ($tmp_obj->getId() == $this->
object->getId())
2180 $grp_ids[$counter] = $group[
"id"];
2183 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
2184 $f_result[$counter][] = $tmp_obj->getCountMembers();
2197 include_once(
"./classes/class.ilSearch.php");
2199 $this->lng->loadLanguageModule(
"content");
2201 $search->setPerformUpdate(
false);
2203 $search->setCombination(
"and");
2204 $search->setSearchFor(array(0 => $a_search_for));
2205 $search->setSearchType(
'new');
2207 if ($search->validate($message))
2209 $search->performSearch();
2214 $this->ctrl->redirect($this,
"searchUserForm");
2217 return $search->getResultByType($a_search_for);
2222 $return_to =
"searchUserForm";
2224 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup")
2226 $return_to =
"search";
2230 $tpl =& $tbl->getTemplateObject();
2233 $tpl->setCurrentBlock(
"tbl_form_header");
2234 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2235 $tpl->parseCurrentBlock();
2237 $tpl->setCurrentBlock(
"tbl_action_btn");
2238 $tpl->setVariable(
"BTN_NAME",$return_to);
2239 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
2240 $tpl->parseCurrentBlock();
2242 $tpl->setCurrentBlock(
"tbl_action_btn");
2243 $tpl->setVariable(
"BTN_NAME",
"assignUser");
2244 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
2245 $tpl->parseCurrentBlock();
2247 if (!empty($a_user_ids))
2250 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
2251 $tpl->setVariable(
"JS_VARNAME",
"user");
2253 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
2254 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
2255 $tpl->parseCurrentBlock();
2258 $tpl->setCurrentBlock(
"tbl_action_row");
2259 $tpl->setVariable(
"COLUMN_COUNTS",4);
2261 $tpl->parseCurrentBlock();
2263 $tbl->setTitle($this->lng->txt(
"role_header_edit_users"),
"icon_usr.gif",$this->lng->txt(
"role_header_edit_users"));
2264 $tbl->setHeaderNames(array(
"",
2265 $this->lng->txt(
"username"),
2266 $this->lng->txt(
"firstname"),
2267 $this->lng->txt(
"lastname")));
2268 $tbl->setHeaderVars(array(
"",
2272 $this->ctrl->getParameterArray($this,$a_cmd,
false));
2279 $tbl->setColumnWidth(array(
"",
"33%",
"33%",
"33%"));
2284 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
2292 $tpl =& $tbl->getTemplateObject();
2294 $tpl->setCurrentBlock(
"tbl_form_header");
2295 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2296 $tpl->parseCurrentBlock();
2298 $tpl->setCurrentBlock(
"tbl_action_btn");
2299 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
2300 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
2301 $tpl->parseCurrentBlock();
2303 $tpl->setCurrentBlock(
"tbl_action_btn");
2304 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
2305 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"role_list_users"));
2306 $tpl->parseCurrentBlock();
2308 if (!empty($a_role_ids))
2311 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
2312 $tpl->setVariable(
"JS_VARNAME",
"role");
2314 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
2315 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
2316 $tpl->parseCurrentBlock();
2319 $tpl->setCurrentBlock(
"tbl_action_row");
2320 $tpl->setVariable(
"COLUMN_COUNTS",4);
2322 $tpl->parseCurrentBlock();
2324 $tbl->setTitle($this->lng->txt(
"role_header_edit_users"),
"icon_usr.gif",$this->lng->txt(
"role_header_edit_users"));
2325 $tbl->setHeaderNames(array(
"",
2326 $this->lng->txt(
"obj_role"),
2327 $this->lng->txt(
"role_count_users")));
2328 $tbl->setHeaderVars(array(
"",
2331 $this->ctrl->getParameterArray($this,
"search",
false));
2338 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
2344 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
2352 $tpl =& $tbl->getTemplateObject();
2354 $tpl->setCurrentBlock(
"tbl_form_header");
2355 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2356 $tpl->parseCurrentBlock();
2358 $tpl->setCurrentBlock(
"tbl_action_btn");
2359 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
2360 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
2361 $tpl->parseCurrentBlock();
2363 $tpl->setCurrentBlock(
"tbl_action_btn");
2364 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
2365 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
2366 $tpl->parseCurrentBlock();
2368 if (!empty($a_grp_ids))
2371 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
2372 $tpl->setVariable(
"JS_VARNAME",
"group");
2374 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
2375 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
2376 $tpl->parseCurrentBlock();
2379 $tpl->setCurrentBlock(
"tbl_action_row");
2380 $tpl->setVariable(
"COLUMN_COUNTS",4);
2382 $tpl->parseCurrentBlock();
2384 $tbl->setTitle($this->lng->txt(
"grp_header_edit_members"),
"icon_usr.gif",$this->lng->txt(
"grp_header_edit_members"));
2385 $tbl->setHeaderNames(array(
"",
2386 $this->lng->txt(
"obj_grp"),
2387 $this->lng->txt(
"grp_count_members")));
2388 $tbl->setHeaderVars(array(
"",
2391 array(
"ref_id" => $this->rolf_ref_id,
2392 "obj_id" => $this->object->getId(),
2394 "cmdClass" =>
"ilobjrolegui",
2395 "cmdNode" =>
$_GET[
"cmdNode"]));
2397 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
2403 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
2410 global $rbacsystem,$rbacreview;
2414 if (!is_array(
$_POST[
"role"]))
2422 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_usr_selection.html");
2423 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"role_new_search"));
2428 foreach (
$_POST[
"role"] as $role_id)
2430 $members = array_merge($rbacreview->assignedUsers($role_id),$members);
2433 $members = array_unique($members);
2437 $f_result = array();
2439 foreach($members as $user)
2446 $user_ids[$counter] = $user;
2450 $f_result[$counter][] = $tmp_obj->getLogin();
2451 $f_result[$counter][] = $tmp_obj->getFirstname();
2452 $f_result[$counter][] = $tmp_obj->getLastname();
2465 global $rbacsystem,$rbacreview,
$tree;
2469 if (!is_array(
$_POST[
"group"]))
2477 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.role_usr_selection.html");
2478 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"role_new_search"));
2483 foreach (
$_POST[
"group"] as $group_id)
2485 if (!$tree->isInTree($group_id))
2494 $members = array_merge($tmp_obj->getGroupMemberIds(),$members);
2499 $members = array_unique($members);
2503 $f_result = array();
2505 foreach($members as $user)
2512 $user_ids[$counter] = $user;
2515 $f_result[$counter][] = $tmp_obj->getLogin();
2516 $f_result[$counter][] = $tmp_obj->getFirstname();
2517 $f_result[$counter][] = $tmp_obj->getLastname();
2533 foreach ($a_path_arr as
$data)
2540 $path .= $data[
'title'];
2543 if (strlen(
$path) > 50)
2545 return '...'.substr(
$path,-50);
2555 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
2556 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
2576 include_once
'./classes/class.ilTabsGUI.php';
2578 $this->tpl->setTitle($this->lng->txt(
'role'));
2579 $this->tpl->setDescription($this->object->getTitle());
2582 #$tabs_gui =& new ilTabsGUI();
2583 $this->
getTabs($this->tabs_gui);
2586 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
2591 global
$tree, $ilias_locator;
2595 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html",
"Services/Locator");
2599 foreach ($tree->getPathFull($this->rolf_ref_id) as $key =>
$row)
2603 $this->tpl->touchBlock(
'locator_separator_prefix');
2606 $this->tpl->setCurrentBlock(
"locator_item");
2608 if (
$row[
"type"] ==
'rolf')
2610 $this->tpl->setVariable(
"ITEM",$this->object->getTitle());
2611 $this->tpl->setVariable(
"LINK_ITEM",$this->ctrl->getLinkTarget($this));
2613 elseif (
$row[
"child"] != $tree->getRootId())
2615 $this->tpl->setVariable(
"ITEM",
$row[
"title"]);
2616 $this->tpl->setVariable(
"LINK_ITEM",
"repository.php?ref_id=".
$row[
"child"]);
2620 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"repository"));
2621 $this->tpl->setVariable(
"LINK_ITEM",
"repository.php?ref_id=".
$row[
"child"]);
2624 $this->tpl->parseCurrentBlock();
2627 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
2628 $this->tpl->parseCurrentBlock();
2639 if (
$_GET[
"admin_mode"] ==
"settings"
2640 &&
$_GET[
"ref_id"] == ROLE_FOLDER_ID)
2642 $ilLocator->addItem($this->lng->txt(
"administration"),
2643 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
2646 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2648 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
2650 if (
$_GET[
"obj_id"] > 0)
2652 $ilLocator->addItem($this->object->getTitle(),
2653 $this->ctrl->getLinkTarget($this,
"view"));
2668 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
2670 if (
$_GET[
"admin_mode"] ==
"settings"
2671 &&
$_GET[
"ref_id"] != SYSTEM_FOLDER_ID)
2674 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
2679 if ($this->object->getRefId() != ROOT_FOLDER_ID &&
2680 $this->
object->getRefId() != SYSTEM_FOLDER_ID)
2682 $par_id = $tree->getParentId($this->object->getRefId());
2683 $tpl->setUpperIcon(
"repository.php?ref_id=".$par_id);
2692 global $rbacsystem,$rbacreview;
2694 $base_role_folder = $rbacreview->getFoldersAssignedToRole($this->object->getId(),
true);
2699 $activate_role_edit =
false;
2704 if (in_array($this->rolf_ref_id,$base_role_folder) ||
2705 (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" &&
2706 $_GET[
"admin_mode"] ==
"settings"))
2708 $activate_role_edit =
true;
2712 $tabs_gui->clearTargets();
2714 if ($this->back_target !=
"")
2716 $tabs_gui->setBackTarget(
2717 $this->back_target[
"text"],$this->back_target[
"link"]);
2720 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit)
2722 $tabs_gui->addTarget(
"edit_properties",
2723 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"update"), get_class($this));
2739 $tabs_gui->addTarget(
2740 "default_perm_settings",
2741 $this->ctrl->getLinkTarget($this,
"perm"), array(),get_class($this)
2745 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit && $this->
object->getId() != ANONYMOUS_ROLE_ID)
2747 $tabs_gui->addTarget(
"user_assignment",
2748 $this->ctrl->getLinkTarget($this,
"userassignment"),
2749 array(
"deassignUser",
"userassignment",
"assignUser",
"searchUserForm",
"search"),
2753 if($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit && $this->
object->getId() != ANONYMOUS_ROLE_ID)
2755 $tabs_gui->addTarget(
"desktop_items",
2756 $this->ctrl->getLinkTarget($this,
"listDesktopItems"),
2757 array(
"listDesktopItems",
"deleteDesktopItems",
"selectDesktopItem",
"askDeleteDesktopItem"),
2767 if(count($obj_ids) > 1)
2769 $_SESSION[
'mail_roles'][] =
'#il_role_'.$this->object->getId();
2773 $_SESSION[
'mail_roles'][] = $rbacreview->getRoleMailboxAddress($this->object->getId());
2776 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
2783 global $rbacsystem,$ilAccess;
2785 $a_perm_obj = $a_perm_obj ? $a_perm_obj : $a_perm_global;
2787 if($this->rolf_ref_id == ROLE_FOLDER_ID)
2789 return $rbacsystem->checkAccess($a_perm_global,$this->rolf_ref_id);
2793 return $ilAccess->checkAccess($a_perm_obj,
'',$this->obj_ref_id);
2805 if(!(
int)
$_POST[
'recursive'] and !is_array(
$_POST[
'recursive_list']))
2811 if($rbacreview->isProtected($this->rolf_ref_id, $this->object->getId()))
2815 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
2821 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
2831 $protected =
$_POST[
'protected'];
2833 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
2835 $form->setFormAction($this->ctrl->getFormAction($this,
'changeExistingObjects'));
2836 $form->setTitle($this->lng->txt(
'rbac_change_existing_confirm_tbl'));
2838 $form->addCommandButton(
'changeExistingObjects', $this->lng->txt(
'change_existing_objects'));
2839 $form->addCommandButton(
'perm',$this->lng->txt(
'cancel'));
2844 serialize(array(
'all')) :
2845 serialize(
$_POST[
'recursive_list'])
2847 $form->addItem($hidden);
2855 $this->lng->txt(
'rbac_keep_local_policies'),
2857 $this->lng->txt(
'rbac_keep_local_policies_info')
2864 $this->lng->txt(
'rbac_keep_local_policies'),
2866 $this->lng->txt(
'rbac_unprotected_keep_local_policies_info')
2870 $rad->addOption($keep);
2875 $this->lng->txt(
'rbac_delete_local_policies'),
2877 $this->lng->txt(
'rbac_delete_local_policies_info')
2883 $this->lng->txt(
'rbac_delete_local_policies'),
2885 $this->lng->txt(
'rbac_unprotected_delete_local_policies_info')
2888 $rad->addOption($del);
2890 $form->addItem($rad);
2891 $this->tpl->setContent($form->getHTML());
2900 global
$tree,$rbacreview,$rbacadmin;
2902 $mode = (int)
$_POST[
'mode'];
2903 $start = ($this->rolf_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $tree->getParentId($this->rolf_ref_id));
2907 $this->ctrl->redirect($this,
'perm');
2921 case 'default_perm_settings':
2922 if($this->rolf_ref_id != ROLE_FOLDER_ID)
2926 $ilTabs->addSubTabTarget(
2927 'rbac_repository_permissions',
2928 $this->ctrl->getLinkTarget($this,
'perm')
2930 $ilTabs->addSubTabTarget(
2931 'rbac_admin_permissions',
2932 $this->ctrl->getLinkTarget($this,
'adminPerm')