ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjRoleGUI Class Reference

Class ilObjRoleGUI. More...

+ Inheritance diagram for ilObjRoleGUI:
+ Collaboration diagram for ilObjRoleGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=false, $a_prepare_output=true)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 getParentRefId ()
 Get ref id of current object (not role folder id) More...
 
 getParentObjId ()
 Get obj_id of current object. More...
 
 getParentType ()
 get type of current object (not role folder) More...
 
 setBackTarget ($a_text, $a_link)
 set back tab target More...
 
 getBackTarget ()
 
 getAdminTabs ()
 admin and normal tabs are equal for roles More...
 
 listDesktopItemsObject ()
 
 askDeleteDesktopItemObject ()
 
 deleteDesktopItemsObject ()
 
 selectDesktopItemObject ()
 
 assignDesktopItemObject ()
 
 createObject ()
 Only called from administration -> role folder ? Otherwise this check access is wrong. More...
 
 editObject ()
 Edit role properties. More...
 
 saveObject ()
 Save new role. More...
 
 updateObject ()
 Save role settings. More...
 
 permSaveObject ($a_show_admin_permissions=false)
 save permissions More...
 
 adoptPermSaveObject ()
 copy permissions from role More...
 
 assignSaveObject ()
 wrapper for renamed function More...
 
 addUserObject ($a_user_ids)
 Assign user (callback from ilRepositorySearchGUI) More...
 
 deassignUserObject ()
 de-assign users from role More...
 
 userassignmentObject ()
 display user assignment panel More...
 
 cancelObject ()
 cancelObject is called when an operation is canceled, method links back @access public More...
 
 listUsersRoleObject ()
 
 __prepareOutput ()
 
 __setHeader ()
 
 getTabs ()
 get tabs abstract method. More...
 
 mailToRoleObject ()
 
 checkAccess ($a_perm_global, $a_perm_obj='')
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

const MODE_GLOBAL_UPDATE = 1
 
const MODE_GLOBAL_CREATE = 2
 
const MODE_LOCAL_UPDATE = 3
 
const MODE_LOCAL_CREATE = 4
 
 $type
 
 $ctrl
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 getContainerType ()
 Get type of role container. More...
 
 showDefaultPermissionSettings ()
 check if default permissions are shown or not More...
 
 initFormRoleProperties ($a_mode)
 Create role prperty form. More...
 
 loadRoleProperties (ilObjRole $role)
 Store form input in role object. More...
 
 readRoleProperties (ilObjRole $role)
 Read role properties and write them to form. More...
 
 checkDuplicate ($a_role_id=0)
 Check if role with same name already exists in this folder. More...
 
 permObject ($a_show_admin_permissions=false)
 Show template permissions. More...
 
 adminPermObject ()
 Show administration permissions. More...
 
 adminPermSaveObject ()
 Save admin permissions. More...
 
 adoptPermObject ()
 
 confirmDeleteRoleObject ()
 Show delete confirmation screen. More...
 
 performDeleteRoleObject ()
 Delete role. More...
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
Parameters
bool$a_do_not_add_object
More...
 
 isChangeExistingObjectsConfirmationRequired ()
 Check if a confirmation about further settings is required or not. More...
 
 showChangeExistingObjectsConfirmation ()
 Show confirmation screen. More...
 
 changeExistingObjectsObject ()
 Change existing objects. More...
 
 setSubTabs ($a_tab)
 Set sub tabs. More...
 
 addToClipboardObject ()
 Add selected users to user clipboard. More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 ensureRoleAccessForContext ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $obj_ref_id = 0
 
 $obj_obj_id = 0
 
 $obj_obj_type = ''
 
 $container_type = ''
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Detailed Description

Class ilObjRoleGUI.

Author
Stefan Meyer <smeyer@ilias@gmx.de>
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$

@ilCtrl_Calls ilObjRoleGUI: ilRepositorySearchGUI, ilExportGUI

Definition at line 20 of file class.ilObjRoleGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjRoleGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = false,
  $a_prepare_output = true 
)

Constructor @access public.

Definition at line 47 of file class.ilObjRoleGUI.php.

48 {
49 global $tree,$lng;
50
51 $lng->loadLanguageModule('rbac');
52
53 //TODO: move this to class.ilias.php
54 define("USER_FOLDER_ID", 7);
55
56 // Add ref_id of object that contains this role folder
57
58 $this->obj_ref_id =
59 (
60 (int) $_REQUEST['rolf_ref_id'] ?
61 (int) $_REQUEST['rolf_ref_id'] :
62 (int) $_REQUEST['ref_id']
63 );
64
65 $this->obj_obj_id = ilObject::_lookupObjId($this->getParentRefId());
66 $this->obj_obj_type = ilObject::_lookupType($this->getParentObjId());
67
68 $this->container_type = ilObject::_lookupType(ilObject::_lookupObjId($this->obj_ref_id));
69
70 $this->type = "role";
71 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
72 $this->ctrl->saveParameter($this, array('obj_id', 'rolf_ref_id'));
73 }
getParentRefId()
Get ref id of current object (not role folder id)
getParentObjId()
Get obj_id of current object.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilObjectGUI\$lng, ilObjectGUI\$tree, ilObject\_lookupObjId(), ilObject\_lookupType(), getParentObjId(), and getParentRefId().

+ Here is the call graph for this function:

Member Function Documentation

◆ __prepareOutput()

ilObjRoleGUI::__prepareOutput ( )

Definition at line 1290 of file class.ilObjRoleGUI.php.

