ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjRoleFolderGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 require_once "./Services/Object/classes/class.ilObjectGUI.php";
25 
39 {
45  var $type;
46 
51  function ilObjRoleFolderGUI($a_data,$a_id,$a_call_by_reference)
52  {
53  global $lng;
54 
55  $this->type = "rolf";
56  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
57  $lng->loadLanguageModule('rbac');
58  }
59 
60  function executeCommand()
61  {
62  global $ilTabs;
63 
64  $next_class = $this->ctrl->getNextClass($this);
65  $cmd = $this->ctrl->getCmd();
66  $this->prepareOutput();
67 
68  switch($next_class)
69  {
70 
71  case 'ilpermissiongui':
72  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
73  $perm_gui =& new ilPermissionGUI($this);
74  $ret =& $this->ctrl->forwardCommand($perm_gui);
75  break;
76 
77  default:
78  if(!$cmd)
79  {
80  $cmd = "view";
81  }
82  $cmd .= "Object";
83  $this->$cmd();
84 
85  break;
86  }
87  return true;
88  }
89 
96  public function viewObject()
97  {
98  global $ilErr, $rbacsystem, $ilToolbar,$rbacreview,$ilTabs;
99 
100  $ilTabs->activateTab('view');
101 
102  if(!$rbacsystem->checkAccess('visible,read',$this->object->getRefId()))
103  {
104  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
105  }
106 
107  $this->ctrl->setParameter($this,'new_type','role');
108  $ilToolbar->addButton(
109  $this->lng->txt('rolf_create_role'),
110  $this->ctrl->getLinkTarget($this,'create')
111  );
112 
113  $this->ctrl->setParameter($this,'new_type','rolt');
114  $ilToolbar->addButton(
115  $this->lng->txt('rolf_create_rolt'),
116  $this->ctrl->getLinkTarget($this,'create')
117  );
118  $this->ctrl->clearParameters($this);
119 
120  $ilToolbar->addButton(
121  $this->lng->txt('rbac_import_role'),
122  $this->ctrl->getLinkTargetByClass('ilPermissionGUI','displayImportRoleForm')
123  );
124 
125  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
126  $table = new ilRoleTableGUI($this,'view');
127  $table->init();
128  $table->parse($this->object->getId());
129 
130  $this->tpl->setContent($table->getHTML());
131  }
132 
136  protected function roleSearchObject()
137  {
138  global $rbacsystem, $ilCtrl, $ilTabs;
139 
140  $ilTabs->clearTargets();
141  $ilTabs->setBackTarget(
142  $this->lng->txt('rbac_back_to_overview'),
143  $this->ctrl->getLinkTarget($this,'view')
144  );
145 
146  if(!$rbacsystem->checkAccess('visible,read',$this->object->getRefId()))
147  {
148  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
149  }
150 
151  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
152  ilUtil::sendInfo($this->lng->txt('rbac_choose_copy_targets'));
153 
154  $form = $this->initRoleSearchForm();
155  $this->tpl->setContent($form->getHTML());
156  }
157 
161  protected function initRoleSearchForm()
162  {
163  global $ilCtrl;
164 
165  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
166  $form = new ilPropertyFormGUI();
167  $form->setTitle($this->lng->txt('rbac_role_title'));
168  $form->setFormAction($ilCtrl->getFormAction($this,'view'));
169 
170  $search = new ilTextInputGUI($this->lng->txt('title'), 'title');
171  $search->setRequired(true);
172  $search->setSize(30);
173  $search->setMaxLength(255);
174  $form->addItem($search);
175 
176  $form->addCommandButton('roleSearchForm', $this->lng->txt('search'));
177  return $form;
178  }
179 
180 
186  protected function roleSearchFormObject()
187  {
188  global $ilCtrl;
189 
190  $_SESSION['rolf_search_query'] = '';
191  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
192 
193  $form = $this->initRoleSearchForm();
194  if($form->checkInput())
195  {
196  $_SESSION['rolf_search_query'] = $form->getInput('title');
197  return $this->roleSearchListObject();
198  }
199 
200  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
201  $form->setValuesByPost();
202  $ilCtrl->redirect($this,'roleSearch');
203  }
204 
208  protected function roleSearchListObject()
209  {
210  global $ilTabs, $ilCtrl;
211 
212  $ilTabs->clearTargets();
213  $ilTabs->setBackTarget(
214  $this->lng->txt('rbac_back_to_overview'),
215  $this->ctrl->getLinkTarget($this,'roleSearchList')
216  );
217 
218  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
219 
220  if(strlen($_SESSION['rolf_search_query']))
221  {
222  ilUtil::sendInfo($this->lng->txt('rbac_select_copy_targets'));
223 
224  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
225  $table = new ilRoleTableGUI($this,'roleSearchList');
226  $table->setType(ilRoleTableGUI::TYPE_SEARCH);
227  $table->setRoleTitleFilter($_SESSION['rolf_search_query']);
228  $table->init();
229  $table->parse($this->object->getId());
230  return $this->tpl->setContent($table->getHTML());
231  }
232 
233  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
234  $ilCtrl->redirect($this,'roleSearch');
235  }
236 
241  protected function chooseCopyBehaviourObject()
242  {
243  global $ilCtrl, $ilTabs;
244 
245  $ilTabs->clearTargets();
246  $ilTabs->setBackTarget(
247  $this->lng->txt('rbac_back_to_overview'),
248  $this->ctrl->getLinkTarget($this,'roleSearchList')
249  );
250 
251  $GLOBALS['ilLog']->write(__METHOD__.': '.$_REQUEST['copy_source']);
252 
253  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
254 
255  $form = $this->initCopyBehaviourForm();
256  $this->tpl->setContent($form->getHTML());
257  }
258 
262  protected function initCopyBehaviourForm()
263  {
264  global $ilCtrl;
265 
266  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
267  $form = new ilPropertyFormGUI();
268  $form->setTitle($this->lng->txt('rbac_copy_behaviour'));
269  $form->setFormAction($ilCtrl->getFormAction($this,'chooseCopyBehaviour'));
270 
271  $ce = new ilRadioGroupInputGUI($this->lng->txt('change_existing_objects'), 'change_existing');
272  $ce->setRequired(true);
273  $ce->setValue(1);
274  $form->addItem($ce);
275 
276  $ceo = new ilRadioOption($this->lng->txt('change_existing_objects'),1);
277  $ce->addOption($ceo);
278 
279  $cne = new ilRadioOption($this->lng->txt('rbac_not_change_existing_objects'), 0);
280  $ce->addOption($cne);
281 
282  $roles = new ilHiddenInputGUI('roles');
283  $roles->setValue(implode(',',(array) $_POST['roles']));
284  $form->addItem($roles);
285 
286 
287  // if source is role template show option add permission, remove permissions and copy permissions
288  if(ilObject::_lookupType((int) $_REQUEST['copy_source']) == 'rolt')
289  {
290  $form->addCommandButton('addRolePermissions', $this->lng->txt('rbac_copy_role_add_perm'));
291  $form->addCommandButton('removeRolePermissions', $this->lng->txt('rbac_copy_role_remove_perm'));
292  $form->addCommandButton('copyRole', $this->lng->txt('rbac_copy_role_copy'));
293  }
294  else
295  {
296  $form->addCommandButton('copyRole', $this->lng->txt('rbac_copy_role'));
297  }
298  return $form;
299  }
300 
301 
305  protected function copyRoleObject()
306  {
307  global $ilCtrl;
308 
309  // Finally copy role/rolt
310  $roles = explode(',',$_POST['roles']);
311  $source = (int) $_REQUEST['copy_source'];
312 
313  $form = $this->initCopyBehaviourForm();
314  if($form->checkInput())
315  {
316  foreach((array) $roles as $role_id)
317  {
318  if($role_id != $source)
319  {
320  $this->doCopyRole($source,$role_id,$form->getInput('change_existing'));
321  }
322  }
323 
324  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
325  $ilCtrl->redirect($this,'view');
326  }
327  }
328 
332  protected function addRolePermissionsObject()
333  {
334  global $ilCtrl;
335 
336  // Finally copy role/rolt
337  $roles = explode(',',$_POST['roles']);
338  $source = (int) $_REQUEST['copy_source'];
339 
340  $form = $this->initCopyBehaviourForm();
341  if($form->checkInput())
342  {
343  foreach((array) $roles as $role_id)
344  {
345  if($role_id != $source)
346  {
347  $this->doAddRolePermissions($source,$role_id,$form->getInput('change_existing'));
348  }
349  }
350 
351  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
352  $ilCtrl->redirect($this,'view');
353  }
354  }
355 
359  protected function doAddRolePermissions($source, $target, $change_existing)
360  {
361  global $rbacadmin, $rbacreview;
362 
363  $rbacadmin->copyRolePermissionUnion(
364  $source,
365  $this->object->getRefId(),
366  $target,
367  $rbacreview->getRoleFolderOfRole($target),
368  $target,
369  $rbacreview->getRoleFolderOfRole($target)
370  );
371 
372  if($change_existing)
373  {
374  $target_obj = $rbacreview->getRoleFolderOfRole($target);
375  $this->doChangeExistingObjects($target_obj, $target);
376  }
377  }
378 
382  protected function removeRolePermissionsObject()
383  {
384  global $ilCtrl;
385 
386  // Finally copy role/rolt
387  $roles = explode(',',$_POST['roles']);
388  $source = (int) $_REQUEST['copy_source'];
389 
390  $form = $this->initCopyBehaviourForm();
391  if($form->checkInput())
392  {
393  foreach((array) $roles as $role_id)
394  {
395  if($role_id != $source)
396  {
397  $this->doRemoveRolePermissions($source,$role_id,$form->getInput('change_existing'));
398  }
399  }
400 
401  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
402  $ilCtrl->redirect($this,'view');
403  }
404  }
405 
409  protected function doRemoveRolePermissions($source, $target, $change_existing)
410  {
411  global $rbacadmin, $rbacreview;
412 
413  ilLoggerFactory::getLogger('ac')->debug('Remove permission source: ' . $source);
414  ilLoggerFactory::getLogger('ac')->debug('Remove permission target: ' . $target);
415  ilLoggerFactory::getLogger('ac')->debug('Remove permission change existing: ' . $change_existing);
416 
417  $rbacadmin->copyRolePermissionSubtract(
418  $source,
419  $this->object->getRefId(),
420  $target,
421  $rbacreview->getRoleFolderOfRole($target)
422  );
423 
424  if($change_existing)
425  {
426  $target_obj = $rbacreview->getRoleFolderOfRole($target);
427  $this->doChangeExistingObjects($target_obj, $target);
428  }
429  }
430 
431 
432 
443  protected function doCopyRole($source, $target, $change_existing)
444  {
445  global $tree, $rbacadmin, $rbacreview;
446 
447  $target_obj = $rbacreview->getRoleFolderOfRole($target);
448 
449  // Copy role template permissions
450  $rbacadmin->copyRoleTemplatePermissions(
451  $source,
452  $this->object->getRefId(),
453  $target_obj,
454  $target
455  );
456 
457  if(!$change_existing || !$target_obj)
458  {
459  return true;
460  }
461 
462  $start = $target_obj;
463 
464  include_once './Services/AccessControl/classes/class.ilObjRole.php';
465  if($rbacreview->isProtected($this->object->getRefId(),$source))
466  {
468  }
469  else
470  {
472  }
473 
474  if($start)
475  {
476  $role = new ilObjRole($target);
477  $role->changeExistingObjects(
478  $start,
479  $mode,
480  array('all')
481  );
482  }
483  }
484 
491  protected function doChangeExistingObjects($a_start_obj, $a_target_role)
492  {
493  global $rbacreview;
494 
495  if(!$a_start_obj)
496  {
497  // todo error handling
498  }
499 
500  include_once './Services/AccessControl/classes/class.ilObjRole.php';
501  if($rbacreview->isProtected($this->object->getRefId(),$a_source_role))
502  {
504  }
505  else
506  {
508  }
509 
510  if($a_start_obj)
511  {
512  $role = new ilObjRole($a_target_role);
513  $role->changeExistingObjects(
514  $a_start_obj,
515  $mode,
516  array('all')
517  );
518  }
519 
520  }
521 
522 
526  protected function applyFilterObject()
527  {
528  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
529  $table = new ilRoleTableGUI($this,'view');
530  $table->init();
531  $table->resetOffset();
532  $table->writeFilterToSession();
533 
534  $this->viewObject();
535  }
536 
540  function resetFilterObject()
541  {
542  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
543  $table = new ilRoleTableGUI($this,'view');
544  $table->init();
545  $table->resetOffset();
546  $table->resetFilter();
547 
548  $this->viewObject();
549  }
550 
554  protected function confirmDeleteObject()
555  {
556  global $ilCtrl;
557 
558  if(!count($_POST['roles']))
559  {
560  ilUtil::sendFailure($this->lng->txt('select_one'),true);
561  $ilCtrl->redirect($this,'view');
562  }
563 
564  $question = $this->lng->txt('rbac_role_delete_qst');
565 
566  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
567  $confirm = new ilConfirmationGUI();
568  $confirm->setHeaderText($question);
569  $confirm->setFormAction($ilCtrl->getFormAction($this));
570  $confirm->setHeaderText($this->lng->txt("info_delete_sure"));
571  $confirm->setConfirm($this->lng->txt('delete'), 'deleteRole');
572  $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
573 
574 
575  include_once './Services/AccessControl/classes/class.ilObjRole.php';
576  foreach($_POST['roles'] as $role_id)
577  {
578  $confirm->addItem(
579  'roles[]',
580  $role_id,
582  );
583  }
584  $this->tpl->setContent($confirm->getHTML());
585  }
586 
590  protected function deleteRoleObject()
591  {
592  global $rbacsystem,$ilErr,$rbacreview,$ilCtrl;
593 
594  if(!$rbacsystem->checkAccess('delete',$this->object->getRefId()))
595  {
596  $ilErr->raiseError(
597  $this->lng->txt('msg_no_perm_delete'),
598  $ilErr->MESSAGE
599  );
600  }
601 
602  foreach((array) $_POST['roles'] as $id)
603  {
604  // instatiate correct object class (role or rolt)
605  $obj = ilObjectFactory::getInstanceByObjId($id,false);
606 
607  if ($obj->getType() == "role")
608  {
609  $rolf_arr = $rbacreview->getFoldersAssignedToRole($obj->getId(),true);
610  $obj->setParent($rolf_arr[0]);
611  }
612 
613  $obj->delete();
614  }
615 
616  // set correct return location if rolefolder is removed
617  ilUtil::sendSuccess($this->lng->txt("msg_deleted_roles_rolts"),true);
618  $ilCtrl->redirect($this,'view');
619  }
620 
621 
622 
623 
624 
630  function createObject()
631  {
632  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
633 
634  /*
635  $this->object->setTitle($this->lng->txt("obj_".$this->object->getType()."_local"));
636  $this->object->setDescription("obj_".$this->object->getType()."_local_desc");
637 
638  $this->saveObject();
639  */
640  }
641 
647  function deleteObject()
648  {
649  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
650  }
651 
658  {
659  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
660 
661  $this->ctrl->redirect($this, "view");
662  }
663 
670  function showPossibleSubObjects($a_tpl)
671  {
672  global $rbacsystem;
673 
674  $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
675 
676  if ($this->object->getRefId() != ROLE_FOLDER_ID or !$rbacsystem->checkAccess('create_rolt',ROLE_FOLDER_ID))
677  {
678  unset($d["rolt"]);
679  }
680 
681  if (!$rbacsystem->checkAccess('create_role',$this->object->getRefId()))
682  {
683  unset($d["role"]);
684  }
685 
686  if (count($d) > 0)
687  {
688  foreach ($d as $row)
689  {
690  $count = 0;
691  if ($row["max"] > 0)
692  {
693  //how many elements are present?
694  for ($i=0; $i<count($this->data["ctrl"]); $i++)
695  {
696  if ($this->data["ctrl"][$i]["type"] == $row["name"])
697  {
698  $count++;
699  }
700  }
701  }
702  if ($row["max"] == "" || $count < $row["max"])
703  {
704  $subobj[] = $row["name"];
705  }
706  }
707  }
708 
709  if (is_array($subobj))
710  {
711  //build form
712  $opts = ilUtil::formSelect(12,"new_type",$subobj);
713  $a_tpl->setCurrentBlock("add_object");
714  $a_tpl->setVariable("SELECT_OBJTYPE", $opts);
715  $a_tpl->setVariable("BTN_NAME", "create");
716  $a_tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
717  $a_tpl->parseCurrentBlock();
718  }
719 
720  return $a_tpl;
721  }
722 
727  function saveObject()
728  {
729  global $rbacadmin;
730 
731  // role folders are created automatically
732  $_GET["new_type"] = $this->object->getType();
733  $_POST["Fobject"]["title"] = $this->object->getTitle();
734  $_POST["Fobject"]["desc"] = $this->object->getDescription();
735 
736  // always call parent method first to create an object_data entry & a reference
737  $newObj = parent::saveObject();
738 
739  // put here your object specific stuff
740 
741  // always send a message
742  ilUtil::sendSuccess($this->lng->txt("rolf_added"),true);
743 
744  $this->ctrl->redirect($this, "view");
745  }
746 
753  function getAdminTabs(&$tabs_gui)
754  {
755  global $tree,$lng;
756 
757  if ($this->checkPermissionBool("visible,read"))
758  {
759  $tabs_gui->addTarget(
760  "view",
761  $this->ctrl->getLinkTarget($this, "view"),
762  array("", "view"),
763  get_class($this)
764  );
765 
766  $tabs_gui->addTarget(
767  "settings",
768  $this->ctrl->getLinkTarget($this, "editSettings"),
769  array("editSettings"),
770  get_class($this)
771  );
772  }
773 
774  if($this->checkPermissionBool("edit_permission"))
775  {
776  $tabs_gui->addTarget("perm_settings",
777  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'),
778  "perm"),
779  "",
780  "ilpermissiongui");
781  }
782  }
783 
784  function editSettingsObject(ilPropertyFormGUI $a_form = null)
785  {
786  if(!$a_form)
787  {
788  $a_form = $this->initSettingsForm();
789  }
790 
791  $this->tpl->setContent($a_form->getHTML());
792  }
793 
795  {
796  global $ilErr, $rbacreview, $ilUser;
797 
798  if (!$this->checkPermissionBool("write"))
799  {
800  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
801  }
802 
803  $form = $this->initSettingsForm();
804  if($form->checkInput())
805  {
806  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
807  $privacy = ilPrivacySettings::_getInstance();
808  $privacy->enableRbacLog((int) $_POST['rbac_log']);
809  $privacy->setRbacLogAge((int) $_POST['rbac_log_age']);
810  $privacy->save();
811 
812  if($rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
813  {
814  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
815  $security = ilSecuritySettings::_getInstance();
816  $security->protectedAdminRole((int) $_POST['admin_role']);
817  $security->save();
818  }
819 
820  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
821  $this->ctrl->redirect($this, "editSettings");
822  }
823 
824  $form->setValuesByPost();
825  $this->editSettingsObject($form);
826  }
827 
828  protected function initSettingsForm()
829  {
830  global $rbacreview, $ilUser;
831 
832  $this->lng->loadLanguageModule('ps');
833 
834  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
835  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
836  $privacy = ilPrivacySettings::_getInstance();
837  $security = ilSecuritySettings::_getInstance();
838 
839  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
840  $form = new ilPropertyFormGUI();
841  $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings"));
842  $form->setTitle($this->lng->txt('settings'));
843 
844  // protected admin
845  $admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'),'admin_role');
846  $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID));
847  $admin->setInfo($this->lng->txt('adm_adm_role_protect_info'));
848  $admin->setChecked((int) $security->isAdminRoleProtected());
849  $admin->setValue(1);
850  $form->addItem($admin);
851 
852  $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
853  $check->setInfo($this->lng->txt('rbac_log_info'));
854  $check->setChecked($privacy->enabledRbacLog());
855  $form->addItem($check);
856 
857  $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'),'rbac_log_age');
858  $age->setInfo($this->lng->txt('rbac_log_age_info'));
859  $age->setValue($privacy->getRbacLogAge());
860  $age->setMinValue(1);
861  $age->setMaxValue(24);
862  $age->setSize(2);
863  $age->setMaxLength(2);
864  $check->addSubItem($age);
865 
866  $form->addCommandButton('saveSettings',$this->lng->txt('save'));
867 
868  return $form;
869  }
870 
871  public function addToExternalSettingsForm($a_form_id)
872  {
873  switch($a_form_id)
874  {
876 
877  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
878  $security = ilSecuritySettings::_getInstance();
879 
880  $fields = array('adm_adm_role_protect' => array($security->isAdminRoleProtected(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
881 
882  return array(array("editSettings", $fields));
883 
885 
886  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
887  $privacy = ilPrivacySettings::_getInstance();
888 
889  $subitems = null;
890  if((bool)$privacy->enabledRbacLog())
891  {
892  $subitems = array('rbac_log_age' => $privacy->getRbacLogAge());
893  }
894  $fields = array('rbac_log' => array($privacy->enabledRbacLog(), ilAdministrationSettingsFormHandler::VALUE_BOOL, $subitems));
895 
896  return array(array("editSettings", $fields));
897  }
898  }
899 
900 } // END class.ilObjRoleFolderGUI
901 ?>
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilObjRole.
showPossibleSubObjects($a_tpl)
show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local...
This class represents an option in a radio group.
editSettingsObject(ilPropertyFormGUI $a_form=null)
adoptPermSaveObject()
??? TODO: what is the purpose of this function? public
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
This class represents a property form user interface.
confirmDeleteObject()
Confirm deletion of roles.
$_GET["client_id"]
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
_getTranslation($a_role_title)
$cmd
Definition: sahs_server.php:35
This class represents a checkbox property in a property form.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
static _lookupTitle($a_id)
lookup object title
Class ilObjRoleFolderGUI.
TableGUI for the presentation og roles and role templates.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a hidden form property in a property form.
deleteObject()
display deletion confirmation screen DEPRECATED !!! public
This class represents a property in a property form.
This class represents a number property in a property form.
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
Class ilObjectGUI Basic methods of all Output classes.
doCopyRole($source, $target, $change_existing)
Perform copy of role ilTree $tree <type> $rbacadmin <type> $rbacreview.
initRoleSearchForm()
Init role search form.
This class represents a text property in a property form.
removeRolePermissionsObject()
Remove role permissions.
doChangeExistingObjects($a_start_obj, $a_target_role)
Do change existing objects type $rbacreview.
redirection script todo: (a better solution should control the processing via a xml file) ...
applyFilterObject()
Apply role filter.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getAdminTabs(&$tabs_gui)
Add role folder tabs ilTree $tree ilLanguage $lng.
prepareOutput()
prepare output
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
resetFilterObject()
Reset role filter.
viewObject()
ilErrorHandler $ilErr ilRbacSystem $rbacsystem ilToolbarGUI $ilToolbar
ilObjRoleFolderGUI($a_data, $a_id, $a_call_by_reference)
Constructor public.
global $ilUser
Definition: imgupload.php:15
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
createObject()
role folders are created automatically DEPRECATED !!! public
saveObject()
save object public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getLogger($a_component_id)
Get component logger.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static _getInstance()
Get instance of ilPrivacySettings.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
chooseCopyBehaviourObject()
Chosse change existing objects,...
roleSearchFormObject()
Parse search query type $ilCtrl.
static _getInstance()
Get instance of ilSecuritySettings.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
setRequired($a_required)
Set Required.
initCopyBehaviourForm()
Show copy behaviour form.
Confirmation screen class.
addRolePermissionsObject()
Add role permissions.
doRemoveRolePermissions($source, $target, $change_existing)
do add role permission
doAddRolePermissions($source, $target, $change_existing)
do add role permission
roleSearchObject()
Search target roles.