ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 __construct($a_data,$a_id,$a_call_by_reference)
52  {
53  global $lng;
54 
55  $this->type = "rolf";
56  parent::__construct($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 
108  if($rbacsystem->checkAccess('create_role', $this->object->getRefId()))
109  {
110  $this->ctrl->setParameter($this,'new_type','role');
111  $ilToolbar->addButton(
112  $this->lng->txt('rolf_create_role'),
113  $this->ctrl->getLinkTarget($this,'create')
114  );
115  }
116  if($rbacsystem->checkAccess('create_rolt', $this->object->getRefId()))
117  {
118 
119  $this->ctrl->setParameter($this,'new_type','rolt');
120  $ilToolbar->addButton(
121  $this->lng->txt('rolf_create_rolt'),
122  $this->ctrl->getLinkTarget($this,'create')
123  );
124  $this->ctrl->clearParameters($this);
125  }
126 
127  if(
128  $rbacsystem->checkAccess('create_rolt', $this->object->getRefId()) ||
129  $rbacsystem->checkAccess('create_rolt', $this->object->getRefId())
130  )
131  {
132  $ilToolbar->addButton(
133  $this->lng->txt('rbac_import_role'),
134  $this->ctrl->getLinkTargetByClass('ilPermissionGUI','displayImportRoleForm')
135  );
136  }
137 
138  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
139  $table = new ilRoleTableGUI($this,'view');
140  $table->init();
141  $table->parse($this->object->getId());
142 
143  $this->tpl->setContent($table->getHTML());
144  }
145 
149  protected function roleSearchObject()
150  {
151  global $rbacsystem, $ilCtrl, $ilTabs;
152 
153  $ilTabs->clearTargets();
154  $ilTabs->setBackTarget(
155  $this->lng->txt('rbac_back_to_overview'),
156  $this->ctrl->getLinkTarget($this,'view')
157  );
158 
159  if(!$rbacsystem->checkAccess('visible,read',$this->object->getRefId()))
160  {
161  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
162  }
163 
164  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
165  ilUtil::sendInfo($this->lng->txt('rbac_choose_copy_targets'));
166 
167  $form = $this->initRoleSearchForm();
168  $this->tpl->setContent($form->getHTML());
169  }
170 
174  protected function initRoleSearchForm()
175  {
176  global $ilCtrl;
177 
178  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
179  $form = new ilPropertyFormGUI();
180  $form->setTitle($this->lng->txt('rbac_role_title'));
181  $form->setFormAction($ilCtrl->getFormAction($this,'view'));
182 
183  $search = new ilTextInputGUI($this->lng->txt('title'), 'title');
184  $search->setRequired(true);
185  $search->setSize(30);
186  $search->setMaxLength(255);
187  $form->addItem($search);
188 
189  $form->addCommandButton('roleSearchForm', $this->lng->txt('search'));
190  return $form;
191  }
192 
193 
199  protected function roleSearchFormObject()
200  {
201  global $ilCtrl;
202 
203  $_SESSION['rolf_search_query'] = '';
204  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
205 
206  $form = $this->initRoleSearchForm();
207  if($form->checkInput())
208  {
209  $_SESSION['rolf_search_query'] = $form->getInput('title');
210  return $this->roleSearchListObject();
211  }
212 
213  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
214  $form->setValuesByPost();
215  $ilCtrl->redirect($this,'roleSearch');
216  }
217 
221  protected function roleSearchListObject()
222  {
223  global $ilTabs, $ilCtrl;
224 
225  $ilTabs->clearTargets();
226  $ilTabs->setBackTarget(
227  $this->lng->txt('rbac_back_to_overview'),
228  $this->ctrl->getLinkTarget($this,'roleSearchList')
229  );
230 
231  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
232 
233  if(strlen($_SESSION['rolf_search_query']))
234  {
235  ilUtil::sendInfo($this->lng->txt('rbac_select_copy_targets'));
236 
237  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
238  $table = new ilRoleTableGUI($this,'roleSearchList');
239  $table->setType(ilRoleTableGUI::TYPE_SEARCH);
240  $table->setRoleTitleFilter($_SESSION['rolf_search_query']);
241  $table->init();
242  $table->parse($this->object->getId());
243  return $this->tpl->setContent($table->getHTML());
244  }
245 
246  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
247  $ilCtrl->redirect($this,'roleSearch');
248  }
249 
254  protected function chooseCopyBehaviourObject()
255  {
256  global $ilCtrl, $ilTabs;
257 
258  $ilTabs->clearTargets();
259  $ilTabs->setBackTarget(
260  $this->lng->txt('rbac_back_to_overview'),
261  $this->ctrl->getLinkTarget($this,'roleSearchList')
262  );
263 
264  $GLOBALS['ilLog']->write(__METHOD__.': '.$_REQUEST['copy_source']);
265 
266  $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
267 
268  $form = $this->initCopyBehaviourForm();
269  $this->tpl->setContent($form->getHTML());
270  }
271 
275  protected function initCopyBehaviourForm()
276  {
277  global $ilCtrl;
278 
279  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
280  $form = new ilPropertyFormGUI();
281  $form->setTitle($this->lng->txt('rbac_copy_behaviour'));
282  $form->setFormAction($ilCtrl->getFormAction($this,'chooseCopyBehaviour'));
283 
284  $ce = new ilRadioGroupInputGUI($this->lng->txt('change_existing_objects'), 'change_existing');
285  $ce->setRequired(true);
286  $ce->setValue(1);
287  $form->addItem($ce);
288 
289  $ceo = new ilRadioOption($this->lng->txt('change_existing_objects'),1);
290  $ce->addOption($ceo);
291 
292  $cne = new ilRadioOption($this->lng->txt('rbac_not_change_existing_objects'), 0);
293  $ce->addOption($cne);
294 
295  $roles = new ilHiddenInputGUI('roles');
296  $roles->setValue(implode(',',(array) $_POST['roles']));
297  $form->addItem($roles);
298 
299 
300  // if source is role template show option add permission, remove permissions and copy permissions
301  if(ilObject::_lookupType((int) $_REQUEST['copy_source']) == 'rolt')
302  {
303  $form->addCommandButton('addRolePermissions', $this->lng->txt('rbac_copy_role_add_perm'));
304  $form->addCommandButton('removeRolePermissions', $this->lng->txt('rbac_copy_role_remove_perm'));
305  $form->addCommandButton('copyRole', $this->lng->txt('rbac_copy_role_copy'));
306  }
307  else
308  {
309  $form->addCommandButton('copyRole', $this->lng->txt('rbac_copy_role'));
310  }
311  return $form;
312  }
313 
314 
318  protected function copyRoleObject()
319  {
320  global $ilCtrl;
321 
322  // Finally copy role/rolt
323  $roles = explode(',',$_POST['roles']);
324  $source = (int) $_REQUEST['copy_source'];
325 
326  $form = $this->initCopyBehaviourForm();
327  if($form->checkInput())
328  {
329  foreach((array) $roles as $role_id)
330  {
331  if($role_id != $source)
332  {
333  $this->doCopyRole($source,$role_id,$form->getInput('change_existing'));
334  }
335  }
336 
337  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
338  $ilCtrl->redirect($this,'view');
339  }
340  }
341 
345  protected function addRolePermissionsObject()
346  {
347  global $ilCtrl;
348 
349  // Finally copy role/rolt
350  $roles = explode(',',$_POST['roles']);
351  $source = (int) $_REQUEST['copy_source'];
352 
353  $form = $this->initCopyBehaviourForm();
354  if($form->checkInput())
355  {
356  foreach((array) $roles as $role_id)
357  {
358  if($role_id != $source)
359  {
360  $this->doAddRolePermissions($source,$role_id,$form->getInput('change_existing'));
361  }
362  }
363 
364  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
365  $ilCtrl->redirect($this,'view');
366  }
367  }
368 
372  protected function doAddRolePermissions($source, $target, $change_existing)
373  {
374  global $rbacadmin, $rbacreview;
375 
376  $rbacadmin->copyRolePermissionUnion(
377  $source,
378  $this->object->getRefId(),
379  $target,
380  $rbacreview->getRoleFolderOfRole($target),
381  $target,
382  $rbacreview->getRoleFolderOfRole($target)
383  );
384 
385  if($change_existing)
386  {
387  $target_obj = $rbacreview->getRoleFolderOfRole($target);
388  $this->doChangeExistingObjects($target_obj, $target);
389  }
390  }
391 
395  protected function removeRolePermissionsObject()
396  {
397  global $ilCtrl;
398 
399  // Finally copy role/rolt
400  $roles = explode(',',$_POST['roles']);
401  $source = (int) $_REQUEST['copy_source'];
402 
403  $form = $this->initCopyBehaviourForm();
404  if($form->checkInput())
405  {
406  foreach((array) $roles as $role_id)
407  {
408  if($role_id != $source)
409  {
410  $this->doRemoveRolePermissions($source,$role_id,$form->getInput('change_existing'));
411  }
412  }
413 
414  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
415  $ilCtrl->redirect($this,'view');
416  }
417  }
418 
422  protected function doRemoveRolePermissions($source, $target, $change_existing)
423  {
424  global $rbacadmin, $rbacreview;
425 
426  ilLoggerFactory::getLogger('ac')->debug('Remove permission source: ' . $source);
427  ilLoggerFactory::getLogger('ac')->debug('Remove permission target: ' . $target);
428  ilLoggerFactory::getLogger('ac')->debug('Remove permission change existing: ' . $change_existing);
429 
430  $rbacadmin->copyRolePermissionSubtract(
431  $source,
432  $this->object->getRefId(),
433  $target,
434  $rbacreview->getRoleFolderOfRole($target)
435  );
436 
437  if($change_existing)
438  {
439  $target_obj = $rbacreview->getRoleFolderOfRole($target);
440  $this->doChangeExistingObjects($target_obj, $target);
441  }
442  }
443 
444 
445 
456  protected function doCopyRole($source, $target, $change_existing)
457  {
458  global $tree, $rbacadmin, $rbacreview;
459 
460  $target_obj = $rbacreview->getRoleFolderOfRole($target);
461 
462  // Copy role template permissions
463  $rbacadmin->copyRoleTemplatePermissions(
464  $source,
465  $this->object->getRefId(),
466  $target_obj,
467  $target
468  );
469 
470  if(!$change_existing || !$target_obj)
471  {
472  return true;
473  }
474 
475  $start = $target_obj;
476 
477  include_once './Services/AccessControl/classes/class.ilObjRole.php';
478  if($rbacreview->isProtected($this->object->getRefId(),$source))
479  {
481  }
482  else
483  {
485  }
486 
487  if($start)
488  {
489  $role = new ilObjRole($target);
490  $role->changeExistingObjects(
491  $start,
492  $mode,
493  array('all')
494  );
495  }
496  }
497 
504  protected function doChangeExistingObjects($a_start_obj, $a_target_role)
505  {
506  global $rbacreview;
507 
508  if(!$a_start_obj)
509  {
510  // todo error handling
511  }
512 
513  include_once './Services/AccessControl/classes/class.ilObjRole.php';
514  if($rbacreview->isProtected($this->object->getRefId(),$a_source_role))
515  {
517  }
518  else
519  {
521  }
522 
523  if($a_start_obj)
524  {
525  $role = new ilObjRole($a_target_role);
526  $role->changeExistingObjects(
527  $a_start_obj,
528  $mode,
529  array('all')
530  );
531  }
532 
533  }
534 
535 
539  protected function applyFilterObject()
540  {
541  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
542  $table = new ilRoleTableGUI($this,'view');
543  $table->init();
544  $table->resetOffset();
545  $table->writeFilterToSession();
546 
547  $this->viewObject();
548  }
549 
553  function resetFilterObject()
554  {
555  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
556  $table = new ilRoleTableGUI($this,'view');
557  $table->init();
558  $table->resetOffset();
559  $table->resetFilter();
560 
561  $this->viewObject();
562  }
563 
567  protected function confirmDeleteObject()
568  {
569  global $ilCtrl;
570 
571  if(!count($_POST['roles']))
572  {
573  ilUtil::sendFailure($this->lng->txt('select_one'),true);
574  $ilCtrl->redirect($this,'view');
575  }
576 
577  $question = $this->lng->txt('rbac_role_delete_qst');
578 
579  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
580  $confirm = new ilConfirmationGUI();
581  $confirm->setHeaderText($question);
582  $confirm->setFormAction($ilCtrl->getFormAction($this));
583  $confirm->setHeaderText($this->lng->txt("info_delete_sure"));
584  $confirm->setConfirm($this->lng->txt('delete'), 'deleteRole');
585  $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
586 
587 
588  include_once './Services/AccessControl/classes/class.ilObjRole.php';
589  foreach($_POST['roles'] as $role_id)
590  {
591  $confirm->addItem(
592  'roles[]',
593  $role_id,
595  );
596  }
597  $this->tpl->setContent($confirm->getHTML());
598  }
599 
603  protected function deleteRoleObject()
604  {
605  global $rbacsystem,$ilErr,$rbacreview,$ilCtrl;
606 
607  if(!$rbacsystem->checkAccess('delete',$this->object->getRefId()))
608  {
609  $ilErr->raiseError(
610  $this->lng->txt('msg_no_perm_delete'),
611  $ilErr->MESSAGE
612  );
613  }
614 
615  foreach((array) $_POST['roles'] as $id)
616  {
617  // instatiate correct object class (role or rolt)
618  $obj = ilObjectFactory::getInstanceByObjId($id,false);
619 
620  if ($obj->getType() == "role")
621  {
622  $rolf_arr = $rbacreview->getFoldersAssignedToRole($obj->getId(),true);
623  $obj->setParent($rolf_arr[0]);
624  }
625 
626  $obj->delete();
627  }
628 
629  // set correct return location if rolefolder is removed
630  ilUtil::sendSuccess($this->lng->txt("msg_deleted_roles_rolts"),true);
631  $ilCtrl->redirect($this,'view');
632  }
633 
634 
635 
636 
637 
643  function createObject()
644  {
645  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
646 
647  /*
648  $this->object->setTitle($this->lng->txt("obj_".$this->object->getType()."_local"));
649  $this->object->setDescription("obj_".$this->object->getType()."_local_desc");
650 
651  $this->saveObject();
652  */
653  }
654 
660  function deleteObject($a_error = false)
661  {
662  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
663  }
664 
671  {
672  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
673 
674  $this->ctrl->redirect($this, "view");
675  }
676 
684  {
685  global $rbacsystem;
686 
687  $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
688 
689  if ($this->object->getRefId() != ROLE_FOLDER_ID or !$rbacsystem->checkAccess('create_rolt',ROLE_FOLDER_ID))
690  {
691  unset($d["rolt"]);
692  }
693 
694  if (!$rbacsystem->checkAccess('create_role',$this->object->getRefId()))
695  {
696  unset($d["role"]);
697  }
698 
699  if (count($d) > 0)
700  {
701  foreach ($d as $row)
702  {
703  $count = 0;
704  if ($row["max"] > 0)
705  {
706  //how many elements are present?
707  for ($i=0; $i<count($this->data["ctrl"]); $i++)
708  {
709  if ($this->data["ctrl"][$i]["type"] == $row["name"])
710  {
711  $count++;
712  }
713  }
714  }
715  if ($row["max"] == "" || $count < $row["max"])
716  {
717  $subobj[] = $row["name"];
718  }
719  }
720  }
721 
722  if (is_array($subobj))
723  {
724  //build form
725  $opts = ilUtil::formSelect(12,"new_type",$subobj);
726  $this->tpl->setCurrentBlock("add_object");
727  $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
728  $this->tpl->setVariable("BTN_NAME", "create");
729  $this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
730  $this->tpl->parseCurrentBlock();
731  }
732  }
733 
738  function saveObject()
739  {
740  global $rbacadmin;
741 
742  // role folders are created automatically
743  $_GET["new_type"] = $this->object->getType();
744  $_POST["Fobject"]["title"] = $this->object->getTitle();
745  $_POST["Fobject"]["desc"] = $this->object->getDescription();
746 
747  // always call parent method first to create an object_data entry & a reference
748  $newObj = parent::saveObject();
749 
750  // put here your object specific stuff
751 
752  // always send a message
753  ilUtil::sendSuccess($this->lng->txt("rolf_added"),true);
754 
755  $this->ctrl->redirect($this, "view");
756  }
757 
764  function getAdminTabs()
765  {
766  if ($this->checkPermissionBool("visible,read"))
767  {
768  $this->tabs_gui->addTarget(
769  "view",
770  $this->ctrl->getLinkTarget($this, "view"),
771  array("", "view"),
772  get_class($this)
773  );
774 
775  $this->tabs_gui->addTarget(
776  "settings",
777  $this->ctrl->getLinkTarget($this, "editSettings"),
778  array("editSettings"),
779  get_class($this)
780  );
781  }
782 
783  if($this->checkPermissionBool("edit_permission"))
784  {
785  $this->tabs_gui->addTarget("perm_settings",
786  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'),
787  "perm"),
788  "",
789  "ilpermissiongui");
790  }
791  }
792 
793  function editSettingsObject(ilPropertyFormGUI $a_form = null)
794  {
795  if(!$a_form)
796  {
797  $a_form = $this->initSettingsForm();
798  }
799 
800  $this->tpl->setContent($a_form->getHTML());
801  }
802 
804  {
805  global $ilErr, $rbacreview, $ilUser;
806 
807  if (!$this->checkPermissionBool("write"))
808  {
809  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
810  }
811 
812  $form = $this->initSettingsForm();
813  if($form->checkInput())
814  {
815  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
816  $privacy = ilPrivacySettings::_getInstance();
817  $privacy->enableRbacLog((int) $_POST['rbac_log']);
818  $privacy->setRbacLogAge((int) $_POST['rbac_log_age']);
819  $privacy->save();
820 
821  if($rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
822  {
823  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
824  $security = ilSecuritySettings::_getInstance();
825  $security->protectedAdminRole((int) $_POST['admin_role']);
826  $security->save();
827  }
828 
829  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
830  $this->ctrl->redirect($this, "editSettings");
831  }
832 
833  $form->setValuesByPost();
834  $this->editSettingsObject($form);
835  }
836 
837  protected function initSettingsForm()
838  {
839  global $rbacreview, $ilUser;
840 
841  $this->lng->loadLanguageModule('ps');
842 
843  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
844  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
845  $privacy = ilPrivacySettings::_getInstance();
846  $security = ilSecuritySettings::_getInstance();
847 
848  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
849  $form = new ilPropertyFormGUI();
850  $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings"));
851  $form->setTitle($this->lng->txt('settings'));
852 
853  // protected admin
854  $admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'),'admin_role');
855  $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID));
856  $admin->setInfo($this->lng->txt('adm_adm_role_protect_info'));
857  $admin->setChecked((int) $security->isAdminRoleProtected());
858  $admin->setValue(1);
859  $form->addItem($admin);
860 
861  $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
862  $check->setInfo($this->lng->txt('rbac_log_info'));
863  $check->setChecked($privacy->enabledRbacLog());
864  $form->addItem($check);
865 
866  $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'),'rbac_log_age');
867  $age->setInfo($this->lng->txt('rbac_log_age_info'));
868  $age->setValue($privacy->getRbacLogAge());
869  $age->setMinValue(1);
870  $age->setMaxValue(24);
871  $age->setSize(2);
872  $age->setMaxLength(2);
873  $check->addSubItem($age);
874 
875  $form->addCommandButton('saveSettings',$this->lng->txt('save'));
876 
877  return $form;
878  }
879 
880  public function addToExternalSettingsForm($a_form_id)
881  {
882  switch($a_form_id)
883  {
885 
886  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
887  $security = ilSecuritySettings::_getInstance();
888 
889  $fields = array('adm_adm_role_protect' => array($security->isAdminRoleProtected(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
890 
891  return array(array("editSettings", $fields));
892 
894 
895  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
896  $privacy = ilPrivacySettings::_getInstance();
897 
898  $subitems = null;
899  if((bool)$privacy->enabledRbacLog())
900  {
901  $subitems = array('rbac_log_age' => $privacy->getRbacLogAge());
902  }
903  $fields = array('rbac_log' => array($privacy->enabledRbacLog(), ilAdministrationSettingsFormHandler::VALUE_BOOL, $subitems));
904 
905  return array(array("editSettings", $fields));
906  }
907  }
908 
909 } // END class.ilObjRoleFolderGUI
910 ?>
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilObjRole.
Add some data
global $ilErr
Definition: raiseError.php:16
This class represents an option in a radio group.
editSettingsObject(ilPropertyFormGUI $a_form=null)
adoptPermSaveObject()
??? TODO: what is the purpose of this function? public
$_SESSION["AccountId"]
This class represents a property form user interface.
confirmDeleteObject()
Confirm deletion of roles.
$_GET["client_id"]
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
getAdminTabs()
Add role folder tabs ilTree $tree ilLanguage $lng.
showPossibleSubObjects()
show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local...
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$cmd
Definition: sahs_server.php:35
deleteObject($a_error=false)
display deletion confirmation screen DEPRECATED !!! public
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
Class ilObjRoleFolderGUI.
for($col=0; $col< 50; $col++) $d
TableGUI for the presentation og roles and role templates.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
__construct($a_data, $a_id, $a_call_by_reference)
Constructor public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a hidden form property in a property form.
prepareOutput($a_show_subobjects=true)
prepare output
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.
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
applyFilterObject()
Apply role filter.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _getTranslation($a_role_title)
Create styles array
The data for the language used.
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
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
Create new PHPExcel object
obj_idprivate
createObject()
role folders are created automatically DEPRECATED !!! public
$ret
Definition: parser.php:6
saveObject()
save object public
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getLogger($a_component_id)
Get component logger.
static _getInstance()
Get instance of ilPrivacySettings.
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.
$_POST["username"]
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.