1291 {
1292 // output objects
1293 $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1294 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1295
1296 // output message
1297 if ($this->message) {
1298 ilUtil::sendInfo($this->message);
1299 }
1300
1301 // display infopanel if something happened
1303
1304 // set header
1305 $this->__setHeader();
1306 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static infoPanel($a_keep=true)

References __setHeader(), ilUtil\infoPanel(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ __setHeader()

ilObjRoleGUI::__setHeader ( )

Definition at line 1308 of file class.ilObjRoleGUI.php.

1309 {
1310 $this->tpl->setTitle($this->lng->txt('role'));
1311 $this->tpl->setDescription($this->object->getTitle());
1312 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_role.svg"));
1313
1314 $this->getTabs($this->tabs_gui);
1315 }
getTabs()
get tabs abstract method.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath(), and getTabs().

Referenced by __prepareOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAdminLocatorItems()

ilObjRoleGUI::addAdminLocatorItems (   $a_do_not_add_object = false)
protected

should be overwritten to add object specific items (repository items are preloaded)

Parameters
bool$a_do_not_add_object

Reimplemented from ilObjectGUI.

Definition at line 1321 of file class.ilObjRoleGUI.php.

1322 {
1323 global $DIC;
1324
1325 $ilLocator = $DIC['ilLocator'];
1326
1327 if (
1328 $_GET["admin_mode"] == "settings"
1329 && $_GET["ref_id"] == ROLE_FOLDER_ID) { // system settings
1330 parent::addAdminLocatorItems(true);
1331
1332 $ilLocator->addItem(
1333 $this->lng->txt("obj_" . ilObject::_lookupType(ilObject::_lookupObjId($_GET["ref_id"]))),
1334 $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", 'view')
1335 );
1336
1337 if ($_GET["obj_id"] > 0) {
1338 $ilLocator->addItem(
1339 $this->object->getTitle(),
1340 $this->ctrl->getLinkTarget($this, 'perm')
1341 );
1342 }
1343 } else {
1344 parent::addAdminLocatorItems($a_do_not_add_object);
1345 }
1346 }
$_GET["client_id"]
global $DIC
Definition: saml.php:7

References $_GET, $DIC, ilObject\_lookupObjId(), and ilObject\_lookupType().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjRoleGUI::addLocatorItems ( )
protected

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 1617 of file class.ilObjRoleGUI.php.

1618 {
1619 global $DIC;
1620
1621 $ilLocator = $DIC['ilLocator'];
1622
1623 if ($_GET["admin_mode"] == "") {
1624 $this->ctrl->setParameterByClass(
1625 "ilobjrolegui",
1626 "obj_id",
1627 (int) $_GET["obj_id"]
1628 );
1629 $ilLocator->addItem(
1630 ilObjRole::_getTranslation($this->object->getTitle()),
1631 $this->ctrl->getLinkTargetByClass(
1632 array(
1633 "ilpermissiongui",
1634 "ilobjrolegui"),
1635 "perm"
1636 )
1637 );
1638 }
1639 }
static _getTranslation($a_role_title)

References $_GET, $DIC, and ilObjRole\_getTranslation().

+ Here is the call graph for this function:

◆ addToClipboardObject()

ilObjRoleGUI::addToClipboardObject ( )
protected

Add selected users to user clipboard.

Definition at line 1595 of file class.ilObjRoleGUI.php.

1596 {
1597 global $lng, $ilCtrl;
1598
1599 $users = (array) $_POST['user_id'];
1600 if (!count($users)) {
1601 ilUtil::sendFailure($this->lng->txt('select_one'), true);
1602 $ilCtrl->redirect($this, 'userassignment');
1603 }
1604 include_once './Services/User/classes/class.ilUserClipboard.php';
1605 $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
1606 $clip->add($users);
1607 $clip->save();
1608
1609 $lng->loadLanguageModule('user');
1610 ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
1611 $ilCtrl->redirect($this, 'userassignment');
1612 }
$users
Definition: authpage.php:44
$_POST["username"]
static getInstance($a_usr_id)
Get singelton instance.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18

References $_POST, $GLOBALS, $ilCtrl, ilObjectGUI\$lng, $users, ilUserClipboard\getInstance(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ addUserObject()

ilObjRoleGUI::addUserObject (   $a_user_ids)

Assign user (callback from ilRepositorySearchGUI)

Parameters
array$a_user_idsArray of user ids
Returns

Definition at line 1043 of file class.ilObjRoleGUI.php.

1044 {
1045 global $rbacreview,$rbacadmin;
1046
1047 if (!$this->checkAccess('edit_userassignment', 'edit_permission')) {
1048 ilUtil::sendFailure($this->lng->txt('msg_no_perm_assign_user_to_role'), true);
1049 return false;
1050 }
1051 if (!$rbacreview->isAssignable($this->object->getId(), $this->obj_ref_id) &&
1052 $this->obj_ref_id != ROLE_FOLDER_ID) {
1053 ilUtil::sendFailure($this->lng->txt('err_role_not_assignable'), true);
1054 return false;
1055 }
1056 if (!$a_user_ids) {
1057 $GLOBALS['lng']->loadLanguageModule('search');
1058 ilUtil::sendFailure($this->lng->txt('search_err_user_not_exist'), true);
1059 return false;
1060 }
1061
1062 $assigned_users_all = $rbacreview->assignedUsers($this->object->getId());
1063
1064 // users to assign
1065 $assigned_users_new = array_diff($a_user_ids, array_intersect($a_user_ids, $assigned_users_all));
1066
1067 // selected users all already assigned. stop
1068 if (count($assigned_users_new) == 0) {
1069 ilUtil::sendInfo($this->lng->txt("rbac_msg_user_already_assigned"), true);
1070 $this->ctrl->redirect($this, 'userassignment');
1071 }
1072
1073 // assign new users
1074 foreach ($assigned_users_new as $user) {
1075 $rbacadmin->assignUser($this->object->getId(), $user, false);
1076 }
1077
1078 // update object data entry (to update last modification date)
1079 $this->object->update();
1080
1081 ilUtil::sendSuccess($this->lng->txt("msg_userassignment_changed"), true);
1082 $this->ctrl->redirect($this, 'userassignment');
1083 }
checkAccess($a_perm_global, $a_perm_obj='')

References $GLOBALS, ilObjectGUI\$rbacreview, ilObjectGUI\$user, checkAccess(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ adminPermObject()

ilObjRoleGUI::adminPermObject ( )
protected

Show administration permissions.

Returns

Definition at line 759 of file class.ilObjRoleGUI.php.

760 {
761 return $this->permObject(true);
762 }
permObject($a_show_admin_permissions=false)
Show template permissions.

References permObject().

+ Here is the call graph for this function:

◆ adminPermSaveObject()

ilObjRoleGUI::adminPermSaveObject ( )
protected

Save admin permissions.

Returns

Definition at line 768 of file class.ilObjRoleGUI.php.

769 {
770 return $this->permSaveObject(true);
771 }
permSaveObject($a_show_admin_permissions=false)
save permissions

References permSaveObject().

+ Here is the call graph for this function:

◆ adoptPermObject()

ilObjRoleGUI::adoptPermObject ( )
protected

Definition at line 773 of file class.ilObjRoleGUI.php.

774 {
775 global $rbacreview;
776
777 $output = array();
778
779 $parent_role_ids = $rbacreview->getParentRoleIds($this->obj_ref_id, true);
780 $ids = array();
781 foreach ($parent_role_ids as $id => $tmp) {
782 $ids[] = $id;
783 }
784 // Sort ids
785 $sorted_ids = ilUtil::_sortIds($ids, 'object_data', 'type,title', 'obj_id');
786 $key = 0;
787 foreach ($sorted_ids as $id) {
788 $par = $parent_role_ids[$id];
789 if ($par["obj_id"] != SYSTEM_ROLE_ID && $this->object->getId() != $par["obj_id"]) {
790 $output[$key]["role_id"] = $par["obj_id"];
791 $output[$key]["type"] = ($par["type"] == 'role' ? $this->lng->txt('obj_role') : $this->lng->txt('obj_rolt'));
792 $output[$key]["role_name"] = ilObjRole::_getTranslation($par["title"]);
793 $output[$key]["role_desc"] = $par["desc"];
794 $key++;
795 }
796 }
797
798
799 include_once('./Services/AccessControl/classes/class.ilRoleAdoptPermissionTableGUI.php');
800
801 $tbl = new ilRoleAdoptPermissionTableGUI($this, "adoptPerm");
802 $tbl->setTitle($this->lng->txt("adopt_perm_from_template"));
803 $tbl->setData($output);
804
805 $this->tpl->setContent($tbl->getHTML());
806 }
Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE Date: 07....
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
$key
Definition: croninfo.php:18
$tbl
Definition: example_048.php:81
if(!array_key_exists('StateId', $_REQUEST)) $id
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output

References $id, $key, $output, ilObjectGUI\$rbacreview, $tbl, ilObjRole\_getTranslation(), and ilUtil\_sortIds().

Referenced by adoptPermSaveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adoptPermSaveObject()

ilObjRoleGUI::adoptPermSaveObject ( )

copy permissions from role

@access public

Definition at line 986 of file class.ilObjRoleGUI.php.

987 {
988 global $rbacadmin, $rbacsystem, $rbacreview, $tree;
989
990 if (!$_POST['adopt']) {
991 ilUtil::sendFailure($this->lng->txt('select_one'));
992 $this->adoptPermObject();
993 return false;
994 }
995
996 $access = $this->checkAccess('visible,write', 'edit_permission');
997 if (!$access) {
998 $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"), $this->ilias->error_obj->MESSAGE);
999 }
1000
1001 if ($this->object->getId() == $_POST["adopt"]) {
1002 ilUtil::sendFailure($this->lng->txt("msg_perm_adopted_from_itself"), true);
1003 } else {
1004 $rbacadmin->deleteRolePermission($this->object->getId(), $this->obj_ref_id);
1005 $parentRoles = $rbacreview->getParentRoleIds($this->obj_ref_id, true);
1006 $rbacadmin->copyRoleTemplatePermissions(
1007 $_POST["adopt"],
1008 $parentRoles[$_POST["adopt"]]["parent"],
1009 $this->obj_ref_id,
1010 $this->object->getId(),
1011 false
1012 );
1013
1014 // update object data entry (to update last modification date)
1015 $this->object->update();
1016
1017 // send info
1018 $obj_data =&$this->ilias->obj_factory->getInstanceByObjId($_POST["adopt"]);
1019 ilUtil::sendSuccess($this->lng->txt("msg_perm_adopted_from1") . " '" . $obj_data->getTitle() . "'.<br/>" .
1020 $this->lng->txt("msg_perm_adopted_from2"), true);
1021 }
1022
1023 $this->ctrl->redirect($this, "perm");
1024 }
redirection script todo: (a better solution should control the processing via a xml file)

References $_POST, ilObjectGUI\$access, ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, ilObjectGUI\$tree, adoptPermObject(), checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ askDeleteDesktopItemObject()

ilObjRoleGUI::askDeleteDesktopItemObject ( )

Definition at line 226 of file class.ilObjRoleGUI.php.

227 {
228 global $rbacsystem;
229
230
231 if (!$this->checkAccess('edit_permission')) {
232 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
233 }
234 if (!$rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
235 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
236 }
237 if (!count($_POST['del_desk_item'])) {
238 ilUtil::sendFailure($this->lng->txt('role_select_one_item'));
239
240 $this->listDesktopItemsObject();
241
242 return true;
243 }
244
245 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
246 $confirmation_gui = new ilConfirmationGUI();
247 $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
248 $confirmation_gui->setHeaderText($this->lng->txt('role_assigned_desk_items') .
249 ' "' . $this->object->getTitle() . '": ' .
250 $this->lng->txt('role_sure_delete_desk_items'));
251 $confirmation_gui->setCancel($this->lng->txt("cancel"), "listDesktopItems");
252 $confirmation_gui->setConfirm($this->lng->txt("delete"), "deleteDesktopItems");
253
254 include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
255 $role_desk_item_obj = new ilRoleDesktopItem($this->object->getId());
256 $counter = 0;
257 foreach ($_POST['del_desk_item'] as $role_item_id) {
258 $item_data = $role_desk_item_obj->getItem($role_item_id);
259 $tmp_obj =&ilObjectFactory::getInstanceByRefId($item_data['item_id']);
260
261 if (strlen($desc = $tmp_obj->getDescription())) {
262 $desc = '<div class="il_Description_no_margin">' . $desc . '</div>';
263 }
264
265 $confirmation_gui->addItem("del_desk_item[]", $role_item_id, $tmp_obj->getTitle() . $desc);
266 }
267
268 $this->tpl->setContent($confirmation_gui->getHTML());
269
270 return true;
271 }
const USER_FOLDER_ID
Class ilObjUserFolder.
Confirmation screen class.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$counter

References $_POST, $counter, ilObjectGUI\$rbacsystem, checkAccess(), ilObjectFactory\getInstanceByRefId(), listDesktopItemsObject(), ilUtil\sendFailure(), and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ assignDesktopItemObject()

ilObjRoleGUI::assignDesktopItemObject ( )

Definition at line 343 of file class.ilObjRoleGUI.php.

344 {
345 global $rbacsystem;
346
347 if (!$rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
348 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
349 return false;
350 }
351
352
353 if (!isset($_GET['item_id'])) {
354 ilUtil::sendFailure($this->lng->txt('role_no_item_selected'));
356
357 return false;
358 }
359
360 include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
361
362 $role_desk_item_obj = new ilRoleDesktopItem($this->object->getId());
363 $role_desk_item_obj->add((int) $_GET['item_id'], ilObject::_lookupType((int) $_GET['item_id'], true));
364
365 ilUtil::sendSuccess($this->lng->txt('role_assigned_desktop_item'));
366
367 $this->ctrl->redirect($this, 'listDesktopItems');
368 return true;
369 }

References $_GET, ilObjectGUI\$rbacsystem, ilObject\_lookupType(), selectDesktopItemObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ assignSaveObject()

ilObjRoleGUI::assignSaveObject ( )

wrapper for renamed function

@access public

Definition at line 1031 of file class.ilObjRoleGUI.php.

1032 {
1033 $this->assignUserObject();
1034 }

◆ cancelObject()

ilObjRoleGUI::cancelObject ( )

cancelObject is called when an operation is canceled, method links back @access public

Reimplemented from ilObjectGUI.

Definition at line 1229 of file class.ilObjRoleGUI.php.

1230 {
1231 if ($_GET["new_type"] != "role") {
1232 $this->ctrl->redirect($this, "userassignment");
1233 } else {
1234 $this->ctrl->redirectByClass("ilobjrolefoldergui", "view");
1235 }
1236 }

References $_GET.

◆ changeExistingObjectsObject()

ilObjRoleGUI::changeExistingObjectsObject ( )
protected

Change existing objects.

Returns

Definition at line 1553 of file class.ilObjRoleGUI.php.

1554 {
1555 global $tree,$rbacreview,$rbacadmin;
1556
1557 $mode = (int) $_POST['mode'];
1558 $start = ($this->obj_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $this->obj_ref_id);
1559
1560 $this->object->changeExistingObjects($start, $mode, unserialize(ilUtil::stripSlashes($_POST['type_filter'])));
1561
1562 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1563 $this->ctrl->redirect($this, 'perm');
1564 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $obj_ref_id, ilObjectGUI\$rbacreview, ilObjectGUI\$tree, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ checkAccess()

ilObjRoleGUI::checkAccess (   $a_perm_global,
  $a_perm_obj = '' 
)

Definition at line 1450 of file class.ilObjRoleGUI.php.

1451 {
1452 global $rbacsystem,$ilAccess;
1453
1454 $a_perm_obj = $a_perm_obj ? $a_perm_obj : $a_perm_global;
1455
1456 if ($this->obj_ref_id == ROLE_FOLDER_ID) {
1457 return $rbacsystem->checkAccess($a_perm_global, $this->obj_ref_id);
1458 } else {
1459 return $ilAccess->checkAccess($a_perm_obj, '', $this->obj_ref_id);
1460 }
1461 }

References ilObjectGUI\$rbacsystem.

Referenced by addUserObject(), adoptPermSaveObject(), askDeleteDesktopItemObject(), confirmDeleteRoleObject(), deassignUserObject(), deleteDesktopItemsObject(), editObject(), executeCommand(), getTabs(), performDeleteRoleObject(), permObject(), permSaveObject(), and userassignmentObject().

+ Here is the caller graph for this function:

◆ checkDuplicate()

ilObjRoleGUI::checkDuplicate (   $a_role_id = 0)
protected

Check if role with same name already exists in this folder.

Returns
bool

Definition at line 598 of file class.ilObjRoleGUI.php.

599 {
600 // disabled due to mantis #0013742: Renaming global roles: ILIAS denies if title fits other role title partially
601 return false;
602 }

◆ confirmDeleteRoleObject()

ilObjRoleGUI::confirmDeleteRoleObject ( )
protected

Show delete confirmation screen.

Returns

Definition at line 812 of file class.ilObjRoleGUI.php.

813 {
815
816 $access = $this->checkAccess('visible,write', 'edit_permission');
817 if (!$access) {
818 $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'), $ilErr->WARNING);
819 }
820
821 $question = $this->lng->txt('rbac_role_delete_qst');
822 if ($rbacreview->isAssigned($ilUser->getId(), $this->object->getId())) {
823 $question .= ('<br />' . $this->lng->txt('rbac_role_delete_self'));
824 }
825 ilUtil::sendQuestion($question);
826
827 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
828
829 $confirm = new ilConfirmationGUI();
830 $confirm->setFormAction($this->ctrl->getFormAction($this));
831 $confirm->setHeaderText($question);
832 $confirm->setCancel($this->lng->txt('cancel'), 'perm');
833 $confirm->setConfirm($this->lng->txt('rbac_delete_role'), 'performDeleteRole');
834
835 $confirm->addItem(
836 'role',
837 $this->object->getId(),
838 $this->object->getTitle(),
839 ilUtil::getImagePath('icon_role.svg')
840 );
841
842 $this->tpl->setContent($confirm->getHTML());
843 return true;
844 }
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
$ilUser
Definition: imgupload.php:18

References ilObjectGUI\$access, ilObjectGUI\$ilErr, $ilUser, ilObjectGUI\$rbacreview, checkAccess(), ilUtil\getImagePath(), and ilUtil\sendQuestion().

+ Here is the call graph for this function:

◆ createObject()

ilObjRoleGUI::createObject ( )

Only called from administration -> role folder ? Otherwise this check access is wrong.

Returns

Reimplemented from ilObjectGUI.

Definition at line 523 of file class.ilObjRoleGUI.php.

524 {
525 global $rbacsystem;
526
527 if (!$rbacsystem->checkAccess('create_role', $this->obj_ref_id)) {
528 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
529 }
530
531 $this->initFormRoleProperties(self::MODE_GLOBAL_CREATE);
532 $this->tpl->setContent($this->form->getHTML());
533 }
initFormRoleProperties($a_mode)
Create role prperty form.

References ilObjectGUI\$ilErr, ilObjectGUI\$rbacsystem, and initFormRoleProperties().

+ Here is the call graph for this function:

◆ deassignUserObject()

ilObjRoleGUI::deassignUserObject ( )

de-assign users from role

@access public

Definition at line 1090 of file class.ilObjRoleGUI.php.

1091 {
1092 global $rbacsystem, $rbacadmin, $rbacreview;
1093
1094 if (!$this->checkAccess('edit_userassignment', 'edit_permission')) {
1095 $this->ilias->raiseError($this->lng->txt("msg_no_perm_assign_user_to_role"), $this->ilias->error_obj->MESSAGE);
1096 }
1097
1098 $selected_users = ($_POST["user_id"]) ? $_POST["user_id"] : array($_GET["user_id"]);
1099
1100 if ($selected_users[0]=== null) {
1101 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
1102 }
1103
1104 // prevent unassignment of system user from system role
1105 if ($this->object->getId() == SYSTEM_ROLE_ID) {
1106 if ($admin = array_search(SYSTEM_USER_ID, $selected_users) !== false) {
1107 unset($selected_users[$admin]);
1108 }
1109 }
1110
1111 // check for each user if the current role is his last global role before deassigning him
1112 $last_role = array();
1113 $global_roles = $rbacreview->getGlobalRoles();
1114
1115 foreach ($selected_users as $user) {
1116 $assigned_roles = $rbacreview->assignedRoles($user);
1117 $assigned_global_roles = array_intersect($assigned_roles, $global_roles);
1118
1119 if (count($assigned_roles) == 1 or (count($assigned_global_roles) == 1 and in_array($this->object->getId(), $assigned_global_roles))) {
1120 $userObj = $this->ilias->obj_factory->getInstanceByObjId($user);
1121 $last_role[$user] = $userObj->getFullName();
1122 unset($userObj);
1123 }
1124 }
1125
1126
1127 // ... else perform deassignment
1128 foreach ($selected_users as $user) {
1129 if (!isset($last_role[$user])) {
1130 $rbacadmin->deassignUser($this->object->getId(), $user);
1131 }
1132 }
1133
1134 // update object data entry (to update last modification date)
1135 $this->object->update();
1136
1137 // raise error if last role was taken from a user...
1138 if (count($last_role)) {
1139 $user_list = implode(", ", $last_role);
1140 ilUtil::sendFailure($this->lng->txt('msg_is_last_role') . ': ' . $user_list . '<br />' . $this->lng->txt('msg_min_one_role'), true);
1141 } else {
1142 ilUtil::sendSuccess($this->lng->txt("msg_userassignment_changed"), true);
1143 }
1144 $this->ctrl->redirect($this, 'userassignment');
1145 }

References $_GET, $_POST, ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, ilObjectGUI\$user, checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ deleteDesktopItemsObject()

ilObjRoleGUI::deleteDesktopItemsObject ( )

Definition at line 273 of file class.ilObjRoleGUI.php.

274 {
275 global $rbacsystem;
276
277 if (!$this->checkAccess('edit_permission')) {
278 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
279 }
280
281 if (!$rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
282 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
283 }
284
285 if (!count($_POST['del_desk_item'])) {
286 ilUtil::sendFailure($this->lng->txt('role_select_one_item'));
287
288 $this->listDesktopItemsObject();
289
290 return true;
291 }
292
293 include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
294
295 $role_desk_item_obj = new ilRoleDesktopItem($this->object->getId());
296
297 foreach ($_POST['del_desk_item'] as $role_item_id) {
298 $role_desk_item_obj->delete($role_item_id);
299 }
300
301 ilUtil::sendSuccess($this->lng->txt('role_deleted_desktop_items'));
302 $this->listDesktopItemsObject();
303
304 return true;
305 }

References $_POST, ilObjectGUI\$rbacsystem, checkAccess(), listDesktopItemsObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and USER_FOLDER_ID.

+ Here is the call graph for this function:

◆ editObject()

ilObjRoleGUI::editObject ( )

Edit role properties.

Returns

Reimplemented from ilObjectGUI.

Definition at line 539 of file class.ilObjRoleGUI.php.

540 {
541 global $rbacsystem, $rbacreview, $ilSetting,$ilErr,$ilToolbar;
542
543 if (!$this->checkAccess('write', 'edit_permission')) {
544 $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
545 }
546
547 // Show copy role button
548 if ($this->object->getId() != SYSTEM_ROLE_ID) {
549 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
550 if ($rbacreview->isDeleteable($this->object->getId(), $this->obj_ref_id)) {
551 $ilToolbar->addButton(
552 $this->lng->txt('rbac_delete_role'),
553 $this->ctrl->getLinkTarget($this, 'confirmDeleteRole')
554 );
555 }
556 }
557
558 $this->initFormRoleProperties(self::MODE_GLOBAL_UPDATE);
559 $this->readRoleProperties($this->object);
560 $this->tpl->setContent($this->form->getHTML());
561 }
readRoleProperties(ilObjRole $role)
Read role properties and write them to form.
global $ilSetting
Definition: privfeed.php:17

References ilObjectGUI\$ilErr, $ilSetting, ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, checkAccess(), initFormRoleProperties(), and readRoleProperties().

+ Here is the call graph for this function:

◆ ensureRoleAccessForContext()

ilObjRoleGUI::ensureRoleAccessForContext ( )
protected

Definition at line 1645 of file class.ilObjRoleGUI.php.

1646 {
1647 global $DIC;
1648
1649 $review = $DIC->rbac()->review();
1650 $logger = $DIC->logger()->ac();
1651
1652 // creation of roles
1653 if (
1654 !$this->object->getId() ||
1655 $this->object->getId() == ROLE_FOLDER_ID
1656 ) {
1657 return true;
1658 }
1659
1660
1661 $possible_roles = [];
1662 try {
1663 $possible_roles = $review->getRolesOfObject(
1664 $this->obj_ref_id,
1665 false
1666 );
1667 } catch (\InvalidArgumentException $e) {
1668 $logger->warning('Role access check failed: ' . $e);
1669
1670 include_once "Services/Object/exceptions/class.ilObjectException.php";
1671 throw new \ilObjectException($this->lng->txt('permission_denied'));
1672 }
1673
1674 if (!in_array($this->object->getId(), $possible_roles)) {
1675 $logger->warning('Object id: ' . $this->object->getId() . ' is not accessible for ref_id: ' . $this->obj_ref_id);
1676 include_once "Services/Object/exceptions/class.ilObjectException.php";
1677 throw new \ilObjectException($this->lng->txt('permission_denied'));
1678 }
1679 return true;
1680 }

References $DIC.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilObjRoleGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 76 of file class.ilObjRoleGUI.php.

77 {
78 global $rbacsystem;
79
80 $this->prepareOutput();
81
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
84
86
87 switch ($next_class) {
88 case 'ilrepositorysearchgui':
89
90 if (!$GLOBALS['ilAccess']->checkAccess('edit_permission', '', $this->obj_ref_id)) {
91 $GLOBALS['ilErr']->raiseError($GLOBALS['lng']->txt('permission_denied'), $GLOBALS['ilErr']->WARNING);
92 }
93 include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
94 $rep_search = new ilRepositorySearchGUI();
95 $rep_search->setTitle($this->lng->txt('role_add_user'));
96 $rep_search->setCallback($this, 'addUserObject');
97
98 // Set tabs
99 $this->tabs_gui->setTabActive('user_assignment');
100 $this->ctrl->setReturn($this, 'userassignment');
101 $ret =&$this->ctrl->forwardCommand($rep_search);
102 break;
103
104 case 'ilexportgui':
105
106 $this->tabs_gui->setTabActive('export');
107
108 include_once './Services/Export/classes/class.ilExportOptions.php';
110 $eo->addOption(ilExportOptions::KEY_ROOT, 0, $this->object->getId(), $this->obj_ref_id);
111
112 include_once './Services/Export/classes/class.ilExportGUI.php';
113 $exp = new ilExportGUI($this, new ilObjRole($this->object->getId()));
114 $exp->addFormat('xml');
115 $this->ctrl->forwardCommand($exp);
116 break;
117
118 default:
119 if (!$cmd) {
120 if ($this->showDefaultPermissionSettings()) {
121 $cmd = "perm";
122 } else {
123 $cmd = 'userassignment';
124 }
125 }
126 $cmd .= "Object";
127 $this->$cmd();
128
129 break;
130 }
131
132 return true;
133 }
Export User Interface Class.
static newInstance($a_export_id)
Create new instance.
static allocateExportId()
Allocate a new export id.
showDefaultPermissionSettings()
check if default permissions are shown or not
Class ilObjRole.
prepareOutput($a_show_subobjects=true)
prepare output
$ret
Definition: parser.php:6

References $GLOBALS, ilObjectGUI\$rbacsystem, $ret, ilExportOptions\allocateExportId(), checkAccess(), ensureRoleAccessForContext(), ilExportOptions\KEY_ROOT, ilExportOptions\newInstance(), ilObjectGUI\prepareOutput(), and showDefaultPermissionSettings().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjRoleGUI::getAdminTabs ( )

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

Definition at line 179 of file class.ilObjRoleGUI.php.

180 {
181 $this->getTabs();
182 }

References getTabs().

+ Here is the call graph for this function:

◆ getBackTarget()

ilObjRoleGUI::getBackTarget ( )

Definition at line 171 of file class.ilObjRoleGUI.php.

172 {
173 return $this->back_target ? $this->back_target : array();
174 }

◆ getContainerType()

ilObjRoleGUI::getContainerType ( )
protected

Get type of role container.

Returns

Definition at line 188 of file class.ilObjRoleGUI.php.

189 {
191 }

References $container_type.

Referenced by showDefaultPermissionSettings().

+ Here is the caller graph for this function:

◆ getParentObjId()

ilObjRoleGUI::getParentObjId ( )

Get obj_id of current object.

Returns

Definition at line 148 of file class.ilObjRoleGUI.php.

149 {
150 return $this->obj_obj_id;
151 }

References $obj_obj_id.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getParentRefId()

ilObjRoleGUI::getParentRefId ( )

Get ref id of current object (not role folder id)

Returns

Definition at line 139 of file class.ilObjRoleGUI.php.

140 {
141 return $this->obj_ref_id;
142 }

References $obj_ref_id.

Referenced by __construct(), and permObject().

+ Here is the caller graph for this function:

◆ getParentType()

ilObjRoleGUI::getParentType ( )

get type of current object (not role folder)

Returns

Definition at line 157 of file class.ilObjRoleGUI.php.

158 {
159 return $this->obj_obj_type;
160 }

References $obj_obj_type.

Referenced by permObject(), and permSaveObject().

+ Here is the caller graph for this function:

◆ getTabs()

ilObjRoleGUI::getTabs ( )

get tabs abstract method.

@abstract overwrite in derived GUI class of your object type @access public

Parameters
objectinstance of ilTabsGUI

Reimplemented from ilObjectGUI.

Definition at line 1351 of file class.ilObjRoleGUI.php.

1352 {
1353 global $rbacreview, $ilHelp;
1354
1355 $base_role_container = $rbacreview->getFoldersAssignedToRole($this->object->getId(), true);
1356
1357
1358 $activate_role_edit = false;
1359
1360 // todo: activate the following (allow editing of local roles in
1361 // roles administration)
1362 if (in_array($this->obj_ref_id, $base_role_container) ||
1363 (strtolower($_GET["baseClass"]) == "iladministrationgui" &&
1364 $_GET["admin_mode"] == "settings")) {
1365 $activate_role_edit = true;
1366 }
1367
1368 // not so nice (workaround for using tabs in repository)
1369 $this->tabs_gui->clearTargets();
1370
1371 $ilHelp->setScreenIdComponent("role");
1372
1373 if ($this->back_target != "") {
1374 $this->tabs_gui->setBackTarget(
1375 $this->back_target["text"],
1376 $this->back_target["link"]
1377 );
1378 }
1379
1380 if ($this->checkAccess('write', 'edit_permission') && $activate_role_edit) {
1381 $this->tabs_gui->addTarget(
1382 "edit_properties",
1383 $this->ctrl->getLinkTarget($this, "edit"),
1384 array("edit","update"),
1385 get_class($this)
1386 );
1387 }
1388 /*
1389 if($this->checkAccess('write','edit_permission') and $this->showDefaultPermissionSettings())
1390 {
1391 $force_active = ($_GET["cmd"] == "perm" || $_GET["cmd"] == "")
1392 ? true
1393 : false;
1394 $this->tabs_gui->addTarget("default_perm_settings",
1395 $this->ctrl->getLinkTarget($this, "perm"), array("perm", "adoptPermSave", "permSave"),
1396 get_class($this),
1397 "", $force_active);
1398 }
1399 */
1400 if ($this->checkAccess('write', 'edit_permission') and $this->showDefaultPermissionSettings()) {
1401 $this->tabs_gui->addTarget(
1402 "default_perm_settings",
1403 $this->ctrl->getLinkTarget($this, "perm"),
1404 array(),
1405 get_class($this)
1406 );
1407 }
1408
1409 if ($this->checkAccess('write', 'edit_permission') && $activate_role_edit && $this->object->getId() != ANONYMOUS_ROLE_ID) {
1410 $this->tabs_gui->addTarget(
1411 "user_assignment",
1412 $this->ctrl->getLinkTarget($this, "userassignment"),
1413 array("deassignUser", "userassignment", "assignUser", "searchUserForm", "search"),
1414 get_class($this)
1415 );
1416 }
1417
1418 if ($this->checkAccess('write', 'edit_permission') && $activate_role_edit && $this->object->getId() != ANONYMOUS_ROLE_ID) {
1419 $this->tabs_gui->addTarget(
1420 "desktop_items",
1421 $this->ctrl->getLinkTarget($this, "listDesktopItems"),
1422 array("listDesktopItems", "deleteDesktopItems", "selectDesktopItem", "askDeleteDesktopItem"),
1423 get_class($this)
1424 );
1425 }
1426 if ($this->checkAccess('write', 'edit_permission')) {
1427 $this->tabs_gui->addTarget(
1428 'export',
1429 $this->ctrl->getLinkTargetByClass('ilExportGUI'),
1430 array()
1431 );
1432 }
1433 }

References $_GET, ilObjectGUI\$rbacreview, checkAccess(), and showDefaultPermissionSettings().

Referenced by __setHeader(), and getAdminTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormRoleProperties()

ilObjRoleGUI::initFormRoleProperties (   $a_mode)
protected

Create role prperty form.

Returns
Parameters
int$a_mode

Definition at line 376 of file class.ilObjRoleGUI.php.

377 {
378 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
379 $this->form = new ilPropertyFormGUI();
380
381 if ($this->creation_mode) {
382 $this->ctrl->setParameter($this, "new_type", 'role');
383 }
384 $this->form->setFormAction($this->ctrl->getFormAction($this));
385
386 switch ($a_mode) {
388 $this->form->setTitle($this->lng->txt('role_new'));
389 $this->form->addCommandButton('save', $this->lng->txt('role_new'));
390 break;
391
393 $this->form->setTitle($this->lng->txt('role_edit'));
394 $this->form->addCommandButton('update', $this->lng->txt('save'));
395 break;
396
399 }
400 // Fix cancel
401 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
402
403 $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
404 if (ilObjRole::isAutoGenerated($this->object->getId())) {
405 $title->setDisabled(true);
406 } else {
407 //#17111 No validation for disabled fields
408 $title->setValidationRegexp('/^(?!il_).*$/');
409 $title->setValidationFailureMessage($this->lng->txt('msg_role_reserved_prefix'));
410 }
411
412 $title->setSize(40);
413 $title->setMaxLength(70);
414 $title->setRequired(true);
415 $this->form->addItem($title);
416
417 $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
418 if (ilObjRole::isAutoGenerated($this->object->getId())) {
419 $desc->setDisabled(true);
420 }
421 $desc->setCols(40);
422 $desc->setRows(3);
423 $this->form->addItem($desc);
424
425 if ($a_mode != self::MODE_LOCAL_CREATE && $a_mode != self::MODE_GLOBAL_CREATE) {
426 $ilias_id = new ilNonEditableValueGUI($this->lng->txt("ilias_id"), "ilias_id");
427 $this->form->addItem($ilias_id);
428 }
429
430 if ($this->obj_ref_id == ROLE_FOLDER_ID) {
431 $reg = new ilCheckboxInputGUI($this->lng->txt('allow_register'), 'reg');
432 $reg->setValue(1);
433 #$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info'));
434 $this->form->addItem($reg);
435
436 $la = new ilCheckboxInputGUI($this->lng->txt('allow_assign_users'), 'la');
437 $la->setValue(1);
438 #$la->setInfo($this->lng->txt('rbac_local_admin_info'));
439 $this->form->addItem($la);
440 }
441
442 $pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'pro');
443 $pro->setValue(1);
444 #$pro->setInfo($this->lng->txt('role_protext_permission_info'));
445 $this->form->addItem($pro);
446
447 include_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
449 $quo = new ilNumberInputGUI($this->lng->txt('disk_quota'), 'disk_quota');
450 $quo->setMinValue(0);
451 $quo->setSize(4);
452 $quo->setInfo($this->lng->txt('enter_in_mb_desc') . '<br />' . $this->lng->txt('disk_quota_on_role_desc'));
453 $this->form->addItem($quo);
454 }
456 $this->lng->loadLanguageModule("file");
457 $wquo = new ilNumberInputGUI($this->lng->txt('personal_workspace_disk_quota'), 'wsp_disk_quota');
458 $wquo->setMinValue(0);
459 $wquo->setSize(4);
460 $wquo->setInfo($this->lng->txt('enter_in_mb_desc') . '<br />' . $this->lng->txt('disk_quota_on_role_desc'));
461 $this->form->addItem($wquo);
462 }
463
464 return true;
465 }
This class represents a checkbox property in a property form.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
static isAutoGenerated($a_role_id)
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $title, ilDiskQuotaActivationChecker\_isActive(), ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilObjRole\isAutoGenerated(), MODE_GLOBAL_CREATE, MODE_GLOBAL_UPDATE, MODE_LOCAL_CREATE, and MODE_LOCAL_UPDATE.

Referenced by createObject(), editObject(), saveObject(), and updateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isChangeExistingObjectsConfirmationRequired()

ilObjRoleGUI::isChangeExistingObjectsConfirmationRequired ( )
protected

Check if a confirmation about further settings is required or not.

Returns
bool

Definition at line 1467 of file class.ilObjRoleGUI.php.

1468 {
1469 global $rbacreview;
1470
1471 if (!(int) $_POST['recursive'] and !is_array($_POST['recursive_list'])) {
1472 return false;
1473 }
1474
1475 // Role is protected
1476 if ($rbacreview->isProtected($this->obj_ref_id, $this->object->getId())) {
1477 // TODO: check if recursive_list is enabled
1478 // and if yes: check if inheritance is broken for the relevant object types
1479 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
1480 } else {
1481 // TODO: check if recursive_list is enabled
1482 // and if yes: check if inheritance is broken for the relevant object types
1483 return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
1484 }
1485 }

References $_POST, and ilObjectGUI\$rbacreview.

Referenced by permSaveObject().

+ Here is the caller graph for this function:

◆ listDesktopItemsObject()

ilObjRoleGUI::listDesktopItemsObject ( )

Definition at line 205 of file class.ilObjRoleGUI.php.

206 {
208
209 if (!$rbacreview->isAssignable($this->object->getId(), $this->obj_ref_id) &&
210 $this->obj_ref_id != ROLE_FOLDER_ID) {
211 ilUtil::sendInfo($this->lng->txt('role_no_users_no_desk_items'));
212 return true;
213 }
214
215 if ($rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
216 $this->__showButton('selectDesktopItem', $this->lng->txt('role_desk_add'));
217 }
218
219 include_once 'Services/AccessControl/classes/class.ilRoleDesktopItemsTableGUI.php';
220 $tbl = new ilRoleDesktopItemsTableGUI($this, 'listDesktopItems', $this->object);
221 $this->tpl->setContent($tbl->getHTML());
222
223 return true;
224 }
__showButton($a_cmd, $a_text, $a_target='')

References ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, $tbl, ilObjectGUI\__showButton(), ilUtil\sendInfo(), and USER_FOLDER_ID.

Referenced by askDeleteDesktopItemObject(), deleteDesktopItemsObject(), and selectDesktopItemObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listUsersRoleObject()

ilObjRoleGUI::listUsersRoleObject ( )

Definition at line 1239 of file class.ilObjRoleGUI.php.

1240 {
1241 global $rbacsystem,$rbacreview;
1242
1243 $_SESSION["role_role"] = $_POST["role"] = $_POST["role"] ? $_POST["role"] : $_SESSION["role_role"];
1244
1245 if (!is_array($_POST["role"])) {
1246 ilUtil::sendFailure($this->lng->txt("role_no_roles_selected"));
1247 $this->searchObject();
1248
1249 return false;
1250 }
1251
1252 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.role_usr_selection.html", "Services/AccessControl");
1253 $this->__showButton("searchUserForm", $this->lng->txt("role_new_search"));
1254
1255 // GET ALL MEMBERS
1256 $members = array();
1257
1258 foreach ($_POST["role"] as $role_id) {
1259 $members = array_merge($rbacreview->assignedUsers($role_id), $members);
1260 }
1261
1262 $members = array_unique($members);
1263
1264 // FORMAT USER DATA
1265 $counter = 0;
1266 $f_result = array();
1267
1268 foreach ($members as $user) {
1269 if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user, false)) {
1270 continue;
1271 }
1272
1273 $user_ids[$counter] = $user;
1274
1275 // TODO: exclude anonymous user
1276 $f_result[$counter][] = ilUtil::formCheckbox(0, "user[]", $user);
1277 $f_result[$counter][] = $tmp_obj->getLogin();
1278 $f_result[$counter][] = $tmp_obj->getFirstname();
1279 $f_result[$counter][] = $tmp_obj->getLastname();
1280
1281 unset($tmp_obj);
1282 ++$counter;
1283 }
1284
1285 $this->__showSearchUserTable($f_result, $user_ids, "listUsersRole");
1286
1287 return true;
1288 }
$_SESSION["AccountId"]
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public

