ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjRoleFolderGUI Class Reference

Class ilObjRoleFolderGUI. More...

+ Inheritance diagram for ilObjRoleFolderGUI:
+ Collaboration diagram for ilObjRoleFolderGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 viewObject ()
 @global ilErrorHandler $ilErr @global ilRbacSystem $rbacsystem @global ilToolbarGUI $ilToolbar More...
 
 resetFilterObject ()
 Reset role filter. More...
 
 createObject ()
 role folders are created automatically DEPRECATED !!! @access public More...
 
 deleteObject ($a_error=false)
 display deletion confirmation screen DEPRECATED !!! @access public More...
 
 adoptPermSaveObject ()
 ??? TODO: what is the purpose of this function? @access public More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders More...
 
 saveObject ()
 save object @access public More...
 
 getAdminTabs ()
 Add role folder tabs @global ilTree $tree @global ilLanguage $lng. More...
 
 editSettingsObject (ilPropertyFormGUI $a_form=null)
 
 saveSettingsObject ()
 
 addToExternalSettingsForm ($a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $type
 
- 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

 roleSearchObject ()
 Search target roles. More...
 
 initRoleSearchForm ()
 Init role search form. More...
 
 roleSearchFormObject ()
 Parse search query @global type $ilCtrl. More...
 
 roleSearchListObject ()
 List roles. More...
 
 chooseCopyBehaviourObject ()
 Chosse change existing objects,... More...
 
 initCopyBehaviourForm ()
 Show copy behaviour form. More...
 
 copyRoleObject ()
 Copy role. More...
 
 addRolePermissionsObject ()
 Add role permissions. More...
 
 doAddRolePermissions ($source, $target, $change_existing)
 do add role permission More...
 
 removeRolePermissionsObject ()
 Remove role permissions. More...
 
 doRemoveRolePermissions ($source, $target, $change_existing)
 do add role permission More...
 
 doCopyRole ($source, $target, $change_existing)
 Perform copy of role @global ilTree $tree @global <type> $rbacadmin @global <type> $rbacreview. More...
 
 doChangeExistingObjects ($a_start_obj, $a_target_role)
 Do change existing objects @global type $rbacreview. More...
 
 applyFilterObject ()
 Apply role filter. More...
 
 confirmDeleteObject ()
 Confirm deletion of roles. More...
 
 deleteRoleObject ()
 Delete roles. More...
 
 initSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

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...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjRoleFolderGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor @access public.

Definition at line 51 of file class.ilObjRoleFolderGUI.php.

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 }

References ilObjectGUI\$lng.

Member Function Documentation

◆ addRolePermissionsObject()

ilObjRoleFolderGUI::addRolePermissionsObject ( )
protected

Add role permissions.

Definition at line 345 of file class.ilObjRoleFolderGUI.php.

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 }
$_POST["username"]
initCopyBehaviourForm()
Show copy behaviour form.
doAddRolePermissions($source, $target, $change_existing)
do add role permission
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18

References $_POST, $ilCtrl, doAddRolePermissions(), initCopyBehaviourForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ addToExternalSettingsForm()

ilObjRoleFolderGUI::addToExternalSettingsForm (   $a_form_id)

Definition at line 880 of file class.ilObjRoleFolderGUI.php.

881 {
882 switch($a_form_id)
883 {
885
886 include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
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');
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 }
static _getInstance()
Get instance of ilPrivacySettings.
static _getInstance()
Get instance of ilSecuritySettings.

References ilPrivacySettings\_getInstance(), ilSecuritySettings\_getInstance(), ilAdministrationSettingsFormHandler\FORM_PRIVACY, ilAdministrationSettingsFormHandler\FORM_SECURITY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

+ Here is the call graph for this function:

◆ adoptPermSaveObject()

ilObjRoleFolderGUI::adoptPermSaveObject ( )

??? TODO: what is the purpose of this function? @access public

Definition at line 670 of file class.ilObjRoleFolderGUI.php.

671 {
672 ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
673
674 $this->ctrl->redirect($this, "view");
675 }

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ applyFilterObject()

ilObjRoleFolderGUI::applyFilterObject ( )
protected

Apply role filter.

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

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 }
viewObject()
@global ilErrorHandler $ilErr @global ilRbacSystem $rbacsystem @global ilToolbarGUI $ilToolbar
TableGUI for the presentation og roles and role templates.

References viewObject().

+ Here is the call graph for this function:

◆ chooseCopyBehaviourObject()

ilObjRoleFolderGUI::chooseCopyBehaviourObject ( )
protected

Chosse change existing objects,...

Definition at line 254 of file class.ilObjRoleFolderGUI.php.

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 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, $ilCtrl, and initCopyBehaviourForm().

