ILIAS  release_4-4 Revision
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 public. More...
 
executeCommand ()
 
 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 (&$tabs_gui)
 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 public More...
 
 listUsersRoleObject ()
 
 __formatPath ($a_path_arr)
 
 __prepareOutput ()
 
 __setHeader ()
 
 __setLocator ()
 
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getTabs (&$tabs_gui)
 
 mailToRoleObject ()
 
 checkAccess ($a_perm_global, $a_perm_obj='')
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 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
 
 $rolf_ref_id
 
 $ctrl
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $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...
 
 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...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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...
 
 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...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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 = ''
 

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.de>
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$

ilObjRoleGUI: ilRepositorySearchGUI, ilExportGUI

Definition at line 19 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 public.

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

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

53  {
54  global $tree,$lng;
55 
56  $lng->loadLanguageModule('rbac');
57 
58  //TODO: move this to class.ilias.php
59  define("USER_FOLDER_ID",7);
60 
61  if($_GET['rolf_ref_id'] != '')
62  {
63  $this->rolf_ref_id = $_GET['rolf_ref_id'];
64  }
65  else
66  {
67  $this->rolf_ref_id = $_GET['ref_id'];
68  }
69  // Add ref_id of object that contains this role folder
70  $this->obj_ref_id = $tree->getParentId($this->rolf_ref_id);
71  $this->obj_obj_id = ilObject::_lookupObjId($this->getParentRefId());
72  $this->obj_obj_type = ilObject::_lookupType($this->getParentObjId());
73 
74  $this->container_type = ilObject::_lookupType(ilObject::_lookupObjId($this->obj_ref_id));
75 
76  $this->type = "role";
77  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
78  $this->ctrl->saveParameter($this, array("obj_id", "rolf_ref_id"));
79  }
$_GET["client_id"]
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
getParentObjId()
Get obj_id of current object.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
getParentRefId()
Get ref id of current object (not role folder id)
+ Here is the call graph for this function:

Member Function Documentation

◆ __formatPath()

ilObjRoleGUI::__formatPath (   $a_path_arr)

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

References ilObjectGUI\$data, and $path.

Referenced by listDesktopItemsObject().

1475  {
1476  $counter = 0;
1477 
1478  foreach ($a_path_arr as $data)
1479  {
1480  if ($counter++)
1481  {
1482  $path .= " -> ";
1483  }
1484 
1485  $path .= $data['title'];
1486  }
1487 
1488  if (strlen($path) > 50)
1489  {
1490  return '...'.substr($path,-50);
1491  }
1492 
1493  return $path;
1494  }
$path
Definition: index.php:22
+ Here is the caller graph for this function:

◆ __prepareOutput()

ilObjRoleGUI::__prepareOutput ( )

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

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