References $_POST, $_SESSION, $counter, ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, ilObjectGUI\$user, ilObjectGUI\__showButton(), ilUtil\formCheckbox(), ilObjectFactory\getInstanceByObjId(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ loadRoleProperties()

ilObjRoleGUI::loadRoleProperties ( ilObjRole  $role)
protected

Store form input in role object.

Returns
Parameters
object$role

Definition at line 472 of file class.ilObjRoleGUI.php.

473 {
474 //Don't set if fields are disabled to prevent html manipulation.
475 if (!$this->form->getItemByPostVar('title')->getDisabled()) {
476 $role->setTitle($this->form->getInput('title'));
477 }
478 if (!$this->form->getItemByPostVar('desc')->getDisabled()) {
479 $role->setDescription($this->form->getInput('desc'));
480 }
481 $role->setAllowRegister($this->form->getInput('reg'));
482 $role->toggleAssignUsersStatus($this->form->getInput('la'));
483 $role->setDiskQuota(ilUtil::MB2Bytes($this->form->getInput('disk_quota')));
484 $role->setPersonalWorkspaceDiskQuota(ilUtil::MB2Bytes($this->form->getInput('wsp_disk_quota')));
485 return true;
486 }
setAllowRegister($a_allow_register)
set allow_register of role
toggleAssignUsersStatus($a_assign_users)
setDiskQuota($a_disk_quota)
Sets the minimal disk quota imposed by this role.
setPersonalWorkspaceDiskQuota($a_disk_quota)
Sets the minimal personal workspace disk quota imposed by this role.
setTitle($a_title)
set object title
setDescription($a_desc)
set object description
static MB2Bytes($a_value)

References ilUtil\MB2Bytes(), ilObjRole\setAllowRegister(), ilObject\setDescription(), ilObjRole\setDiskQuota(), ilObjRole\setPersonalWorkspaceDiskQuota(), ilObject\setTitle(), and ilObjRole\toggleAssignUsersStatus().

Referenced by saveObject(), and updateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mailToRoleObject()

ilObjRoleGUI::mailToRoleObject ( )

Definition at line 1435 of file class.ilObjRoleGUI.php.

1436 {
1437 $obj_ids = ilObject::_getIdsForTitle($this->object->getTitle(), $this->object->getType());
1438 if (count($obj_ids) > 1) {
1439 $_SESSION['mail_roles'][] = '#il_role_' . $this->object->getId();
1440 } else {
1441 require_once 'Services/Mail/classes/Address/Type/class.ilMailRoleAddressType.php';
1442 $_SESSION['mail_roles'][] = ilMailRoleAddressType::getRoleMailboxAddress($this->object->getId());
1443 }
1444
1445 require_once 'Services/Mail/classes/class.ilMailFormCall.php';
1446 $script = ilMailFormCall::getRedirectTarget($this, 'userassignment', array(), array('type' => 'role'));
1447 ilUtil::redirect($script);
1448 }
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
static getRoleMailboxAddress( $a_role_id, $is_localize=true, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
Returns the mailbox address of a role.
static _getIdsForTitle($title, $type='', $partialmatch=false)
static redirect($a_script)

References $_SESSION, ilObject\_getIdsForTitle(), ilMailFormCall\getRedirectTarget(), ilMailRoleAddressType\getRoleMailboxAddress(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ performDeleteRoleObject()

ilObjRoleGUI::performDeleteRoleObject ( )
protected

Delete role.

Returns

Definition at line 851 of file class.ilObjRoleGUI.php.

852 {
853 global $ilErr;
854
855 $access = $this->checkAccess('visible,write', 'edit_permission');
856 if (!$access) {
857 $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'), $ilErr->WARNING);
858 }
859
860 $this->object->setParent((int) $this->obj_ref_id);
861 $this->object->delete();
862 ilUtil::sendSuccess($this->lng->txt('msg_deleted_role'), true);
863
864 $this->ctrl->returnToParent($this);
865 }

References ilObjectGUI\$access, ilObjectGUI\$ilErr, checkAccess(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ permObject()

ilObjRoleGUI::permObject (   $a_show_admin_permissions = false)
protected

Show template permissions.

Returns
void

Definition at line 636 of file class.ilObjRoleGUI.php.

637 {
638 global $ilTabs, $ilErr, $ilToolbar, $objDefinition,$rbacreview;
639
640 $ilTabs->setTabActive('default_perm_settings');
641
642 $this->setSubTabs('default_perm_settings');
643
644 if ($a_show_admin_permissions) {
645 $ilTabs->setSubTabActive('rbac_admin_permissions');
646 } else {
647 $ilTabs->setSubTabActive('rbac_repository_permissions');
648 }
649
650 if (!$this->checkAccess('write', 'edit_permission')) {
651 $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'), $ilErr->MESSAGE);
652 return true;
653 }
654
655 // Show copy role button
656 if ($this->object->getId() != SYSTEM_ROLE_ID) {
657 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
658 $ilToolbar->addButton(
659 $this->lng->txt("adopt_perm_from_template"),
660 $this->ctrl->getLinkTarget($this, 'adoptPerm')
661 );
662 if ($rbacreview->isDeleteable($this->object->getId(), $this->obj_ref_id)) {
663 $ilToolbar->addButton(
664 $this->lng->txt('rbac_delete_role'),
665 $this->ctrl->getLinkTarget($this, 'confirmDeleteRole')
666 );
667 }
668 }
669
670 $this->tpl->addBlockFile(
671 'ADM_CONTENT',
672 'adm_content',
673 'tpl.rbac_template_permissions.html',
674 'Services/AccessControl'
675 );
676
677 $this->tpl->setVariable('PERM_ACTION', $this->ctrl->getFormAction($this));
678
679 include_once './Services/Accordion/classes/class.ilAccordionGUI.php';
680 $acc = new ilAccordionGUI();
681 $acc->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN);
682 $acc->setId('template_perm_' . $this->getParentRefId());
683
684 if ($this->obj_ref_id == ROLE_FOLDER_ID) {
685 if ($a_show_admin_permissions) {
686 $subs = $objDefinition->getSubObjectsRecursively('adm', true, true);
687 } else {
688 $subs = $objDefinition->getSubObjectsRecursively('root', true, $a_show_admin_permissions);
689 }
690 } else {
691 $subs = $objDefinition->getSubObjectsRecursively($this->getParentType(), true, $a_show_admin_permissions);
692 }
693
694 $sorted = array();
695 foreach ($subs as $subtype => $def) {
696 if ($objDefinition->isPlugin($subtype)) {
697 $translation = ilObjectPlugin::lookupTxtById($subtype, "obj_" . $subtype);
698 } elseif ($objDefinition->isSystemObject($subtype)) {
699 $translation = $this->lng->txt("obj_" . $subtype);
700 } else {
701 $translation = $this->lng->txt('objs_' . $subtype);
702 }
703
704 $sorted[$subtype] = $def;
705 $sorted[$subtype]['translation'] = $translation;
706 }
707
708
709 $sorted = ilUtil::sortArray($sorted, 'translation', 'asc', true, true);
710 foreach ($sorted as $subtype => $def) {
711 if ($objDefinition->isPlugin($subtype)) {
712 $translation = ilObjectPlugin::lookupTxtById($subtype, "obj_" . $subtype);
713 } elseif ($objDefinition->isSystemObject($subtype)) {
714 $translation = $this->lng->txt("obj_" . $subtype);
715 } else {
716 $translation = $this->lng->txt('objs_' . $subtype);
717 }
718
719 include_once 'Services/AccessControl/classes/class.ilObjectRoleTemplatePermissionTableGUI.php';
721 $this,
722 'perm',
723 $this->getParentRefId(),
724 $this->object->getId(),
725 $subtype,
726 $a_show_admin_permissions
727 );
728 $tbl->parse();
729
730 $acc->addItem($translation, $tbl->getHTML());
731 }
732
733 $this->tpl->setVariable('ACCORDION', $acc->getHTML());
734
735 // Add options table
736 include_once './Services/AccessControl/classes/class.ilObjectRoleTemplateOptionsTableGUI.php';
738 $this,
739 'perm',
740 $this->obj_ref_id,
741 $this->object->getId(),
742 $a_show_admin_permissions
743 );
744 if ($this->object->getId() != SYSTEM_ROLE_ID) {
745 $options->addMultiCommand(
746 $a_show_admin_permissions ? 'adminPermSave' : 'permSave',
747 $this->lng->txt('save')
748 );
749 }
750
751 $options->parse();
752 $this->tpl->setVariable('OPTIONS_TABLE', $options->getHTML());
753 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
Accordion user interface class.
getParentType()
get type of current object (not role folder)
setSubTabs($a_tab)
Set sub tabs.
static lookupTxtById($plugin_id, $lang_var)
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$def
Definition: croninfo.php:21

References $def, ilObjectGUI\$ilErr, ilObjectGUI\$objDefinition, $options, ilObjectGUI\$rbacreview, $tbl, checkAccess(), ilAccordionGUI\FORCE_ALL_OPEN, getParentRefId(), getParentType(), ilObjectPlugin\lookupTxtById(), setSubTabs(), and ilUtil\sortArray().

Referenced by adminPermObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ permSaveObject()

ilObjRoleGUI::permSaveObject (   $a_show_admin_permissions = false)

save permissions

@access public

Definition at line 872 of file class.ilObjRoleGUI.php.

873 {
874 global $rbacsystem, $rbacadmin, $rbacreview, $objDefinition, $tree;
875
876 // for role administration check write of global role folder
877 $access = $this->checkAccess('visible,write', 'edit_permission');
878
879 if (!$access) {
880 $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"), $this->ilias->error_obj->MESSAGE);
881 }
882
883 // rbac log
884 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
885 $rbac_log_active = ilRbacLog::isActive();
886 if ($rbac_log_active) {
887 $rbac_log_old = ilRbacLog::gatherTemplate($this->obj_ref_id, $this->object->getId());
888 }
889
890 // delete all template entries of enabled types
891 if ($this->obj_ref_id == ROLE_FOLDER_ID) {
892 if ($a_show_admin_permissions) {
893 $subs = $objDefinition->getSubObjectsRecursively('adm', true, true);
894 } else {
895 $subs = $objDefinition->getSubObjectsRecursively('root', true, false);
896 }
897 } else {
898 $subs = $objDefinition->getSubObjectsRecursively($this->getParentType(), true, false);
899 }
900
901 foreach ($subs as $subtype => $def) {
902 // Delete per object type
903 $rbacadmin->deleteRolePermission($this->object->getId(), $this->obj_ref_id, $subtype);
904 }
905
906 if (empty($_POST["template_perm"])) {
907 $_POST["template_perm"] = array();
908 }
909
910 foreach ($_POST["template_perm"] as $key => $ops_array) {
911 // sets new template permissions
912 $rbacadmin->setRolePermission($this->object->getId(), $key, $ops_array, $this->obj_ref_id);
913 }
914
915 if ($rbac_log_active) {
916 $rbac_log_new = ilRbacLog::gatherTemplate($this->obj_ref_id, $this->object->getId());
917 $rbac_log_diff = ilRbacLog::diffTemplate($rbac_log_old, $rbac_log_new);
918 ilRbacLog::add(ilRbacLog::EDIT_TEMPLATE, $this->obj_ref_id, $rbac_log_diff);
919 }
920
921 // update object data entry (to update last modification date)
922 $this->object->update();
923
924 // set protected flag
925 if ($this->obj_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(), $this->obj_ref_id)) {
926 $rbacadmin->setProtected($this->obj_ref_id, $this->object->getId(), ilUtil::tf2yn($_POST['protected']));
927 }
928
929 if ($a_show_admin_permissions) {
930 $_POST['recursive'] = true;
931 }
932
933 // Redirect if Change existing objects is not chosen
934 if (!$_POST['recursive'] and !is_array($_POST['recursive_list'])) {
935 ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
936 if ($a_show_admin_permissions) {
937 $this->ctrl->redirect($this, 'adminPerm');
938 } else {
939 $this->ctrl->redirect($this, 'perm');
940 }
941 }
942 // New implementation
943 if ($this->isChangeExistingObjectsConfirmationRequired() and !$a_show_admin_permissions) {
945 return true;
946 }
947
948 $start = ($this->obj_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $this->obj_ref_id);
949 if ($a_show_admin_permissions) {
950 $start = $tree->getParentId($this->obj_ref_id);
951 }
952
953 if ($_POST['protected']) {
954 $this->object->changeExistingObjects(
955 $start,
957 array('all'),
958 array()
959 #$a_show_admin_permissions ? array('adm') : array()
960 );
961 } else {
962 $this->object->changeExistingObjects(
963 $start,
965 array('all'),
966 array()
967 #$a_show_admin_permissions ? array('adm') : array()
968 );
969 }
970 ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
971
972 if ($a_show_admin_permissions) {
973 $this->ctrl->redirect($this, 'adminPerm');
974 } else {
975 $this->ctrl->redirect($this, 'perm');
976 }
977 return true;
978 }
showChangeExistingObjectsConfirmation()
Show confirmation screen.
isChangeExistingObjectsConfirmationRequired()
Check if a confirmation about further settings is required or not.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
const MODE_PROTECTED_KEEP_LOCAL_POLICIES
static diffTemplate(array $a_old, array $a_new)
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static gatherTemplate($a_role_ref_id, $a_role_id)
const EDIT_TEMPLATE
static isActive()
static tf2yn($a_tf)
convert true/false to "y"/"n"

References $_POST, ilObjectGUI\$access, $def, $key, $obj_ref_id, ilObjectGUI\$objDefinition, ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, ilObjectGUI\$tree, ilRbacLog\add(), checkAccess(), ilRbacLog\diffTemplate(), ilRbacLog\EDIT_TEMPLATE, ilRbacLog\gatherTemplate(), getParentType(), ilRbacLog\isActive(), isChangeExistingObjectsConfirmationRequired(), ilObjRole\MODE_PROTECTED_KEEP_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES, ilUtil\sendSuccess(), showChangeExistingObjectsConfirmation(), and ilUtil\tf2yn().

Referenced by adminPermSaveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readRoleProperties()

ilObjRoleGUI::readRoleProperties ( ilObjRole  $role)
protected

Read role properties and write them to form.

Returns
Parameters
object$role

Definition at line 493 of file class.ilObjRoleGUI.php.

494 {
495 global $rbacreview;
496
497 include_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
498
499 $data['title'] = $role->getTitle();
500 $data['desc'] = $role->getDescription();
501 $data['ilias_id'] = 'il_' . IL_INST_ID . '_' . ilObject::_lookupType($role->getId()) . '_' . $role->getId();
502 $data['reg'] = $role->getAllowRegister();
503 $data['la'] = $role->getAssignUsersStatus();
505 $data['disk_quota'] = ilUtil::Bytes2MB($role->getDiskQuota());
506 }
508 $data['wsp_disk_quota'] = ilUtil::Bytes2MB($role->getPersonalWorkspaceDiskQuota());
509 }
510 $data['pro'] = $rbacreview->isProtected($this->obj_ref_id, $role->getId());
511
512 $this->form->setValuesByArray($data);
513 }
getPersonalWorkspaceDiskQuota()
Gets the minimal personal workspace disk quota imposed by this role.
getAllowRegister()
get allow_register
getDiskQuota()
Gets the minimal disk quota imposed by this role.
getDescription()
get object description
getId()
get object id @access public
getTitle()
get object title @access public
static Bytes2MB($a_value)

