24 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
56 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
57 $lng->loadLanguageModule(
'rbac');
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
71 case 'ilpermissiongui':
72 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
74 $ret =& $this->ctrl->forwardCommand($perm_gui);
98 global
$ilErr, $rbacsystem, $ilToolbar,$rbacreview,$ilTabs;
100 $ilTabs->activateTab(
'view');
102 if(!$rbacsystem->checkAccess(
'visible,read',$this->object->getRefId()))
104 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
107 $this->ctrl->setParameter($this,
'new_type',
'role');
108 $ilToolbar->addButton(
109 $this->lng->txt(
'rolf_create_role'),
110 $this->ctrl->getLinkTarget($this,
'create')
113 $this->ctrl->setParameter($this,
'new_type',
'rolt');
114 $ilToolbar->addButton(
115 $this->lng->txt(
'rolf_create_rolt'),
116 $this->ctrl->getLinkTarget($this,
'create')
118 $this->ctrl->clearParameters($this);
120 $ilToolbar->addButton(
121 $this->lng->txt(
'rbac_import_role'),
122 $this->ctrl->getLinkTargetByClass(
'ilPermissionGUI',
'displayImportRoleForm')
125 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
128 $table->parse($this->object->getId());
130 $this->tpl->setContent($table->getHTML());
138 global $rbacsystem,
$ilCtrl, $ilTabs;
140 $ilTabs->clearTargets();
141 $ilTabs->setBackTarget(
142 $this->lng->txt(
'rbac_back_to_overview'),
143 $this->ctrl->getLinkTarget($this,
'view')
146 if(!$rbacsystem->checkAccess(
'visible,read',$this->object->getRefId()))
148 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
151 $ilCtrl->setParameter($this,
'copy_source',(
int)
$_REQUEST[
'copy_source']);
155 $this->tpl->setContent($form->getHTML());
165 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
167 $form->setTitle($this->lng->txt(
'rbac_role_title'));
168 $form->setFormAction($ilCtrl->getFormAction($this,
'view'));
172 $search->setSize(30);
173 $search->setMaxLength(255);
174 $form->addItem($search);
176 $form->addCommandButton(
'roleSearchForm', $this->lng->txt(
'search'));
191 $ilCtrl->setParameter($this,
'copy_source',(
int)
$_REQUEST[
'copy_source']);
194 if($form->checkInput())
196 $_SESSION[
'rolf_search_query'] = $form->getInput(
'title');
201 $form->setValuesByPost();
202 $ilCtrl->redirect($this,
'roleSearch');
212 $ilTabs->clearTargets();
213 $ilTabs->setBackTarget(
214 $this->lng->txt(
'rbac_back_to_overview'),
215 $this->ctrl->getLinkTarget($this,
'roleSearchList')
218 $ilCtrl->setParameter($this,
'copy_source',(
int)
$_REQUEST[
'copy_source']);
220 if(strlen(
$_SESSION[
'rolf_search_query']))
224 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
227 $table->setRoleTitleFilter(
$_SESSION[
'rolf_search_query']);
229 $table->parse($this->object->getId());
230 return $this->tpl->setContent($table->getHTML());
234 $ilCtrl->redirect($this,
'roleSearch');
245 $ilTabs->clearTargets();
246 $ilTabs->setBackTarget(
247 $this->lng->txt(
'rbac_back_to_overview'),
248 $this->ctrl->getLinkTarget($this,
'roleSearchList')
253 $ilCtrl->setParameter($this,
'copy_source',(
int)
$_REQUEST[
'copy_source']);
256 $this->tpl->setContent($form->getHTML());
266 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
268 $form->setTitle($this->lng->txt(
'rbac_copy_behaviour'));
269 $form->setFormAction($ilCtrl->getFormAction($this,
'chooseCopyBehaviour'));
276 $ceo =
new ilRadioOption($this->lng->txt(
'change_existing_objects'),1);
277 $ce->addOption($ceo);
279 $cne =
new ilRadioOption($this->lng->txt(
'rbac_not_change_existing_objects'), 0);
280 $ce->addOption($cne);
283 $roles->setValue(implode(
',',(array)
$_POST[
'roles']));
284 $form->addItem($roles);
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'));
296 $form->addCommandButton(
'copyRole', $this->lng->txt(
'rbac_copy_role'));
310 $roles = explode(
',',
$_POST[
'roles']);
311 $source = (int)
$_REQUEST[
'copy_source'];
314 if($form->checkInput())
316 foreach((array) $roles as $role_id)
318 if($role_id != $source)
320 $this->
doCopyRole($source,$role_id,$form->getInput(
'change_existing'));
325 $ilCtrl->redirect($this,
'view');
337 $roles = explode(
',',
$_POST[
'roles']);
338 $source = (int)
$_REQUEST[
'copy_source'];
341 if($form->checkInput())
343 foreach((array) $roles as $role_id)
345 if($role_id != $source)
352 $ilCtrl->redirect($this,
'view');
361 global $rbacadmin, $rbacreview;
363 $rbacadmin->copyRolePermissionUnion(
365 $this->object->getRefId(),
367 $rbacreview->getRoleFolderOfRole($target),
369 $rbacreview->getRoleFolderOfRole($target)
374 $target_obj = $rbacreview->getRoleFolderOfRole($target);
387 $roles = explode(
',',
$_POST[
'roles']);
388 $source = (int)
$_REQUEST[
'copy_source'];
391 if($form->checkInput())
393 foreach((array) $roles as $role_id)
395 if($role_id != $source)
402 $ilCtrl->redirect($this,
'view');
411 global $rbacadmin, $rbacreview;
417 $rbacadmin->copyRolePermissionSubtract(
419 $this->object->getRefId(),
421 $rbacreview->getRoleFolderOfRole($target)
426 $target_obj = $rbacreview->getRoleFolderOfRole($target);
443 protected function doCopyRole($source, $target, $change_existing)
445 global
$tree, $rbacadmin, $rbacreview;
447 $target_obj = $rbacreview->getRoleFolderOfRole($target);
450 $rbacadmin->copyRoleTemplatePermissions(
452 $this->object->getRefId(),
457 if(!$change_existing || !$target_obj)
462 $start = $target_obj;
464 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
465 if($rbacreview->isProtected($this->object->getRefId(),$source))
477 $role->changeExistingObjects(
500 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
501 if($rbacreview->isProtected($this->object->getRefId(),$a_source_role))
513 $role->changeExistingObjects(
528 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
531 $table->resetOffset();
532 $table->writeFilterToSession();
542 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
545 $table->resetOffset();
546 $table->resetFilter();
558 if(!count(
$_POST[
'roles']))
561 $ilCtrl->redirect($this,
'view');
564 $question = $this->lng->txt(
'rbac_role_delete_qst');
566 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
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');
575 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
576 foreach(
$_POST[
'roles'] as $role_id)
584 $this->tpl->setContent($confirm->getHTML());
594 if(!$rbacsystem->checkAccess(
'delete',$this->object->getRefId()))
597 $this->lng->txt(
'msg_no_perm_delete'),
602 foreach((array)
$_POST[
'roles'] as $id)
607 if ($obj->getType() ==
"role")
609 $rolf_arr = $rbacreview->getFoldersAssignedToRole($obj->getId(),
true);
610 $obj->setParent($rolf_arr[0]);
618 $ilCtrl->redirect($this,
'view');
632 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->MESSAGE);
649 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->MESSAGE);
661 $this->ctrl->redirect($this,
"view");
674 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
676 if ($this->object->getRefId() != ROLE_FOLDER_ID or !$rbacsystem->checkAccess(
'create_rolt',ROLE_FOLDER_ID))
681 if (!$rbacsystem->checkAccess(
'create_role',$this->object->getRefId()))
694 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
696 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
702 if ($row[
"max"] ==
"" || $count < $row[
"max"])
704 $subobj[] = $row[
"name"];
709 if (is_array($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();
732 $_GET[
"new_type"] = $this->
object->getType();
733 $_POST[
"Fobject"][
"title"] = $this->
object->getTitle();
734 $_POST[
"Fobject"][
"desc"] = $this->
object->getDescription();
737 $newObj = parent::saveObject();
744 $this->ctrl->redirect($this,
"view");
759 $tabs_gui->addTarget(
761 $this->ctrl->getLinkTarget($this,
"view"),
766 $tabs_gui->addTarget(
768 $this->ctrl->getLinkTarget($this,
"editSettings"),
769 array(
"editSettings"),
776 $tabs_gui->addTarget(
"perm_settings",
777 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
791 $this->tpl->setContent($a_form->getHTML());
800 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
804 if($form->checkInput())
806 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
808 $privacy->enableRbacLog((
int)
$_POST[
'rbac_log']);
809 $privacy->setRbacLogAge((
int) $_POST[
'rbac_log_age']);
812 if($rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
814 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
816 $security->protectedAdminRole((
int) $_POST[
'admin_role']);
821 $this->ctrl->redirect($this,
"editSettings");
824 $form->setValuesByPost();
832 $this->lng->loadLanguageModule(
'ps');
834 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
835 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
839 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
841 $form->setFormAction($this->ctrl->getFormAction($this,
"saveSettings"));
842 $form->setTitle($this->lng->txt(
'settings'));
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());
850 $form->addItem($admin);
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);
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);
863 $age->setMaxLength(2);
864 $check->addSubItem($age);
866 $form->addCommandButton(
'saveSettings',$this->lng->txt(
'save'));
877 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
882 return array(array(
"editSettings", $fields));
886 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
890 if((
bool)$privacy->enabledRbacLog())
892 $subitems = array(
'rbac_log_age' => $privacy->getRbacLogAge());
896 return array(array(
"editSettings", $fields));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
confirmDeleteObject()
Confirm deletion of roles.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
_getTranslation($a_role_title)
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
static _lookupTitle($a_id)
lookup object title
deleteRoleObject()
Delete roles.
roleSearchListObject()
List roles.
Class ilObjRoleFolderGUI.
TableGUI for the presentation og roles and role templates.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
deleteObject()
display deletion confirmation screen DEPRECATED !!! public
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.
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.
copyRoleObject()
Copy role.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
static _getInstance()
Get instance of ilPrivacySettings.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
addToExternalSettingsForm($a_form_id)
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.
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.