+ Here is the call graph for this function:

◆ confirmDeleteObject()

ilObjRoleFolderGUI::confirmDeleteObject ( )
protected

Confirm deletion of roles.

Definition at line 567 of file class.ilObjRoleFolderGUI.php.

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 }
Confirmation screen class.
static _getTranslation($a_role_title)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_POST, $ilCtrl, ilObjRole\_getTranslation(), ilObject\_lookupTitle(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ copyRoleObject()

ilObjRoleFolderGUI::copyRoleObject ( )
protected

Copy role.

Definition at line 318 of file class.ilObjRoleFolderGUI.php.

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 }
doCopyRole($source, $target, $change_existing)
Perform copy of role @global ilTree $tree @global <type> $rbacadmin @global <type> $rbacreview.

References $_POST, $ilCtrl, doCopyRole(), initCopyBehaviourForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ createObject()

ilObjRoleFolderGUI::createObject ( )

role folders are created automatically DEPRECATED !!! @access public

Reimplemented from ilObjectGUI.

Definition at line 643 of file class.ilObjRoleFolderGUI.php.

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 }
redirection script todo: (a better solution should control the processing via a xml file)

◆ deleteObject()

ilObjRoleFolderGUI::deleteObject (   $a_error = false)

display deletion confirmation screen DEPRECATED !!! @access public

Reimplemented from ilObjectGUI.

Definition at line 660 of file class.ilObjRoleFolderGUI.php.

661 {
662 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
663 }

◆ deleteRoleObject()

ilObjRoleFolderGUI::deleteRoleObject ( )
protected

Delete roles.

Definition at line 603 of file class.ilObjRoleFolderGUI.php.

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 }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
global $ilErr
Definition: raiseError.php:16

References $_POST, $ilCtrl, $ilErr, ilObjectFactory\getInstanceByObjId(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ doAddRolePermissions()

ilObjRoleFolderGUI::doAddRolePermissions (   $source,
  $target,
  $change_existing 
)
protected

do add role permission

Definition at line 372 of file class.ilObjRoleFolderGUI.php.

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 }
doChangeExistingObjects($a_start_obj, $a_target_role)
Do change existing objects @global type $rbacreview.

References $target, and doChangeExistingObjects().

Referenced by addRolePermissionsObject().

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

◆ doChangeExistingObjects()

ilObjRoleFolderGUI::doChangeExistingObjects (   $a_start_obj,
  $a_target_role 
)
protected

Do change existing objects @global type $rbacreview.

Parameters
type$a_start_obj
type$a_source_role

Definition at line 504 of file class.ilObjRoleFolderGUI.php.

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 }
Class ilObjRole.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES

References ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, and ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES.

Referenced by doAddRolePermissions(), and doRemoveRolePermissions().

+ Here is the caller graph for this function:

◆ doCopyRole()

ilObjRoleFolderGUI::doCopyRole (   $source,
  $target,
  $change_existing 
)
protected

Perform copy of role @global ilTree $tree @global <type> $rbacadmin @global <type> $rbacreview.

Parameters
<type>$source
<type>$target
<type>$change_existing
Returns
<type>

Definition at line 456 of file class.ilObjRoleFolderGUI.php.

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 }

References $start, $target, ilObjectGUI\$tree, ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, and ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES.

Referenced by copyRoleObject().

+ Here is the caller graph for this function:

◆ doRemoveRolePermissions()

ilObjRoleFolderGUI::doRemoveRolePermissions (   $source,
  $target,
  $change_existing 
)
protected

do add role permission

Definition at line 422 of file class.ilObjRoleFolderGUI.php.

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 }
static getLogger($a_component_id)
Get component logger.

References $target, doChangeExistingObjects(), and ilLoggerFactory\getLogger().

Referenced by removeRolePermissionsObject().

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

◆ editSettingsObject()

ilObjRoleFolderGUI::editSettingsObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 793 of file class.ilObjRoleFolderGUI.php.

794 {
795 if(!$a_form)
796 {
797 $a_form = $this->initSettingsForm();
798 }
799
800 $this->tpl->setContent($a_form->getHTML());
801 }

References initSettingsForm().

Referenced by saveSettingsObject().

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

◆ executeCommand()

ilObjRoleFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 60 of file class.ilObjRoleFolderGUI.php.

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 }
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjRoleFolderGUI::getAdminTabs ( )

Add role folder tabs @global ilTree $tree @global ilLanguage $lng.

Parameters
ilTabsGUI$tabs_gui

Reimplemented from ilObjectGUI.

Definition at line 764 of file class.ilObjRoleFolderGUI.php.

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 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.