References ilObjectGUI\$data, ilObjectGUI\$rbacreview, ilDiskQuotaActivationChecker\_isActive(), ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilObject\_lookupType(), ilUtil\Bytes2MB(), ilObjRole\getAllowRegister(), ilObjRole\getAssignUsersStatus(), ilObject\getDescription(), ilObjRole\getDiskQuota(), ilObject\getId(), ilObjRole\getPersonalWorkspaceDiskQuota(), and ilObject\getTitle().

Referenced by editObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilObjRoleGUI::saveObject ( )

Save new role.

Returns

Reimplemented from ilObjectGUI.

Definition at line 568 of file class.ilObjRoleGUI.php.

569 {
570 global $rbacadmin,$rbacreview;
571
572 $this->initFormRoleProperties(self::MODE_GLOBAL_CREATE);
573 if ($this->form->checkInput() and !$this->checkDuplicate()) {
574 include_once './Services/AccessControl/classes/class.ilObjRole.php';
575 $this->loadRoleProperties($this->role = new ilObjRole());
576 $this->role->create();
577 $rbacadmin->assignRoleToFolder($this->role->getId(), $this->obj_ref_id, 'y');
578 $rbacadmin->setProtected(
579 $this->obj_ref_id,
580 $this->role->getId(),
581 $this->form->getInput('pro') ? 'y' : 'n'
582 );
583 ilUtil::sendSuccess($this->lng->txt("role_added"), true);
584 $this->ctrl->setParameter($this, 'obj_id', $this->role->getId());
585 $this->ctrl->redirect($this, 'perm');
586 }
587
588 ilUtil::sendFailure($this->lng->txt('err_check_input'));
589 $this->form->setValuesByPost();
590 $this->tpl->setContent($this->form->getHTML());
591 return false;
592 }
loadRoleProperties(ilObjRole $role)
Store form input in role object.