1497  {
1498  // output objects
1499  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1500  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1501 
1502  // output locator
1503  //$this->__setLocator();
1504 
1505  // output message
1506  if ($this->message)
1507  {
1508  ilUtil::sendInfo($this->message);
1509  }
1510 
1511  // display infopanel if something happened
1513 
1514  // set header
1515  $this->__setHeader();
1516  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static infoPanel($a_keep=true)
+ Here is the call graph for this function:

◆ __setHeader()

ilObjRoleGUI::__setHeader ( )

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

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

Referenced by __prepareOutput().

1519  {
1520  $this->tpl->setTitle($this->lng->txt('role'));
1521  $this->tpl->setDescription($this->object->getTitle());
1522  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_role.png"));
1523 
1524  $this->getTabs($this->tabs_gui);
1525  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setLocator()

ilObjRoleGUI::__setLocator ( )

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

References $_GET, $ilCtrl, $row, and ilObjectGUI\$tree.

1528  {
1529  global $tree, $ilCtrl;
1530 
1531  return;
1532 
1533  $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
1534 
1535  $counter = 0;
1536 
1537  foreach ($tree->getPathFull($this->rolf_ref_id) as $key => $row)
1538  {
1539  if ($counter++)
1540  {
1541  $this->tpl->touchBlock('locator_separator_prefix');
1542  }
1543 
1544  $this->tpl->setCurrentBlock("locator_item");
1545 
1546  if ($row["type"] == 'rolf')
1547  {
1548  $this->tpl->setVariable("ITEM",$this->object->getTitle());
1549  $this->tpl->setVariable("LINK_ITEM",$this->ctrl->getLinkTarget($this));
1550  }
1551  elseif ($row["child"] != $tree->getRootId())
1552  {
1553  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $row["child"]);
1554  $this->tpl->setVariable("ITEM", $row["title"]);
1555  $this->tpl->setVariable("LINK_ITEM",
1556  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
1557  }
1558  else
1559  {
1560  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $row["child"]);
1561  $this->tpl->setVariable("ITEM", $this->lng->txt("repository"));
1562  $this->tpl->setVariable("LINK_ITEM",
1563  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
1564  }
1565  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
1566 
1567  $this->tpl->parseCurrentBlock();
1568  }
1569 
1570  $this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
1571  $this->tpl->parseCurrentBlock();
1572  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ addAdminLocatorItems()

ilObjRoleGUI::addAdminLocatorItems ( )

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

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

References $_GET, and ilObject\_lookupObjId().

1579  {
1580  global $ilLocator;
1581 
1582  if ($_GET["admin_mode"] == "settings"
1583  && $_GET["ref_id"] == ROLE_FOLDER_ID) // system settings
1584  {
1585  parent::addAdminLocatorItems(true);
1586 
1587  $ilLocator->addItem($this->lng->txt("obj_".ilObject::_lookupType(
1588  ilObject::_lookupObjId($_GET["ref_id"]))),
1589  $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
1590 
1591  if ($_GET["obj_id"] > 0)
1592  {
1593  $ilLocator->addItem($this->object->getTitle(),
1594  $this->ctrl->getLinkTarget($this, "view"));
1595  }
1596  }
1597  else // repository administration
1598  {
1599  // ?
1600  }
1601  }
$_GET["client_id"]
static _lookupObjId($a_id)
+ 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 1198 of file class.ilObjRoleGUI.php.

References $GLOBALS, $rolf_ref_id, checkAccess(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

1199  {
1200  global $rbacreview,$rbacadmin;
1201 
1202  if(!$this->checkAccess('edit_userassignment','edit_permission'))
1203  {
1204  ilUtil::sendFailure($this->lng->txt('msg_no_perm_assign_user_to_role'),true);
1205  return false;
1206  }
1207  if(!$rbacreview->isAssignable($this->object->getId(),$this->rolf_ref_id) &&
1208  $this->rolf_ref_id != ROLE_FOLDER_ID)
1209  {
1210  ilUtil::sendFailure($this->lng->txt('err_role_not_assignable'),true);
1211  return false;
1212  }
1213  if(!$a_user_ids)
1214  {
1215  $GLOBALS['lng']->loadLanguageModule('search');
1216  ilUtil::sendFailure($this->lng->txt('search_err_user_not_exist'),true);
1217  return false;
1218  }
1219 
1220  $assigned_users_all = $rbacreview->assignedUsers($this->object->getId());
1221 
1222  // users to assign
1223  $assigned_users_new = array_diff($a_user_ids,array_intersect($a_user_ids,$assigned_users_all));
1224 
1225  // selected users all already assigned. stop
1226  if (count($assigned_users_new) == 0)
1227  {
1228  ilUtil::sendInfo($this->lng->txt("rbac_msg_user_already_assigned"),true);
1229  $this->ctrl->redirect($this,'userassignment');
1230  }
1231 
1232  // assign new users
1233  foreach ($assigned_users_new as $user)
1234  {
1235  $rbacadmin->assignUser($this->object->getId(),$user,false);
1236  }
1237 
1238  // update object data entry (to update last modification date)
1239  $this->object->update();
1240 
1241  ilUtil::sendSuccess($this->lng->txt("msg_userassignment_changed"),true);
1242  $this->ctrl->redirect($this,'userassignment');
1243  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$GLOBALS['ct_recipient']
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkAccess($a_perm_global, $a_perm_obj='')
+ Here is the call graph for this function:

◆ adminPermObject()

ilObjRoleGUI::adminPermObject ( )
protected

Show administration permissions.

Returns

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

References permObject().

842  {
843  return $this->permObject(true);
844  }
permObject($a_show_admin_permissions=false)
Show template permissions.
+ Here is the call graph for this function:

◆ adminPermSaveObject()

ilObjRoleGUI::adminPermSaveObject ( )
protected

Save admin permissions.

Returns

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

References permSaveObject().

851  {
852  return $this->permSaveObject(true);
853  }
permSaveObject($a_show_admin_permissions=false)
save permissions
+ Here is the call graph for this function:

◆ adoptPermObject()

ilObjRoleGUI::adoptPermObject ( )
protected

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

References ilObjectGUI\$tpl, ilObjRole\_getTranslation(), ilUtil\_sortIds(), and ilUtil\formRadioButton().

Referenced by adoptPermSaveObject().

856  {
857  global $rbacreview;
858 
859  $output = array();
860 
861  $parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
862  $ids = array();
863  foreach($parent_role_ids as $id => $tmp)
864  {
865  $ids[] = $id;
866  }
867 
868  // Sort ids
869  $sorted_ids = ilUtil::_sortIds($ids,'object_data','type,title','obj_id');
870  $key = 0;
871  foreach($sorted_ids as $id)
872  {
873  $par = $parent_role_ids[$id];
874  if ($par["obj_id"] != SYSTEM_ROLE_ID && $this->object->getId() != $par["obj_id"])
875  {
876  $radio = ilUtil::formRadioButton(0,"adopt",$par["obj_id"]);
877  $output["adopt"][$key]["css_row_adopt"] = ($key % 2 == 0) ? "tblrow1" : "tblrow2";
878  $output["adopt"][$key]["check_adopt"] = $radio;
879  $output["adopt"][$key]["role_id"] = $par["obj_id"];
880  $output["adopt"][$key]["type"] = ($par["type"] == 'role' ? $this->lng->txt('obj_role') : $this->lng->txt('obj_rolt'));
881  $output["adopt"][$key]["role_name"] = ilObjRole::_getTranslation($par["title"]);
882  $output["adopt"][$key]["role_desc"] = $par["desc"];
883  $key++;
884  }
885  }
886 
887  $output["formaction_adopt"] = $this->ctrl->getFormAction($this);
888  $output["message_middle"] = $this->lng->txt("adopt_perm_from_template");
889 
890 
891  $tpl = new ilTemplate("tpl.adm_copy_role.html", true, true, "Services/AccessControl");
892 
893  $tpl->setCurrentBlock("ADOPT_PERM_ROW");
894  foreach ($output["adopt"] as $key => $value)
895  {
896  $tpl->setVariable("CSS_ROW_ADOPT",$value["css_row_adopt"]);
897  $tpl->setVariable("CHECK_ADOPT",$value["check_adopt"]);
898  $tpl->setVariable("LABEL_ID",$value["role_id"]);
899  $tpl->setVariable("TYPE",$value["type"]);
900  $tpl->setVariable("ROLE_NAME",$value["role_name"]);
901  if(strlen($value['role_desc']))
902  {
903  $tpl->setVariable('ROLE_DESC',$value['role_desc']);
904  }
905  $tpl->parseCurrentBlock();
906  }
907 
908  $tpl->setVariable("TPLPATH",$this->tpl->tplPath);
909  $tpl->setVariable("MESSAGE_MIDDLE",$output["message_middle"]);
910  $tpl->setVariable("FORMACTION_ADOPT",$output["formaction_adopt"]);
911  $tpl->setVariable("ADOPT",$this->lng->txt('copy'));
912  $tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
913 
914  $tpl->setVariable('HEAD_ROLE',$this->lng->txt('title'));
915  $tpl->setVariable('HEAD_TYPE',$this->lng->txt('type'));
916 
917  $this->tpl->setContent($tpl->get());
918  }
_getTranslation($a_role_title)
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,7),&#39;usr_data&#39;,&#39;lastname&#39;,&#39;usr_id&#39;) => sorts by lastname.
special template class to simplify handling of ITX/PEAR
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adoptPermSaveObject()

ilObjRoleGUI::adoptPermSaveObject ( )

copy permissions from role

public

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

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

1138  {
1139  global $rbacadmin, $rbacsystem, $rbacreview, $tree;
1140 
1141  if(!$_POST['adopt'])
1142  {
1143  ilUtil::sendFailure($this->lng->txt('select_one'));
1144  $this->adoptPermObject();
1145  return false;
1146  }
1147 
1148  $access = $this->checkAccess('visible,write','edit_permission');
1149  if (!$access)
1150  {
1151  $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
1152  }
1153 
1154  if ($this->object->getId() == $_POST["adopt"])
1155  {
1156  ilUtil::sendFailure($this->lng->txt("msg_perm_adopted_from_itself"),true);
1157  }
1158  else
1159  {
1160  $rbacadmin->deleteRolePermission($this->object->getId(), $this->rolf_ref_id);
1161  $parentRoles = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
1162  $rbacadmin->copyRoleTemplatePermissions(
1163  $_POST["adopt"],
1164  $parentRoles[$_POST["adopt"]]["parent"],
1165  $this->rolf_ref_id,
1166  $this->object->getId(),
1167  false);
1168 
1169  // update object data entry (to update last modification date)
1170  $this->object->update();
1171 
1172  // send info
1173  $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_POST["adopt"]);
1174  ilUtil::sendSuccess($this->lng->txt("msg_perm_adopted_from1")." '".$obj_data->getTitle()."'.<br/>".
1175  $this->lng->txt("msg_perm_adopted_from2"),true);
1176  }
1177 
1178  $this->ctrl->redirect($this, "perm");
1179  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkAccess($a_perm_global, $a_perm_obj='')
+ Here is the call graph for this function:

◆ askDeleteDesktopItemObject()

ilObjRoleGUI::askDeleteDesktopItemObject ( )

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

References $_POST, $_SESSION, checkAccess(), ilUtil\getImagePath(), ilObjectFactory\getInstanceByRefId(), ilRoleDesktopItem\getItem(), listDesktopItemsObject(), ilUtil\sendFailure(), ilUtil\sendQuestion(), ilUtil\switchColor(), and USER_FOLDER_ID.

277  {
278  global $rbacsystem;
279 
280 
281  #if(!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
282  if(!$this->checkAccess('edit_permission'))
283  {
284  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
285  }
286  if(!$rbacsystem->checkAccess('push_desktop_items',USER_FOLDER_ID))
287  {
288  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
289  }
290  if(!count($_POST['del_desk_item']))
291  {
292  ilUtil::sendFailure($this->lng->txt('role_select_one_item'));
293 
294  $this->listDesktopItemsObject();
295 
296  return true;
297  }
298  ilUtil::sendQuestion($this->lng->txt('role_sure_delete_desk_items'));
299 
300  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.role_ask_delete_desktop_item.html", "Services/AccessControl");
301  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
302  $this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath('icon_role.png'));
303  $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt('obj_role'));
304  $this->tpl->setVariable("TBL_TITLE",$this->lng->txt('role_assigned_desk_items').' ('.$this->object->getTitle().')');
305  $this->tpl->setVariable("HEADER_DESC",$this->lng->txt('description'));
306  $this->tpl->setVariable("BTN_DELETE",$this->lng->txt('delete'));
307  $this->tpl->setVariable("BTN_CANCEL",$this->lng->txt('cancel'));
308 
309  include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
310 
311  $role_desk_item_obj =& new ilRoleDesktopItem($this->object->getId());
312 
313  $counter = 0;
314 
315  foreach($_POST['del_desk_item'] as $role_item_id)
316  {
317  $item_data = $role_desk_item_obj->getItem($role_item_id);
318  $tmp_obj =& ilObjectFactory::getInstanceByRefId($item_data['item_id']);
319 
320  if(strlen($desc = $tmp_obj->getDescription()))
321  {
322  $this->tpl->setCurrentBlock("description");
323  $this->tpl->setVariable("DESCRIPTION_DESK",$desc);
324  $this->tpl->parseCurrentBlock();
325  }
326  $this->tpl->setCurrentBlock("desk_row");
327  $this->tpl->setVariable("DESK_TITLE",$tmp_obj->getTitle());
328  $this->tpl->setVariable("ROW_CLASS",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
329  $this->tpl->parseCurrentBlock();
330  }
331 
332  $_SESSION['role_del_desk_items'] = $_POST['del_desk_item'];
333 
334  return true;
335  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
Class ilObjRoleGUI.
$_POST['username']
Definition: cron.php:12
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkAccess($a_perm_global, $a_perm_obj='')
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
const USER_FOLDER_ID
Class ilObjUserFolder.
+ Here is the call graph for this function:

◆ assignDesktopItemObject()

ilObjRoleGUI::assignDesktopItemObject ( )

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

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

412  {
413  global $rbacsystem;
414 
415  if (!$rbacsystem->checkAccess('push_desktop_items',USER_FOLDER_ID))
416  {
417  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
418  return false;
419  }
420 
421 
422  if (!isset($_GET['item_id']))
423  {
424  ilUtil::sendFailure($this->lng->txt('role_no_item_selected'));
425  $this->selectDesktopItemObject();
426 
427  return false;
428  }
429 
430  include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
431 
432  $role_desk_item_obj =& new ilRoleDesktopItem($this->object->getId());
433  $role_desk_item_obj->add((int) $_GET['item_id'],ilObject::_lookupType((int) $_GET['item_id'],true));
434 
435  ilUtil::sendSuccess($this->lng->txt('role_assigned_desktop_item'));
436 
437  $this->ctrl->redirect($this,'listDesktopItems');
438  return true;
439  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
add($a_item_id, $a_item_type)
Class ilObjRoleGUI.
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const USER_FOLDER_ID
Class ilObjUserFolder.
+ Here is the call graph for this function:

◆ assignSaveObject()

ilObjRoleGUI::assignSaveObject ( )

wrapper for renamed function

public

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

1187  {
1188  $this->assignUserObject();
1189  }

◆ cancelObject()

ilObjRoleGUI::cancelObject ( )

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

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

References $_GET.

1405  {
1406  if ($_GET["new_type"] != "role")
1407  {
1408  $this->ctrl->redirect($this, "userassignment");
1409  }
1410  else
1411  {
1412  $this->ctrl->redirectByClass("ilobjrolefoldergui","view");
1413  }
1414  }
$_GET["client_id"]

◆ changeExistingObjectsObject()

ilObjRoleGUI::changeExistingObjectsObject ( )
protected

Change existing objects.

Returns

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

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

1826  {
1827  global $tree,$rbacreview,$rbacadmin;
1828 
1829  $mode = (int) $_POST['mode'];
1830  $start = ($this->rolf_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $tree->getParentId($this->rolf_ref_id));
1831  $this->object->changeExistingObjects($start,$mode,unserialize(ilUtil::stripSlashes($_POST['type_filter'])));
1832 
1833  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1834  $this->ctrl->redirect($this,'perm');
1835  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ checkAccess()

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

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

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

1709  {
1710  global $rbacsystem,$ilAccess;
1711 
1712  $a_perm_obj = $a_perm_obj ? $a_perm_obj : $a_perm_global;
1713 
1714  if($this->rolf_ref_id == ROLE_FOLDER_ID)
1715  {
1716  return $rbacsystem->checkAccess($a_perm_global,$this->rolf_ref_id);
1717  }
1718  else
1719  {
1720  return $ilAccess->checkAccess($a_perm_obj,'',$this->obj_ref_id);
1721  }
1722  }
+ 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 654 of file class.ilObjRoleGUI.php.

Referenced by saveObject(), and updateObject().

655  {
656  // disabled due to mantis #0013742: Renaming global roles: ILIAS denies if title fits other role title partially
657  return FALSE;
658  }
+ Here is the caller graph for this function:

◆ confirmDeleteRoleObject()

ilObjRoleGUI::confirmDeleteRoleObject ( )
protected

Show delete confirmation screen.

Returns

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

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

925  {
926  global $ilErr,$rbacreview,$ilUser;
927 
928  $access = $this->checkAccess('visible,write','edit_permission');
929  if (!$access)
930  {
931  $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'),$ilErr->WARNING);
932  }
933 
934  $question = $this->lng->txt('rbac_role_delete_qst');
935  if($rbacreview->isAssigned($ilUser->getId(), $this->object->getId()))
936  {
937  $question .= ('<br />'.$this->lng->txt('rbac_role_delete_self'));
938  }
939  ilUtil::sendQuestion($question);
940 
941  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
942 
943  $confirm = new ilConfirmationGUI();
944  $confirm->setFormAction($this->ctrl->getFormAction($this));
945  $confirm->setHeaderText($question);
946  $confirm->setCancel($this->lng->txt('cancel'), 'perm');
947  $confirm->setConfirm($this->lng->txt('rbac_delete_role'), 'performDeleteRole');
948 
949  $confirm->addItem(
950  'role',
951  $this->object->getId(),
952  $this->object->getTitle(),
953  ilUtil::getImagePath('icon_role.png')
954  );
955 
956  $this->tpl->setContent($confirm->getHTML());
957  return true;
958  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
checkAccess($a_perm_global, $a_perm_obj='')
global $ilUser
Definition: imgupload.php:15
Confirmation screen class.
+ Here is the call graph for this function:

◆ createObject()

ilObjRoleGUI::createObject ( )

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

Returns

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

References $ilErr, and initFormRoleProperties().

589  {
590  global $rbacsystem;
591 
592  if(!$rbacsystem->checkAccess('create_role',$this->rolf_ref_id))
593  {
594  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
595  }
596 
597  $this->initFormRoleProperties(self::MODE_GLOBAL_CREATE);
598  $this->tpl->setContent($this->form->getHTML());
599  }
initFormRoleProperties($a_mode)
Create role prperty form.
+ Here is the call graph for this function:

◆ deassignUserObject()

ilObjRoleGUI::deassignUserObject ( )

de-assign users from role

public

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

References $_GET, $_POST, checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

1251  {
1252  global $rbacsystem, $rbacadmin, $rbacreview;
1253 
1254  #if (!$rbacsystem->checkAccess("edit_userassignment", $this->rolf_ref_id))
1255  if(!$this->checkAccess('edit_userassignment','edit_permission'))
1256  {
1257  $this->ilias->raiseError($this->lng->txt("msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1258  }
1259 
1260  $selected_users = ($_POST["user_id"]) ? $_POST["user_id"] : array($_GET["user_id"]);
1261 
1262  if ($selected_users[0]=== NULL)
1263  {
1264  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1265  }
1266 
1267  // prevent unassignment of system user from system role
1268  if ($this->object->getId() == SYSTEM_ROLE_ID)
1269  {
1270  if ($admin = array_search(SYSTEM_USER_ID,$selected_users) !== false)
1271  unset($selected_users[$admin]);
1272  }
1273 
1274  // check for each user if the current role is his last global role before deassigning him
1275  $last_role = array();
1276  $global_roles = $rbacreview->getGlobalRoles();
1277 
1278  foreach ($selected_users as $user)
1279  {
1280  $assigned_roles = $rbacreview->assignedRoles($user);
1281  $assigned_global_roles = array_intersect($assigned_roles,$global_roles);
1282 
1283  if (count($assigned_roles) == 1 or (count($assigned_global_roles) == 1 and in_array($this->object->getId(),$assigned_global_roles)))
1284  {
1285  $userObj = $this->ilias->obj_factory->getInstanceByObjId($user);
1286  $last_role[$user] = $userObj->getFullName();
1287  unset($userObj);
1288  }
1289  }
1290 
1291 
1292  // ... else perform deassignment
1293  foreach ($selected_users as $user)
1294  {
1295  if(!isset($last_role[$user]))
1296  {
1297  $rbacadmin->deassignUser($this->object->getId(), $user);
1298  }
1299  }
1300 
1301  // update object data entry (to update last modification date)
1302  $this->object->update();
1303 
1304  // raise error if last role was taken from a user...
1305  if(count($last_role))
1306  {
1307  $user_list = implode(", ",$last_role);
1308  ilUtil::sendFailure($this->lng->txt('msg_is_last_role').': '.$user_list.'<br />'.$this->lng->txt('msg_min_one_role'),true);
1309  }
1310  else
1311  {
1312  ilUtil::sendSuccess($this->lng->txt("msg_userassignment_changed"), true);
1313  }
1314  $this->ctrl->redirect($this,'userassignment');
1315  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkAccess($a_perm_global, $a_perm_obj='')
+ Here is the call graph for this function:

◆ deleteDesktopItemsObject()

ilObjRoleGUI::deleteDesktopItemsObject ( )

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

References $_SESSION, checkAccess(), ilRoleDesktopItem\delete(), listDesktopItemsObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and USER_FOLDER_ID.

338  {
339  global $rbacsystem;
340 
341  #if (!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
342  if(!$this->checkAccess('edit_permission'))
343  {
344  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
345  }
346 
347  if (!$rbacsystem->checkAccess('push_desktop_items',USER_FOLDER_ID))
348  {
349  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
350  }
351 
352  if (!count($_SESSION['role_del_desk_items']))
353  {
354  ilUtil::sendFailure($this->lng->txt('role_select_one_item'));
355 
356  $this->listDesktopItemsObject();
357 
358  return true;
359  }
360 
361  include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
362 
363  $role_desk_item_obj =& new ilRoleDesktopItem($this->object->getId());
364 
365  foreach ($_SESSION['role_del_desk_items'] as $role_item_id)
366  {
367  $role_desk_item_obj->delete($role_item_id);
368  }
369 
370  ilUtil::sendSuccess($this->lng->txt('role_deleted_desktop_items'));
371  $this->listDesktopItemsObject();
372 
373  return true;
374  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilObjRoleGUI.
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkAccess($a_perm_global, $a_perm_obj='')
const USER_FOLDER_ID
Class ilObjUserFolder.
+ Here is the call graph for this function:

◆ editObject()

ilObjRoleGUI::editObject ( )

Edit role properties.

Returns

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

References $ilErr, $ilSetting, checkAccess(), initFormRoleProperties(), and readRoleProperties().

606  {
607  global $rbacsystem, $rbacreview, $ilSetting,$ilErr;
608 
609  if(!$this->checkAccess('write','edit_permission'))
610  {
611  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
612  }
613  $this->initFormRoleProperties(self::MODE_GLOBAL_UPDATE);
614  $this->readRoleProperties($this->object);
615  $this->tpl->setContent($this->form->getHTML());
616  }
initFormRoleProperties($a_mode)
Create role prperty form.
readRoleProperties(ilObjRole $role)
Read role properties and write them to form.
checkAccess($a_perm_global, $a_perm_obj='')
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ executeCommand()

& ilObjRoleGUI::executeCommand ( )

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

References $cmd, $ret, $rolf_ref_id, ilExportOptions\allocateExportId(), ilExportOptions\KEY_ROOT, ilExportOptions\newInstance(), ilObjectGUI\prepareOutput(), and showDefaultPermissionSettings().

83  {
84  global $rbacsystem;
85 
86  $this->prepareOutput();
87 
88  $next_class = $this->ctrl->getNextClass($this);
89  $cmd = $this->ctrl->getCmd();
90 
91  switch($next_class)
92  {
93  case 'ilrepositorysearchgui':
94  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
95  $rep_search =& new ilRepositorySearchGUI();
96  $rep_search->setTitle($this->lng->txt('role_add_user'));
97  $rep_search->setCallback($this,'addUserObject');
98 
99  // Set tabs
100  $this->tabs_gui->setTabActive('user_assignment');
101  $this->ctrl->setReturn($this,'userassignment');
102  $ret =& $this->ctrl->forwardCommand($rep_search);
103  break;
104 
105  case 'ilexportgui':
106 
107  $this->tabs_gui->setTabActive('export');
108 
109  include_once './Services/Export/classes/class.ilExportOptions.php';
111  $eo->addOption(ilExportOptions::KEY_ROOT,0,$this->object->getId(),$this->rolf_ref_id);
112 
113  include_once './Services/Export/classes/class.ilExportGUI.php';
114  $exp = new ilExportGUI($this, new ilObjRole($this->object->getId()));
115  $exp->addFormat('xml');
116  $this->ctrl->forwardCommand($exp);
117  break;
118 
119  default:
120  if(!$cmd)
121  {
122  if($this->showDefaultPermissionSettings())
123  {
124  $cmd = "perm";
125  }
126  else
127  {
128  $cmd = 'userassignment';
129  }
130  }
131  $cmd .= "Object";
132  $this->$cmd();
133 
134  break;
135  }
136 
137  return true;
138  }
Class ilObjRole.
$cmd
Definition: sahs_server.php:35
Export User Interface Class.
static newInstance($a_export_id)
Create new instance.
showDefaultPermissionSettings()
check if default permissions are shown or not
prepareOutput()
prepare output
static allocateExportId()
Allocate a new export id.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjRoleGUI::getAdminTabs ( $tabs_gui)

admin and normal tabs are equal for roles

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

References getTabs().

185  {
186  $this->getTabs($tabs_gui);
187  }
+ Here is the call graph for this function:

◆ getBackTarget()

ilObjRoleGUI::getBackTarget ( )

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

177  {
178  return $this->back_target ? $this->back_target : array();
179  }

◆ getContainerType()

ilObjRoleGUI::getContainerType ( )
protected

Get type of role container.

Returns

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

References $container_type.

Referenced by showDefaultPermissionSettings().

194  {
195  return $this->container_type;
196  }
+ Here is the caller graph for this function:

◆ getParentObjId()

ilObjRoleGUI::getParentObjId ( )

Get obj_id of current object.

Returns

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

References $obj_obj_id.

Referenced by __construct().

154  {
155  return $this->obj_obj_id;
156  }
+ 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 144 of file class.ilObjRoleGUI.php.

References $obj_ref_id.

Referenced by __construct(), and permObject().

145  {
146  return $this->obj_ref_id;
147  }
+ Here is the caller graph for this function:

◆ getParentType()

ilObjRoleGUI::getParentType ( )

get type of current object (not role folder)

Returns

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

References $obj_obj_type.

Referenced by permObject(), and permSaveObject().

163  {
164  return $this->obj_obj_type;
165  }
+ Here is the caller graph for this function:

◆ getTabs()

ilObjRoleGUI::getTabs ( $tabs_gui)

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

References $_GET, checkAccess(), and showDefaultPermissionSettings().

Referenced by __setHeader(), and getAdminTabs().

1607  {
1608  global $rbacsystem,$rbacreview, $ilHelp;
1609 
1610  $base_role_folder = $rbacreview->getFoldersAssignedToRole($this->object->getId(),true);
1611 
1612 //var_dump($base_role_folder);
1613 //echo "-".$this->rolf_ref_id."-";
1614 
1615  $activate_role_edit = false;
1616 
1617  // todo: activate the following (allow editing of local roles in
1618  // roles administration)
1619  //if (in_array($this->rolf_ref_id,$base_role_folder))
1620  if (in_array($this->rolf_ref_id,$base_role_folder) ||
1621  (strtolower($_GET["baseClass"]) == "iladministrationgui" &&
1622  $_GET["admin_mode"] == "settings"))
1623  {
1624  $activate_role_edit = true;
1625  }
1626 
1627  // not so nice (workaround for using tabs in repository)
1628  $tabs_gui->clearTargets();
1629 
1630  $ilHelp->setScreenIdComponent("role");
1631 
1632  if ($this->back_target != "")
1633  {
1634  $tabs_gui->setBackTarget(
1635  $this->back_target["text"],$this->back_target["link"]);
1636  }
1637 
1638  if($this->checkAccess('write','edit_permission') && $activate_role_edit)
1639  {
1640  $tabs_gui->addTarget("edit_properties",
1641  $this->ctrl->getLinkTarget($this, "edit"), array("edit","update"), get_class($this));
1642  }
1643 /*
1644  if($this->checkAccess('write','edit_permission') and $this->showDefaultPermissionSettings())
1645  {
1646  $force_active = ($_GET["cmd"] == "perm" || $_GET["cmd"] == "")
1647  ? true
1648  : false;
1649  $tabs_gui->addTarget("default_perm_settings",
1650  $this->ctrl->getLinkTarget($this, "perm"), array("perm", "adoptPermSave", "permSave"),
1651  get_class($this),
1652  "", $force_active);
1653  }
1654 */
1655  if($this->checkAccess('write','edit_permission') and $this->showDefaultPermissionSettings())
1656  {
1657  $tabs_gui->addTarget(
1658  "default_perm_settings",
1659  $this->ctrl->getLinkTarget($this, "perm"), array(),get_class($this)
1660  );
1661  }
1662 
1663  if($this->checkAccess('write','edit_permission') && $activate_role_edit && $this->object->getId() != ANONYMOUS_ROLE_ID)
1664  {
1665  $tabs_gui->addTarget("user_assignment",
1666  $this->ctrl->getLinkTarget($this, "userassignment"),
1667  array("deassignUser", "userassignment", "assignUser", "searchUserForm", "search"),
1668  get_class($this));
1669  }
1670 
1671  if($this->checkAccess('write','edit_permission') && $activate_role_edit && $this->object->getId() != ANONYMOUS_ROLE_ID)
1672  {
1673  $tabs_gui->addTarget("desktop_items",
1674  $this->ctrl->getLinkTarget($this, "listDesktopItems"),
1675  array("listDesktopItems", "deleteDesktopItems", "selectDesktopItem", "askDeleteDesktopItem"),
1676  get_class($this));
1677  }
1678  if($this->checkAccess('write','edit_permission'))
1679  {
1680  $tabs_gui->addTarget(
1681  'export',
1682  $this->ctrl->getLinkTargetByClass('ilExportGUI'),
1683  array()
1684  );
1685 
1686  }
1687  }
$_GET["client_id"]
showDefaultPermissionSettings()
check if default permissions are shown or not
checkAccess($a_perm_global, $a_perm_obj='')
+ 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 446 of file class.ilObjRoleGUI.php.

References ilDiskQuotaActivationChecker\_isActive(), ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilObjRole\isAutoGenerated(), ilFormPropertyGUI\setDisabled(), ilNumberInputGUI\setMinValue(), and ilCheckboxInputGUI\setValue().

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

447  {
448  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
449  $this->form = new ilPropertyFormGUI();
450 
451  if($this->creation_mode)
452  {
453  $this->ctrl->setParameter($this, "new_type", 'role');
454  }
455  $this->form->setFormAction($this->ctrl->getFormAction($this));
456 
457  switch($a_mode)
458  {
459  case self::MODE_GLOBAL_CREATE:
460  $this->form->setTitle($this->lng->txt('role_new'));
461  $this->form->addCommandButton('save',$this->lng->txt('role_new'));
462  break;
463 
464  case self::MODE_GLOBAL_UPDATE:
465  $this->form->setTitle($this->lng->txt('role_edit'));
466  $this->form->addCommandButton('update', $this->lng->txt('save'));
467  break;
468 
469  case self::MODE_LOCAL_CREATE:
470  case self::MODE_LOCAL_UPDATE:
471  }
472  // Fix cancel
473  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
474 
475  $title = new ilTextInputGUI($this->lng->txt('title'),'title');
476  if(ilObjRole::isAutoGenerated($this->object->getId()))
477  {
478  $title->setDisabled(true);
479  }
480  $title->setValidationRegexp('/^(?!il_).*$/');
481  $title->setValidationFailureMessage($this->lng->txt('msg_role_reserved_prefix'));
482  $title->setSize(40);
483  $title->setMaxLength(70);
484  $title->setRequired(true);
485  $this->form->addItem($title);
486 
487  $desc = new ilTextAreaInputGUI($this->lng->txt('description'),'desc');
488  if(ilObjRole::isAutoGenerated($this->object->getId()))
489  {
490  $desc->setDisabled(true);
491  }
492  $desc->setCols(40);
493  $desc->setRows(3);
494  $this->form->addItem($desc);
495 
496  if($this->rolf_ref_id == ROLE_FOLDER_ID)
497  {
498  $reg = new ilCheckboxInputGUI($this->lng->txt('allow_register'),'reg');
499  $reg->setValue(1);
500  #$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info'));
501  $this->form->addItem($reg);
502 
503  $la = new ilCheckboxInputGUI($this->lng->txt('allow_assign_users'),'la');
504  $la->setValue(1);
505  #$la->setInfo($this->lng->txt('rbac_local_admin_info'));
506  $this->form->addItem($la);
507  }
508 
509  $pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'),'pro');
510  $pro->setValue(1);
511  #$pro->setInfo($this->lng->txt('role_protext_permission_info'));
512  $this->form->addItem($pro);
513 
514  include_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
516  {
517  $quo = new ilNumberInputGUI($this->lng->txt('disk_quota'),'disk_quota');
518  $quo->setMinValue(0);
519  $quo->setSize(4);
520  $quo->setInfo($this->lng->txt('enter_in_mb_desc').'<br />'.$this->lng->txt('disk_quota_on_role_desc'));
521  $this->form->addItem($quo);
522  }
524  {
525  $this->lng->loadLanguageModule("file");
526  $wquo = new ilNumberInputGUI($this->lng->txt('personal_workspace_disk_quota'),'wsp_disk_quota');
527  $wquo->setMinValue(0);
528  $wquo->setSize(4);
529  $wquo->setInfo($this->lng->txt('enter_in_mb_desc').'<br />'.$this->lng->txt('disk_quota_on_role_desc'));
530  $this->form->addItem($wquo);
531  }
532 
533  return true;
534  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
static isAutoGenerated($a_role_id)
This class represents a number property in a property form.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
This class represents a text area property in a property form.
setDisabled($a_disabled)
Set Disabled.
setMinValue($a_minvalue)
Set Minimum Value.
+ 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 1728 of file class.ilObjRoleGUI.php.

References $_POST.

Referenced by permSaveObject().

1729  {
1730  global $rbacreview;
1731 
1732  if(!(int) $_POST['recursive'] and !is_array($_POST['recursive_list']))
1733  {
1734  return false;
1735  }
1736 
1737  // Role is protected
1738  if($rbacreview->isProtected($this->rolf_ref_id, $this->object->getId()))
1739  {
1740  // TODO: check if recursive_list is enabled
1741  // and if yes: check if inheritance is broken for the relevant object types
1742  return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
1743  }
1744  else
1745  {
1746  // TODO: check if recursive_list is enabled
1747  // and if yes: check if inheritance is broken for the relevant object types
1748  return count($rbacreview->getFoldersAssignedToRole($this->object->getId())) > 1;
1749  }
1750  }
$_POST['username']
Definition: cron.php:12
+ Here is the caller graph for this function:

◆ listDesktopItemsObject()

ilObjRoleGUI::listDesktopItemsObject ( )

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

References $rolf_ref_id, ilObjectGUI\$tree, __formatPath(), ilObjectGUI\__showButton(), ilUtil\getImagePath(), ilObjectFactory\getInstanceByRefId(), ilUtil\sendInfo(), ilUtil\switchColor(), and USER_FOLDER_ID.

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

211  {
212  global $rbacsystem,$rbacreview,$tree;
213 
214 
215  #if(!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
216  /*
217  if(!$this->checkAccess('edit_permission'))
218  {
219  ilUtil::sendFailure()
220  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
221  }
222  */
223  if(!$rbacreview->isAssignable($this->object->getId(),$this->rolf_ref_id) &&
224  $this->rolf_ref_id != ROLE_FOLDER_ID)
225  {
226  ilUtil::sendInfo($this->lng->txt('role_no_users_no_desk_items'));
227  return true;
228  }
229 
230 
231  include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
232  $role_desk_item_obj =& new ilRoleDesktopItem($this->object->getId());
233 
234  if($rbacsystem->checkAccess('push_desktop_items',USER_FOLDER_ID))
235  {
236  $this->__showButton('selectDesktopItem',$this->lng->txt('role_desk_add'));
237  }
238  if(!count($items = $role_desk_item_obj->getAll()))
239  {
240  ilUtil::sendInfo($this->lng->txt('role_desk_none_created'));
241  return true;
242  }
243  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.role_desktop_item_list.html", "Services/AccessControl");
244  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
245  $this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath('icon_role.png'));
246  $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt('obj_role'));
247  $this->tpl->setVariable("TBL_TITLE",$this->lng->txt('role_assigned_desk_items').' ('.$this->object->getTitle().')');
248  $this->tpl->setVariable("HEADER_DESC",$this->lng->txt('description'));
249  $this->tpl->setVariable("BTN_DELETE",$this->lng->txt('delete'));
250  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.png'));
251 
252  $counter = 0;
253 
254  foreach($items as $role_item_id => $item)
255  {
256  $tmp_obj = ilObjectFactory::getInstanceByRefId($item['item_id']);
257 
258  if(strlen($desc = $tmp_obj->getDescription()))
259  {
260  $this->tpl->setCurrentBlock("description");
261  $this->tpl->setVariable("DESCRIPTION_DESK",$desc);
262  $this->tpl->parseCurrentBlock();
263  }
264  $this->tpl->setCurrentBlock("desk_row");
265  $this->tpl->setVariable("DESK_TITLE",$tmp_obj->getTitle());
266  $this->tpl->setVariable("ROW_CLASS",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
267  $this->tpl->setVariable("CHECK_DESK",ilUtil::formCheckBox(0,'del_desk_item[]',$role_item_id));
268  $this->tpl->setVariable("TXT_PATH",$this->lng->txt('path').':');
269  $this->tpl->setVariable("PATH",$this->__formatPath($tree->getPathFull($item['item_id'])));
270  $this->tpl->parseCurrentBlock();
271  }
272 
273  return true;
274  }
Class ilObjRoleGUI.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
__showButton($a_cmd, $a_text, $a_target='')
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
const USER_FOLDER_ID
Class ilObjUserFolder.
__formatPath($a_path_arr)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listUsersRoleObject()

ilObjRoleGUI::listUsersRoleObject ( )

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

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

1418  {
1419  global $rbacsystem,$rbacreview;
1420 
1421  $_SESSION["role_role"] = $_POST["role"] = $_POST["role"] ? $_POST["role"] : $_SESSION["role_role"];
1422 
1423  if (!is_array($_POST["role"]))
1424  {
1425  ilUtil::sendFailure($this->lng->txt("role_no_roles_selected"));
1426  $this->searchObject();
1427 
1428  return false;
1429  }
1430 
1431  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.role_usr_selection.html", "Services/AccessControl");
1432  $this->__showButton("searchUserForm",$this->lng->txt("role_new_search"));
1433 
1434  // GET ALL MEMBERS
1435  $members = array();
1436 
1437  foreach ($_POST["role"] as $role_id)
1438  {
1439  $members = array_merge($rbacreview->assignedUsers($role_id),$members);
1440  }
1441 
1442  $members = array_unique($members);
1443 
1444  // FORMAT USER DATA
1445  $counter = 0;
1446  $f_result = array();
1447 
1448  foreach($members as $user)
1449  {
1450  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user,false))
1451  {
1452  continue;
1453  }
1454 
1455  $user_ids[$counter] = $user;
1456 
1457  // TODO: exclude anonymous user
1458  $f_result[$counter][] = ilUtil::formCheckbox(0,"user[]",$user);
1459  $f_result[$counter][] = $tmp_obj->getLogin();
1460  $f_result[$counter][] = $tmp_obj->getFirstname();
1461  $f_result[$counter][] = $tmp_obj->getLastname();
1462 
1463  unset($tmp_obj);
1464  ++$counter;
1465  }
1466 
1467  $this->__showSearchUserTable($f_result,$user_ids,"listUsersRole");
1468 
1469  return true;
1470  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
__showButton($a_cmd, $a_text, $a_target='')
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ 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 541 of file class.ilObjRoleGUI.php.

References ilFormat\_getSizeMagnitude(), ilObjRole\setAllowRegister(), ilObject\setDescription(), ilObjRole\setDiskQuota(), ilObjRole\setPersonalWorkspaceDiskQuota(), ilObject\setTitle(), and ilObjRole\toggleAssignUsersStatus().

Referenced by saveObject(), and updateObject().

542  {
543  $role->setTitle($this->form->getInput('title'));
544  $role->setDescription($this->form->getInput('desc'));
545  $role->setAllowRegister($this->form->getInput('reg'));
546  $role->toggleAssignUsersStatus($this->form->getInput('la'));
547  $role->setDiskQuota($this->form->getInput('disk_quota') * pow(ilFormat::_getSizeMagnitude(),2));
548  $role->setPersonalWorkspaceDiskQuota($this->form->getInput('wsp_disk_quota') * pow(ilFormat::_getSizeMagnitude(),2));
549  return true;
550  }
toggleAssignUsersStatus($a_assign_users)
setAllowRegister($a_allow_register)
set allow_register of role
setTitle($a_title)
set object title
setPersonalWorkspaceDiskQuota($a_disk_quota)
Sets the minimal personal workspace disk quota imposed by this role.
static _getSizeMagnitude()
Returns the magnitude used for size units.
setDescription($a_desc)
set object description
setDiskQuota($a_disk_quota)
Sets the minimal disk quota imposed by this role.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mailToRoleObject()

ilObjRoleGUI::mailToRoleObject ( )

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

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

1690  {
1691  global $rbacreview;
1692 
1693  $obj_ids = ilObject::_getIdsForTitle($this->object->getTitle(), $this->object->getType());
1694  if(count($obj_ids) > 1)
1695  {
1696  $_SESSION['mail_roles'][] = '#il_role_'.$this->object->getId();
1697  }
1698  else
1699  {
1700  $_SESSION['mail_roles'][] = $rbacreview->getRoleMailboxAddress($this->object->getId());
1701  }
1702 
1703  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
1704  $script = ilMailFormCall::getRedirectTarget($this, 'userassignment', array(), array('type' => 'role'));
1705  ilUtil::redirect($script);
1706  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static getRedirectTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array())
static _getIdsForTitle($title, $type='', $partialmatch=false)
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ performDeleteRoleObject()

ilObjRoleGUI::performDeleteRoleObject ( )
protected

Delete role.

Returns

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

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

966  {
967  global $ilErr;
968 
969  $access = $this->checkAccess('visible,write','edit_permission');
970  if (!$access)
971  {
972  $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'),$ilErr->WARNING);
973  }
974 
975  $this->object->setParent((int) $_GET['rolf_ref_id']);
976  $this->object->delete();
977  ilUtil::sendSuccess($this->lng->txt('msg_deleted_role'),true);
978 
979  $this->ctrl->returnToParent($this);
980  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
checkAccess($a_perm_global, $a_perm_obj='')
+ 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 693 of file class.ilObjRoleGUI.php.

References $ilErr, ilObjectGUI\$objDefinition, $options, $rolf_ref_id, checkAccess(), ilAccordionGUI\FORCE_ALL_OPEN, getParentRefId(), getParentType(), ilPlugin\lookupTxt(), ilObjectRoleTemplatePermissionTableGUI\parse(), setSubTabs(), and ilUtil\sortArray().

Referenced by adminPermObject().

694  {
695  global $ilTabs, $ilErr, $ilToolbar, $objDefinition,$rbacreview;
696 
697  $ilTabs->setTabActive('default_perm_settings');
698 
699  $this->setSubTabs('default_perm_settings');
700 
701  if($a_show_admin_permissions)
702  {
703  $ilTabs->setSubTabActive('rbac_admin_permissions');
704  }
705  else
706  {
707  $ilTabs->setSubTabActive('rbac_repository_permissions');
708  }
709 
710  if(!$this->checkAccess('write','edit_permission'))
711  {
712  $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'),$ilErr->MESSAGE);
713  return true;
714  }
715 
716  // Show copy role button
717  if($this->object->getId() != SYSTEM_ROLE_ID)
718  {
719  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
720  $ilToolbar->addButton(
721  $this->lng->txt("adopt_perm_from_template"),
722  $this->ctrl->getLinkTarget($this,'adoptPerm')
723  );
724  if($rbacreview->isDeleteable($this->object->getId(), $this->rolf_ref_id))
725  {
726  $ilToolbar->addButton(
727  $this->lng->txt('rbac_delete_role'),
728  $this->ctrl->getLinkTarget($this,'confirmDeleteRole')
729  );
730  }
731  }
732 
733  $this->tpl->addBlockFile(
734  'ADM_CONTENT',
735  'adm_content',
736  'tpl.rbac_template_permissions.html',
737  'Services/AccessControl'
738  );
739 
740  $this->tpl->setVariable('PERM_ACTION',$this->ctrl->getFormAction($this));
741 
742  include_once './Services/Accordion/classes/class.ilAccordionGUI.php';
743  $acc = new ilAccordionGUI();
744  $acc->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN);
745  $acc->setId('template_perm_'.$this->getParentRefId());
746 
747  if($this->rolf_ref_id == ROLE_FOLDER_ID)
748  {
749  if($a_show_admin_permissions)
750  {
751  $subs = $objDefinition->getSubObjectsRecursively('adm',true,true);
752  }
753  else
754  {
755  $subs = $objDefinition->getSubObjectsRecursively('root',true,$a_show_admin_permissions);
756  }
757  }
758  else
759  {
760  $subs = $objDefinition->getSubObjectsRecursively($this->getParentType(),true,$a_show_admin_permissions);
761  }
762 
763  $sorted = array();
764  foreach($subs as $subtype => $def)
765  {
766  if($objDefinition->isPlugin($subtype))
767  {
768  $translation = ilPlugin::lookupTxt("rep_robj", $subtype,"obj_".$subtype);
769  }
770  elseif($objDefinition->isSystemObject($subtype))
771  {
772  $translation = $this->lng->txt("obj_".$subtype);
773  }
774  else
775  {
776  $translation = $this->lng->txt('objs_'.$subtype);
777  }
778 
779  $sorted[$subtype] = $def;
780  $sorted[$subtype]['translation'] = $translation;
781  }
782 
783 
784  $sorted = ilUtil::sortArray($sorted, 'translation','asc',true,true);
785  foreach($sorted as $subtype => $def)
786  {
787  if($objDefinition->isPlugin($subtype))
788  {
789  $translation = ilPlugin::lookupTxt("rep_robj", $subtype,"obj_".$subtype);
790  }
791  elseif($objDefinition->isSystemObject($subtype))
792  {
793  $translation = $this->lng->txt("obj_".$subtype);
794  }
795  else
796  {
797  $translation = $this->lng->txt('objs_'.$subtype);
798  }
799 
800  include_once 'Services/AccessControl/classes/class.ilObjectRoleTemplatePermissionTableGUI.php';
802  $this,
803  'perm',
804  $this->getParentRefId(),
805  $this->object->getId(),
806  $subtype,
807  $a_show_admin_permissions
808  );
809  $tbl->parse();
810 
811  $acc->addItem($translation, $tbl->getHTML());
812  }
813 
814  $this->tpl->setVariable('ACCORDION',$acc->getHTML());
815 
816  // Add options table
817  include_once './Services/AccessControl/classes/class.ilObjectRoleTemplateOptionsTableGUI.php';
819  $this,
820  'perm',
821  $this->rolf_ref_id,
822  $this->object->getId(),
823  $a_show_admin_permissions
824  );
825  if($this->object->getId() != SYSTEM_ROLE_ID)
826  {
827  $options->addMultiCommand(
828  $a_show_admin_permissions ? 'adminPermSave' : 'permSave',
829  $this->lng->txt('save')
830  );
831  }
832 
833  $options->parse();
834  $this->tpl->setVariable('OPTIONS_TABLE',$options->getHTML());
835  }
setSubTabs($a_tab)
Set sub tabs.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
if(!is_array($argv)) $options
getParentType()
get type of current object (not role folder)
checkAccess($a_perm_global, $a_perm_obj='')
getParentRefId()
Get ref id of current object (not role folder id)
Accordion user interface class.
+ 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

public

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

References $_POST, ilObjectGUI\$objDefinition, $rolf_ref_id, 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().

988  {
989  global $rbacsystem, $rbacadmin, $rbacreview, $objDefinition, $tree;
990 
991  // for role administration check write of global role folder
992  /*
993  if ($this->rolf_ref_id == ROLE_FOLDER_ID)
994  {
995  $access = $rbacsystem->checkAccess('write',$this->rolf_ref_id);
996  }
997  else // for local roles check 'edit permission' of parent object of the local role folder
998  {
999  $access = $rbacsystem->checkAccess('edit_permission',$tree->getParentId($this->rolf_ref_id));
1000  }
1001  */
1002  $access = $this->checkAccess('visible,write','edit_permission');
1003 
1004  if (!$access)
1005  {
1006  $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->MESSAGE);
1007  }
1008 
1009  // rbac log
1010  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
1011  $rbac_log_active = ilRbacLog::isActive();
1012  if($rbac_log_active)
1013  {
1014  $rbac_log_old = ilRbacLog::gatherTemplate($this->rolf_ref_id, $this->object->getId());
1015  }
1016 
1017  // delete all template entries of enabled types
1018  if($this->rolf_ref_id == ROLE_FOLDER_ID)
1019  {
1020  if($a_show_admin_permissions)
1021  {
1022  $subs = $objDefinition->getSubObjectsRecursively('adm',true,true);
1023  }
1024  else
1025  {
1026  $subs = $objDefinition->getSubObjectsRecursively('root',true,false);
1027  }
1028  }
1029  else
1030  {
1031  $subs = $objDefinition->getSubObjectsRecursively($this->getParentType(),true,false);
1032  }
1033 
1034  foreach($subs as $subtype => $def)
1035  {
1036  // Delete per object type
1037  $rbacadmin->deleteRolePermission($this->object->getId(),$this->rolf_ref_id,$subtype);
1038  }
1039 
1040  if (empty($_POST["template_perm"]))
1041  {
1042  $_POST["template_perm"] = array();
1043  }
1044 
1045  foreach ($_POST["template_perm"] as $key => $ops_array)
1046  {
1047  // sets new template permissions
1048  $rbacadmin->setRolePermission($this->object->getId(), $key, $ops_array, $this->rolf_ref_id);
1049  }
1050 
1051  if($rbac_log_active)
1052  {
1053  $rbac_log_new = ilRbacLog::gatherTemplate($this->rolf_ref_id, $this->object->getId());
1054  $rbac_log_diff = ilRbacLog::diffTemplate($rbac_log_old, $rbac_log_new);
1055  ilRbacLog::add(ilRbacLog::EDIT_TEMPLATE, $this->obj_ref_id, $rbac_log_diff);
1056  }
1057 
1058  // update object data entry (to update last modification date)
1059  $this->object->update();
1060 
1061  // set protected flag
1062  if ($this->rolf_ref_id == ROLE_FOLDER_ID or $rbacreview->isAssignable($this->object->getId(),$this->rolf_ref_id))
1063  {
1064  $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),ilUtil::tf2yn($_POST['protected']));
1065  }
1066 
1067  if($a_show_admin_permissions)
1068  {
1069  $_POST['recursive'] = true;
1070  }
1071 
1072  // Redirect if Change existing objects is not chosen
1073  if(!$_POST['recursive'] and !is_array($_POST['recursive_list']))
1074  {
1075  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
1076  if($a_show_admin_permissions)
1077  {
1078  $this->ctrl->redirect($this,'adminPerm');
1079  }
1080  else
1081  {
1082  $this->ctrl->redirect($this,'perm');
1083  }
1084  }
1085  // New implementation
1086  if($this->isChangeExistingObjectsConfirmationRequired() and !$a_show_admin_permissions)
1087  {
1089  return true;
1090  }
1091 
1092  $start = ($this->rolf_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $tree->getParentId($this->rolf_ref_id));
1093  if($a_show_admin_permissions)
1094  {
1095  $start = $tree->getParentId($this->rolf_ref_id);
1096  }
1097 
1098  if($_POST['protected'])
1099  {
1100  $this->object->changeExistingObjects(
1101  $start,
1103  array('all'),
1104  array()
1105  #$a_show_admin_permissions ? array('adm') : array()
1106  );
1107  }
1108  else
1109  {
1110  $this->object->changeExistingObjects(
1111  $start,
1113  array('all'),
1114  array()
1115  #$a_show_admin_permissions ? array('adm') : array()
1116  );
1117  }
1118  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
1119 
1120  if($a_show_admin_permissions)
1121  {
1122  $this->ctrl->redirect($this,'adminPerm');
1123  }
1124  else
1125  {
1126  $this->ctrl->redirect($this,'perm');
1127  }
1128  return true;
1129  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static tf2yn($a_tf)
convert true/false to "y"/"n"
$_POST['username']
Definition: cron.php:12
static gatherTemplate($a_role_folder_ref_id, $a_role_id)
static isActive()
const MODE_PROTECTED_KEEP_LOCAL_POLICIES
isChangeExistingObjectsConfirmationRequired()
Check if a confirmation about further settings is required or not.
getParentType()
get type of current object (not role folder)
redirection script todo: (a better solution should control the processing via a xml file) ...
showChangeExistingObjectsConfirmation()
Show confirmation screen.
checkAccess($a_perm_global, $a_perm_obj='')
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
static diffTemplate(array $a_old, array $a_new)
const EDIT_TEMPLATE
+ 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 557 of file class.ilObjRoleGUI.php.

References ilObjectGUI\$data, ilFormat\_getSizeMagnitude(), ilDiskQuotaActivationChecker\_isActive(), ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilObjRole\getAllowRegister(), ilObjRole\getAssignUsersStatus(), ilObject\getDescription(), ilObjRole\getDiskQuota(), ilObject\getId(), ilObjRole\getPersonalWorkspaceDiskQuota(), and ilObject\getTitle().

Referenced by editObject().

558  {
559  global $rbacreview;
560 
561  include_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
562 
563  $data['title'] = $role->getTitle();
564  $data['desc'] = $role->getDescription();
565  $data['reg'] = $role->getAllowRegister();
566  $data['la'] = $role->getAssignUsersStatus();
568  {
569  $data['disk_quota'] = $role->getDiskQuota() / (pow(ilFormat::_getSizeMagnitude(),2));
570  }
572  {
573  $data['wsp_disk_quota'] = $role->getPersonalWorkspaceDiskQuota() / (pow(ilFormat::_getSizeMagnitude(),2));
574  }
575  $data['pro'] = $rbacreview->isProtected($this->rolf_ref_id, $role->getId());
576 
577  $this->form->setValuesByArray($data);
578  }
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.
getId()
get object id public
getTitle()
get object title public
getDescription()
get object description
static _getSizeMagnitude()
Returns the magnitude used for size units.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilObjRoleGUI::saveObject ( )

Save new role.

Returns

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

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

624  {
625  global $rbacadmin,$rbacreview;
626 
627  $this->initFormRoleProperties(self::MODE_GLOBAL_CREATE);
628  if($this->form->checkInput() and !$this->checkDuplicate())
629  {
630  include_once './Services/AccessControl/classes/class.ilObjRole.php';
631  $this->loadRoleProperties($this->role = new ilObjRole());
632  $this->role->create();
633  $rbacadmin->assignRoleToFolder($this->role->getId(), $this->rolf_ref_id,'y');
634  $rbacadmin->setProtected(
635  $this->rolf_ref_id,
636  $this->role->getId(),
637  $this->form->getInput('pro') ? 'y' : 'n'
638  );
639  ilUtil::sendSuccess($this->lng->txt("role_added"),true);
640  $this->ctrl->setParameter($this,'obj_id',$this->role->getId());
641  $this->ctrl->redirect($this,'perm');
642  }
643 
644  ilUtil::sendFailure($this->lng->txt('err_check_input'));
645  $this->form->setValuesByPost();
646  $this->tpl->setContent($this->form->getHTML());
647  return false;
648  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilObjRole.
checkDuplicate($a_role_id=0)
Check if role with same name already exists in this folder.
loadRoleProperties(ilObjRole $role)
Store form input in role object.
initFormRoleProperties($a_mode)
Create role prperty form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ selectDesktopItemObject()

ilObjRoleGUI::selectDesktopItemObject ( )

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

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

Referenced by assignDesktopItemObject().

378  {
379  global $rbacsystem,$tree;
380 
381  include_once 'Services/AccessControl/classes/class.ilRoleDesktopItemSelector.php';
382  include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
383 
384  if(!$rbacsystem->checkAccess('push_desktop_items',USER_FOLDER_ID))
385  {
386  #$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
387  ilUtil::sendFailure($this->lng->txt('permission_denied'));
388  $this->listDesktopItemsObject();
389  return false;
390  }
391 
392  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.role_desktop_item_selector.html", "Services/AccessControl");
393  $this->__showButton('listDesktopItems',$this->lng->txt('back'));
394 
395  ilUtil::sendInfo($this->lng->txt("role_select_desktop_item"));
396 
397  $exp = new ilRoleDesktopItemSelector($this->ctrl->getLinkTarget($this,'selectDesktopItem'),
398  new ilRoleDesktopItem($this->object->getId()));
399  $exp->setExpand($_GET["role_desk_item_link_expand"] ? $_GET["role_desk_item_link_expand"] : $tree->readRootId());
400  $exp->setExpandTarget($this->ctrl->getLinkTarget($this,'selectDesktopItem'));
401 
402  $exp->setOutput(0);
403 
404  $output = $exp->getOutput();
405  $this->tpl->setVariable("EXPLORER",$output);
406  //$this->tpl->setVariable("EXPLORER", $exp->getOutput());
407 
408  return true;
409  }
Class ilObjRoleGUI.
$_GET["client_id"]
__showButton($a_cmd, $a_text, $a_target='')
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const USER_FOLDER_ID
Class ilObjUserFolder.
+ 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 170 of file class.ilObjRoleGUI.php.

171  {
172  $this->back_target = array("text" => $a_text,
173  "link" => $a_link);
174  }

◆ setSubTabs()

ilObjRoleGUI::setSubTabs (   $a_tab)
protected

Set sub tabs.

Parameters
object$a_tab
Returns

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

Referenced by permObject().

1843  {
1844  global $ilTabs;
1845 
1846  switch($a_tab)
1847  {
1848  case 'default_perm_settings':
1849  if($this->rolf_ref_id != ROLE_FOLDER_ID)
1850  {
1851  return true;
1852  }
1853  $ilTabs->addSubTabTarget(
1854  'rbac_repository_permissions',
1855  $this->ctrl->getLinkTarget($this,'perm')
1856  );
1857  $ilTabs->addSubTabTarget(
1858  'rbac_admin_permissions',
1859  $this->ctrl->getLinkTarget($this,'adminPerm')
1860  );
1861  }
1862  return true;
1863  }
+ Here is the caller graph for this function:

◆ showChangeExistingObjectsConfirmation()

ilObjRoleGUI::showChangeExistingObjectsConfirmation ( )
protected

Show confirmation screen.

Returns

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

References $_POST, ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, ilObjRole\MODE_PROTECTED_KEEP_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES, ilRadioGroupInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by permSaveObject().

1757  {
1758  $protected = $_POST['protected'];
1759 
1760  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1761  $form = new ilPropertyFormGUI();
1762  $form->setFormAction($this->ctrl->getFormAction($this,'changeExistingObjects'));
1763  $form->setTitle($this->lng->txt('rbac_change_existing_confirm_tbl'));
1764 
1765  $form->addCommandButton('changeExistingObjects', $this->lng->txt('change_existing_objects'));
1766  $form->addCommandButton('perm',$this->lng->txt('cancel'));
1767 
1768  $hidden = new ilHiddenInputGUI('type_filter');
1769  $hidden->setValue(
1770  $_POST['recursive'] ?
1771  serialize(array('all')) :
1772  serialize($_POST['recursive_list'])
1773  );
1774  $form->addItem($hidden);
1775 
1776  $rad = new ilRadioGroupInputGUI($this->lng->txt('rbac_local_policies'),'mode');
1777 
1778  if($protected)
1779  {
1781  $keep = new ilRadioOption(
1782  $this->lng->txt('rbac_keep_local_policies'),
1784  $this->lng->txt('rbac_keep_local_policies_info')
1785  );
1786  }
1787  else
1788  {
1790  $keep = new ilRadioOption(
1791  $this->lng->txt('rbac_keep_local_policies'),
1793  $this->lng->txt('rbac_unprotected_keep_local_policies_info')
1794  );
1795 
1796  }
1797  $rad->addOption($keep);
1798 
1799  if($protected)
1800  {
1801  $del = new ilRadioOption(
1802  $this->lng->txt('rbac_delete_local_policies'),
1804  $this->lng->txt('rbac_delete_local_policies_info')
1805  );
1806  }
1807  else
1808  {
1809  $del = new ilRadioOption(
1810  $this->lng->txt('rbac_delete_local_policies'),
1812  $this->lng->txt('rbac_unprotected_delete_local_policies_info')
1813  );
1814  }
1815  $rad->addOption($del);
1816 
1817  $form->addItem($rad);
1818  $this->tpl->setContent($form->getHTML());
1819  }
This class represents an option in a radio group.
$_POST['username']
Definition: cron.php:12
This class represents a property form user interface.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
const MODE_PROTECTED_KEEP_LOCAL_POLICIES
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setValue($a_value)
Set Value.
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDefaultPermissionSettings()

ilObjRoleGUI::showDefaultPermissionSettings ( )
protected

check if default permissions are shown or not

Returns

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

References ilObjectGUI\$objDefinition, and getContainerType().

Referenced by executeCommand(), and getTabs().

203  {
204  global $objDefinition;
205 
206  return $objDefinition->isContainer($this->getContainerType());
207  }
getContainerType()
Get type of role container.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateObject()

ilObjRoleGUI::updateObject ( )

Save role settings.

Returns

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

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

665  {
666  global $rbacadmin;
667 
668  $this->initFormRoleProperties(self::MODE_GLOBAL_UPDATE);
669  if($this->form->checkInput() and !$this->checkDuplicate($this->object->getId()))
670  {
671  include_once './Services/AccessControl/classes/class.ilObjRole.php';
672  $this->loadRoleProperties($this->object);
673  $this->object->update();
674  $rbacadmin->setProtected(
675  $this->rolf_ref_id,
676  $this->object->getId(),
677  $this->form->getInput('pro') ? 'y' : 'n'
678  );
679  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
680  $this->ctrl->redirect($this,'edit');
681  }
682 
683  ilUtil::sendFailure($this->lng->txt('err_check_input'));
684  $this->form->setValuesByPost();
685  $this->tpl->setContent($this->form->getHTML());
686  return false;
687  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkDuplicate($a_role_id=0)
Check if role with same name already exists in this folder.
loadRoleProperties(ilObjRole $role)
Store form input in role object.
initFormRoleProperties($a_mode)
Create role prperty form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ userassignmentObject()

ilObjRoleGUI::userassignmentObject ( )

display user assignment panel

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

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

1322  {
1323  global $rbacreview, $rbacsystem, $lng, $ilUser;
1324 
1325  //if (!$rbacsystem->checkAccess("edit_userassignment", $this->rolf_ref_id))
1326  if(!$this->checkAccess('edit_userassignment','edit_permission'))
1327  {
1328  $this->ilias->raiseError($this->lng->txt("msg_no_perm_assign_user_to_role"),$this->ilias->error_obj->MESSAGE);
1329  }
1330 
1331  $this->tabs_gui->setTabActive('user_assignment');
1332 
1333  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.rbac_ua.html','Services/AccessControl');
1334 
1335  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1336  $tb = new ilToolbarGUI();
1337 
1338  // protected admin role
1339  include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
1340  if(
1341  $this->object->getId() != SYSTEM_ROLE_ID ||
1342  (
1343  !$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID) or
1344  !ilSecuritySettings::_getInstance()->isAdminRoleProtected()
1345  )
1346  )
1347  {
1348 
1349 
1350  // add member
1351  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
1353  $this,
1354  $tb,
1355  array(
1356  'auto_complete_name' => $lng->txt('user'),
1357  'submit_name' => $lng->txt('add')
1358  )
1359  );
1360 
1361  /*
1362  // add button
1363  $tb->addFormButton($lng->txt("add"), "assignUser");
1364  */
1365  $tb->addSpacer();
1366 
1367  $tb->addButton(
1368  $this->lng->txt('search_user'),
1369  $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start')
1370  );
1371  $tb->addSpacer();
1372  }
1373 
1374  $tb->addButton(
1375  $this->lng->txt('role_mailto'),
1376  $this->ctrl->getLinkTarget($this,'mailToRole')
1377  );
1378  $this->tpl->setVariable('BUTTONS_UA',$tb->getHTML());
1379 
1380 
1381  include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
1382  $role_assignment_editable = true;
1383  if(
1384  $this->object->getId() == SYSTEM_ROLE_ID &&
1385  !ilSecuritySettings::_getInstance()->checkAdminRoleAccessible($ilUser->getId()))
1386  {
1387  $role_assignment_editable = false;
1388  }
1389 
1390  include_once './Services/AccessControl/classes/class.ilAssignedUsersTableGUI.php';
1391  $ut = new ilAssignedUsersTableGUI($this,'userassignment',$this->object->getId(),$role_assignment_editable);
1392 
1393  $this->tpl->setVariable('TABLE_UA',$ut->getHTML());
1394 
1395  return true;
1396 
1397  }
redirection script todo: (a better solution should control the processing via a xml file) ...
checkAccess($a_perm_global, $a_perm_obj='')
global $ilUser
Definition: imgupload.php:15
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array())
fill toolbar with
TableGUI class for role administration.
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:

Field Documentation

◆ $container_type

ilObjRoleGUI::$container_type = ''
protected

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

Referenced by getContainerType().

◆ $ctrl

ilObjRoleGUI::$ctrl

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

◆ $obj_obj_id

ilObjRoleGUI::$obj_obj_id = 0
protected

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

Referenced by getParentObjId().

◆ $obj_obj_type

ilObjRoleGUI::$obj_obj_type = ''
protected

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

Referenced by getParentType().

◆ $obj_ref_id

ilObjRoleGUI::$obj_ref_id = 0
protected

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

Referenced by getParentRefId().

◆ $rolf_ref_id

◆ $type

ilObjRoleGUI::$type

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

◆ MODE_GLOBAL_CREATE

const ilObjRoleGUI::MODE_GLOBAL_CREATE = 2

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

◆ MODE_GLOBAL_UPDATE

const ilObjRoleGUI::MODE_GLOBAL_UPDATE = 1

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

◆ MODE_LOCAL_CREATE

const ilObjRoleGUI::MODE_LOCAL_CREATE = 4

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

◆ MODE_LOCAL_UPDATE

const ilObjRoleGUI::MODE_LOCAL_UPDATE = 3

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


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