References ilObjectGUI\checkPermissionBool().

+ Here is the call graph for this function:

◆ initCopyBehaviourForm()

ilObjRoleFolderGUI::initCopyBehaviourForm ( )
protected

Show copy behaviour form.

Definition at line 275 of file class.ilObjRoleFolderGUI.php.

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 }
This class represents a hidden form property in a property form.
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

References $_POST, $ilCtrl, and ilObject\_lookupType().

Referenced by addRolePermissionsObject(), chooseCopyBehaviourObject(), copyRoleObject(), and removeRolePermissionsObject().

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

◆ initRoleSearchForm()

ilObjRoleFolderGUI::initRoleSearchForm ( )
protected

Init role search form.

Definition at line 174 of file class.ilObjRoleFolderGUI.php.

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 }
This class represents a text property in a property form.

References $ilCtrl.

Referenced by roleSearchFormObject(), and roleSearchObject().

+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjRoleFolderGUI::initSettingsForm ( )
protected

Definition at line 837 of file class.ilObjRoleFolderGUI.php.

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');
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 }
This class represents a checkbox property in a property form.
This class represents a number property in a property form.
$ilUser
Definition: imgupload.php:18

References $GLOBALS, $ilUser, ilPrivacySettings\_getInstance(), and ilSecuritySettings\_getInstance().

Referenced by editSettingsObject(), and saveSettingsObject().

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

◆ removeRolePermissionsObject()

ilObjRoleFolderGUI::removeRolePermissionsObject ( )
protected

Remove role permissions.

Definition at line 395 of file class.ilObjRoleFolderGUI.php.

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 }
doRemoveRolePermissions($source, $target, $change_existing)
do add role permission

References $_POST, $ilCtrl, doRemoveRolePermissions(), initCopyBehaviourForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjRoleFolderGUI::resetFilterObject ( )

Reset role filter.

Definition at line 553 of file class.ilObjRoleFolderGUI.php.

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 }

References viewObject().

+ Here is the call graph for this function:

◆ roleSearchFormObject()

ilObjRoleFolderGUI::roleSearchFormObject ( )
protected

Parse search query @global type $ilCtrl.

Returns
type

Definition at line 199 of file class.ilObjRoleFolderGUI.php.

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 }
$_SESSION["AccountId"]
initRoleSearchForm()
Init role search form.

References $_SESSION, $ilCtrl, initRoleSearchForm(), roleSearchListObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ roleSearchListObject()

ilObjRoleFolderGUI::roleSearchListObject ( )
protected

List roles.

Definition at line 221 of file class.ilObjRoleFolderGUI.php.

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 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_SESSION, $ilCtrl, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilRoleTableGUI\TYPE_SEARCH.

Referenced by roleSearchFormObject().

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

◆ roleSearchObject()

ilObjRoleFolderGUI::roleSearchObject ( )
protected

Search target roles.

Definition at line 149 of file class.ilObjRoleFolderGUI.php.

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 }

References $ilCtrl, $ilErr, initRoleSearchForm(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveObject()

ilObjRoleFolderGUI::saveObject ( )

save object @access public

Reimplemented from ilObjectGUI.

Definition at line 738 of file class.ilObjRoleFolderGUI.php.

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 }
$_GET["client_id"]

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

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjRoleFolderGUI::saveSettingsObject ( )

Definition at line 803 of file class.ilObjRoleFolderGUI.php.

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');
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');
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 }
editSettingsObject(ilPropertyFormGUI $a_form=null)

References $_POST, $ilErr, $ilUser, ilPrivacySettings\_getInstance(), ilSecuritySettings\_getInstance(), ilObjectGUI\checkPermissionBool(), editSettingsObject(), initSettingsForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ showPossibleSubObjects()

ilObjRoleFolderGUI::showPossibleSubObjects ( )

show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders

@access public

Reimplemented from ilObjectGUI.

Definition at line 683 of file class.ilObjRoleFolderGUI.php.

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 }
for($col=0; $col< 50; $col++) $d
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.

References $d, $row, and ilUtil\formSelect().

+ Here is the call graph for this function:

◆ viewObject()

ilObjRoleFolderGUI::viewObject ( )

@global ilErrorHandler $ilErr @global ilRbacSystem $rbacsystem @global ilToolbarGUI $ilToolbar

Reimplemented from ilObjectGUI.

Definition at line 96 of file class.ilObjRoleFolderGUI.php.

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 }

References $ilErr.

Referenced by applyFilterObject(), and resetFilterObject().

+ Here is the caller graph for this function:

Field Documentation

◆ $type

ilObjRoleFolderGUI::$type

Definition at line 45 of file class.ilObjRoleFolderGUI.php.


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