References ilObjectGUI\$rbacreview, initFormRoleProperties(), loadRoleProperties(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ selectDesktopItemObject()

ilObjRoleGUI::selectDesktopItemObject ( )

Definition at line 308 of file class.ilObjRoleGUI.php.

309 {
310 global $rbacsystem,$tree;
311
312 include_once 'Services/AccessControl/classes/class.ilRoleDesktopItemSelector.php';
313 include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
314
315 if (!$rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
316 #$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
317 ilUtil::sendFailure($this->lng->txt('permission_denied'));
318 $this->listDesktopItemsObject();
319 return false;
320 }
321
322 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.role_desktop_item_selector.html", "Services/AccessControl");
323 $this->__showButton('listDesktopItems', $this->lng->txt('back'));
324
325 ilUtil::sendInfo($this->lng->txt("role_select_desktop_item"));
326
327 $exp = new ilRoleDesktopItemSelector(
328 $this->ctrl->getLinkTarget($this, 'selectDesktopItem'),
329 new ilRoleDesktopItem($this->object->getId())
330 );
331 $exp->setExpand($_GET["role_desk_item_link_expand"] ? $_GET["role_desk_item_link_expand"] : $tree->readRootId());
332 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'selectDesktopItem'));
333
334 $exp->setOutput(0);
335
336 $output = $exp->getOutput();
337 $this->tpl->setVariable("EXPLORER", $output);
338 //$this->tpl->setVariable("EXPLORER", $exp->getOutput());
339
340 return true;
341 }

References $_GET, $output, ilObjectGUI\$rbacsystem, ilObjectGUI\$tree, ilObjectGUI\__showButton(), listDesktopItemsObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), and USER_FOLDER_ID.

Referenced by assignDesktopItemObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBackTarget()

ilObjRoleGUI::setBackTarget (   $a_text,
  $a_link 
)

set back tab target

Definition at line 165 of file class.ilObjRoleGUI.php.

166 {
167 $this->back_target = array("text" => $a_text,
168 "link" => $a_link);
169 }

◆ setSubTabs()

ilObjRoleGUI::setSubTabs (   $a_tab)
protected

Set sub tabs.

Parameters
object$a_tab
Returns

Definition at line 1571 of file class.ilObjRoleGUI.php.

1572 {
1573 global $ilTabs;
1574
1575 switch ($a_tab) {
1576 case 'default_perm_settings':
1577 if ($this->obj_ref_id != ROLE_FOLDER_ID) {
1578 return true;
1579 }
1580 $ilTabs->addSubTabTarget(
1581 'rbac_repository_permissions',
1582 $this->ctrl->getLinkTarget($this, 'perm')
1583 );
1584 $ilTabs->addSubTabTarget(
1585 'rbac_admin_permissions',
1586 $this->ctrl->getLinkTarget($this, 'adminPerm')
1587 );
1588 }
1589 return true;
1590 }

Referenced by permObject().

+ Here is the caller graph for this function:

◆ showChangeExistingObjectsConfirmation()

ilObjRoleGUI::showChangeExistingObjectsConfirmation ( )
protected

Show confirmation screen.

Returns

Definition at line 1491 of file class.ilObjRoleGUI.php.

1492 {
1493 $protected = $_POST['protected'];
1494
1495 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1496 $form = new ilPropertyFormGUI();
1497 $form->setFormAction($this->ctrl->getFormAction($this, 'changeExistingObjects'));
1498 $form->setTitle($this->lng->txt('rbac_change_existing_confirm_tbl'));
1499
1500 $form->addCommandButton('changeExistingObjects', $this->lng->txt('change_existing_objects'));
1501 $form->addCommandButton('perm', $this->lng->txt('cancel'));
1502
1503 $hidden = new ilHiddenInputGUI('type_filter');
1504 $hidden->setValue(
1505 $_POST['recursive'] ?
1506 serialize(array('all')) :
1507 serialize($_POST['recursive_list'])
1508 );
1509 $form->addItem($hidden);
1510
1511 $rad = new ilRadioGroupInputGUI($this->lng->txt('rbac_local_policies'), 'mode');
1512
1513 if ($protected) {
1515 $keep = new ilRadioOption(
1516 $this->lng->txt('rbac_keep_local_policies'),
1518 $this->lng->txt('rbac_keep_local_policies_info')
1519 );
1520 } else {
1522 $keep = new ilRadioOption(
1523 $this->lng->txt('rbac_keep_local_policies'),
1525 $this->lng->txt('rbac_unprotected_keep_local_policies_info')
1526 );
1527 }
1528 $rad->addOption($keep);
1529
1530 if ($protected) {
1531 $del = new ilRadioOption(
1532 $this->lng->txt('rbac_delete_local_policies'),
1534 $this->lng->txt('rbac_delete_local_policies_info')
1535 );
1536 } else {
1537 $del = new ilRadioOption(
1538 $this->lng->txt('rbac_delete_local_policies'),
1540 $this->lng->txt('rbac_unprotected_delete_local_policies_info')
1541 );
1542 }
1543 $rad->addOption($del);
1544
1545 $form->addItem($rad);
1546 $this->tpl->setContent($form->getHTML());
1547 }
This class represents a hidden form property in a property form.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
This class represents a property in a property form.
This class represents an option in a radio group.
if(isset($_POST['submit'])) $form

References $_POST, $form, ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, ilObjRole\MODE_PROTECTED_KEEP_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES, and ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES.

Referenced by permSaveObject().

+ Here is the caller graph for this function:

◆ showDefaultPermissionSettings()

ilObjRoleGUI::showDefaultPermissionSettings ( )
protected

check if default permissions are shown or not

Returns

Definition at line 197 of file class.ilObjRoleGUI.php.

198 {
199 global $objDefinition;
200
201 return $objDefinition->isContainer($this->getContainerType());
202 }
getContainerType()
Get type of role container.

References ilObjectGUI\$objDefinition, and getContainerType().

Referenced by executeCommand(), and getTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateObject()

ilObjRoleGUI::updateObject ( )

Save role settings.

Returns

Reimplemented from ilObjectGUI.

Definition at line 608 of file class.ilObjRoleGUI.php.

609 {
610 global $rbacadmin;
611
612 $this->initFormRoleProperties(self::MODE_GLOBAL_UPDATE);
613 if ($this->form->checkInput() and !$this->checkDuplicate($this->object->getId())) {
614 include_once './Services/AccessControl/classes/class.ilObjRole.php';
615 $this->loadRoleProperties($this->object);
616 $this->object->update();
617 $rbacadmin->setProtected(
618 $this->obj_ref_id,
619 $this->object->getId(),
620 $this->form->getInput('pro') ? 'y' : 'n'
621 );
622 ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
623 $this->ctrl->redirect($this, 'edit');
624 }
625
626 ilUtil::sendFailure($this->lng->txt('err_check_input'));
627 $this->form->setValuesByPost();
628 $this->tpl->setContent($this->form->getHTML());
629 return false;
630 }

References initFormRoleProperties(), loadRoleProperties(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ userassignmentObject()

ilObjRoleGUI::userassignmentObject ( )

display user assignment panel

Definition at line 1151 of file class.ilObjRoleGUI.php.

1152 {
1154
1155 if (!$this->checkAccess('edit_userassignment', 'edit_permission')) {
1156 $this->ilias->raiseError($this->lng->txt("msg_no_perm_assign_user_to_role"), $this->ilias->error_obj->MESSAGE);
1157 }
1158
1159 $this->tabs_gui->setTabActive('user_assignment');
1160
1161 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rbac_ua.html', 'Services/AccessControl');
1162
1163 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1164 $tb = new ilToolbarGUI();
1165
1166 // protected admin role
1167 include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
1168 if (
1169 $this->object->getId() != SYSTEM_ROLE_ID ||
1170 (
1171 !$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) or
1172 !ilSecuritySettings::_getInstance()->isAdminRoleProtected()
1173 )
1174 ) {
1175
1176
1177 // add member
1178 include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
1180 $this,
1181 $tb,
1182 array(
1183 'auto_complete_name' => $lng->txt('user'),
1184 'submit_name' => $lng->txt('add')
1185 )
1186 );
1187
1188 /*
1189 // add button
1190 $tb->addFormButton($lng->txt("add"), "assignUser");
1191 */
1192 $tb->addSpacer();
1193
1194 $tb->addButton(
1195 $this->lng->txt('search_user'),
1196 $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start')
1197 );
1198 $tb->addSpacer();
1199 }
1200
1201 $tb->addButton(
1202 $this->lng->txt('role_mailto'),
1203 $this->ctrl->getLinkTarget($this, 'mailToRole')
1204 );
1205 $this->tpl->setVariable('BUTTONS_UA', $tb->getHTML());
1206
1207
1208 include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
1209 $role_assignment_editable = true;
1210 if (
1211 $this->object->getId() == SYSTEM_ROLE_ID &&
1212 !ilSecuritySettings::_getInstance()->checkAdminRoleAccessible($ilUser->getId())) {
1213 $role_assignment_editable = false;
1214 }
1215
1216 include_once './Services/AccessControl/classes/class.ilAssignedUsersTableGUI.php';
1217 $ut = new ilAssignedUsersTableGUI($this, 'userassignment', $this->object->getId(), $role_assignment_editable);
1218
1219 $this->tpl->setVariable('TABLE_UA', $ut->getHTML());
1220
1221 return true;
1222 }
TableGUI class for role administration.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
static _getInstance()
Get instance of ilSecuritySettings.

References $ilUser, ilObjectGUI\$lng, ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, ilSecuritySettings\_getInstance(), checkAccess(), and ilRepositorySearchGUI\fillAutoCompleteToolbar().

+ Here is the call graph for this function:

Field Documentation

◆ $container_type

ilObjRoleGUI::$container_type = ''
protected

Definition at line 38 of file class.ilObjRoleGUI.php.

Referenced by getContainerType().

◆ $ctrl

ilObjRoleGUI::$ctrl

Definition at line 41 of file class.ilObjRoleGUI.php.

◆ $obj_obj_id

ilObjRoleGUI::$obj_obj_id = 0
protected

Definition at line 36 of file class.ilObjRoleGUI.php.

Referenced by getParentObjId().

◆ $obj_obj_type

ilObjRoleGUI::$obj_obj_type = ''
protected

Definition at line 37 of file class.ilObjRoleGUI.php.

Referenced by getParentType().

◆ $obj_ref_id

ilObjRoleGUI::$obj_ref_id = 0
protected

◆ $type

ilObjRoleGUI::$type

Definition at line 32 of file class.ilObjRoleGUI.php.

◆ MODE_GLOBAL_CREATE

const ilObjRoleGUI::MODE_GLOBAL_CREATE = 2

Definition at line 23 of file class.ilObjRoleGUI.php.

Referenced by initFormRoleProperties().

◆ MODE_GLOBAL_UPDATE

const ilObjRoleGUI::MODE_GLOBAL_UPDATE = 1

Definition at line 22 of file class.ilObjRoleGUI.php.

Referenced by initFormRoleProperties().

◆ MODE_LOCAL_CREATE

const ilObjRoleGUI::MODE_LOCAL_CREATE = 4

Definition at line 25 of file class.ilObjRoleGUI.php.

Referenced by initFormRoleProperties().

◆ MODE_LOCAL_UPDATE

const ilObjRoleGUI::MODE_LOCAL_UPDATE = 3

Definition at line 24 of file class.ilObjRoleGUI.php.

Referenced by initFormRoleProperties().


The documentation for this class was generated from the following file: