24 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
51 public function __construct($a_data, $a_id, $a_call_by_reference)
56 parent::__construct($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();
68 switch ($next_class) {
70 case 'ilpermissiongui':
71 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
73 $ret =&$this->ctrl->forwardCommand($perm_gui);
98 $ilTabs->activateTab(
'view');
100 if (!$rbacsystem->checkAccess(
'visible,read', $this->object->getRefId())) {
101 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
105 if ($rbacsystem->checkAccess(
'create_role', $this->object->getRefId())) {
106 $this->ctrl->setParameter($this,
'new_type',
'role');
107 $ilToolbar->addButton(
108 $this->lng->txt(
'rolf_create_role'),
109 $this->ctrl->getLinkTarget($this,
'create')
112 if ($rbacsystem->checkAccess(
'create_rolt', $this->object->getRefId())) {
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);
122 $rbacsystem->checkAccess(
'create_rolt', $this->object->getRefId()) ||
123 $rbacsystem->checkAccess(
'create_rolt', $this->object->getRefId())
125 $ilToolbar->addButton(
126 $this->lng->txt(
'rbac_import_role'),
127 $this->ctrl->getLinkTargetByClass(
'ilPermissionGUI',
'displayImportRoleForm')
131 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
136 $this->tpl->setContent(
$table->getHTML());
146 $ilTabs->clearTargets();
147 $ilTabs->setBackTarget(
148 $this->lng->txt(
'rbac_back_to_overview'),
149 $this->ctrl->getLinkTarget($this,
'view')
152 if (!$rbacsystem->checkAccess(
'visible,read', $this->object->getRefId())) {
153 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
156 $ilCtrl->setParameter($this,
'copy_source', (
int) $_REQUEST[
'copy_source']);
160 $this->tpl->setContent($form->getHTML());
170 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
172 $form->setTitle($this->lng->txt(
'rbac_role_title'));
173 $form->setFormAction($ilCtrl->getFormAction($this,
'view'));
177 $search->setSize(30);
178 $search->setMaxLength(255);
179 $form->addItem($search);
181 $form->addCommandButton(
'roleSearchForm', $this->lng->txt(
'search'));
196 $ilCtrl->setParameter($this,
'copy_source', (
int) $_REQUEST[
'copy_source']);
199 if (
$form->checkInput()) {
205 $form->setValuesByPost();
206 $ilCtrl->redirect($this,
'roleSearch');
216 $ilTabs->clearTargets();
217 $ilTabs->setBackTarget(
218 $this->lng->txt(
'rbac_back_to_overview'),
219 $this->ctrl->getLinkTarget($this,
'roleSearchList')
222 $ilCtrl->setParameter($this,
'copy_source', (
int) $_REQUEST[
'copy_source']);
224 if (strlen(
$_SESSION[
'rolf_search_query'])) {
227 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
233 return $this->tpl->setContent(
$table->getHTML());
237 $ilCtrl->redirect($this,
'roleSearch');
248 $ilCtrl->saveParameter($this,
'copy_source', (
int) $_REQUEST[
'copy_source']);
249 $ilTabs->clearTargets();
250 $ilTabs->setBackTarget(
251 $this->lng->txt(
'rbac_back_to_overview'),
252 $this->ctrl->getLinkTarget($this,
'roleSearchList')
255 $this->tpl->setContent(
$form->getHTML());
265 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
267 $form->setTitle($this->lng->txt(
'rbac_copy_behaviour'));
268 $form->setFormAction($ilCtrl->getFormAction($this,
'chooseCopyBehaviour'));
275 $ceo =
new ilRadioOption($this->lng->txt(
'change_existing_objects'), 1);
276 $ce->addOption($ceo);
278 $cne =
new ilRadioOption($this->lng->txt(
'rbac_not_change_existing_objects'), 0);
279 $ce->addOption($cne);
282 $roles->setValue(implode(
',', (
array)
$_POST[
'roles']));
283 $form->addItem($roles);
288 $form->addCommandButton(
'addRolePermissions', $this->lng->txt(
'rbac_copy_role_add_perm'));
289 $form->addCommandButton(
'removeRolePermissions', $this->lng->txt(
'rbac_copy_role_remove_perm'));
290 $form->addCommandButton(
'copyRole', $this->lng->txt(
'rbac_copy_role_copy'));
292 $form->addCommandButton(
'copyRole', $this->lng->txt(
'rbac_copy_role'));
306 $roles = explode(
',',
$_POST[
'roles']);
307 $source = (int) $_REQUEST[
'copy_source'];
310 if (
$form->checkInput()) {
311 foreach ((
array) $roles as $role_id) {
318 $ilCtrl->redirect($this,
'view');
330 $roles = explode(
',',
$_POST[
'roles']);
331 $source = (int) $_REQUEST[
'copy_source'];
334 if (
$form->checkInput()) {
335 foreach ((
array) $roles as $role_id) {
342 $ilCtrl->redirect($this,
'view');
353 $rbacadmin->copyRolePermissionUnion(
355 $this->
object->getRefId(),
357 $rbacreview->getRoleFolderOfRole(
$target),
359 $rbacreview->getRoleFolderOfRole(
$target)
362 if ($change_existing) {
363 $target_obj = $rbacreview->getRoleFolderOfRole(
$target);
376 $roles = explode(
',',
$_POST[
'roles']);
377 $source = (int) $_REQUEST[
'copy_source'];
380 if (
$form->checkInput()) {
381 foreach ((
array) $roles as $role_id) {
388 $ilCtrl->redirect($this,
'view');
403 $rbacadmin->copyRolePermissionSubtract(
405 $this->
object->getRefId(),
407 $rbacreview->getRoleFolderOfRole(
$target)
410 if ($change_existing) {
411 $target_obj = $rbacreview->getRoleFolderOfRole(
$target);
432 $target_obj = $rbacreview->getRoleFolderOfRole(
$target);
435 $rbacadmin->copyRoleTemplatePermissions(
437 $this->
object->getRefId(),
442 if (!$change_existing || !$target_obj) {
446 $start = $target_obj;
448 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
449 if ($rbacreview->isProtected($this->object->getRefId(),
$source)) {
457 $role->changeExistingObjects(
479 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
480 if ($rbacreview->isProtected($this->object->getRefId(), $a_source_role)) {
488 $role->changeExistingObjects(
502 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
506 $table->writeFilterToSession();
516 include_once
'./Services/AccessControl/classes/class.ilRoleTableGUI.php';
532 if (!count(
$_POST[
'roles'])) {
534 $ilCtrl->redirect($this,
'view');
537 $question = $this->lng->txt(
'rbac_role_delete_qst');
539 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
541 $confirm->setHeaderText($question);
542 $confirm->setFormAction($ilCtrl->getFormAction($this));
543 $confirm->setHeaderText($this->lng->txt(
"info_delete_sure"));
544 $confirm->setConfirm($this->lng->txt(
'delete'),
'deleteRole');
545 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
548 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
549 foreach (
$_POST[
'roles'] as $role_id) {
556 $this->tpl->setContent($confirm->getHTML());
566 if (!$rbacsystem->checkAccess(
'delete', $this->object->getRefId())) {
568 $this->lng->txt(
'msg_no_perm_delete'),
577 if ($obj->getType() ==
"role") {
578 $rolf_arr = $rbacreview->getFoldersAssignedToRole($obj->getId(),
true);
579 $obj->setParent($rolf_arr[0]);
587 $ilCtrl->redirect($this,
'view');
601 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
618 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
630 $this->ctrl->redirect($this,
"view");
643 $d = $this->objDefinition->getCreatableSubObjects($this->
object->getType());
645 if ($this->
object->getRefId() != ROLE_FOLDER_ID or !$rbacsystem->checkAccess(
'create_rolt', ROLE_FOLDER_ID)) {
649 if (!$rbacsystem->checkAccess(
'create_role', $this->object->getRefId())) {
656 if ($row[
"max"] > 0) {
658 for (
$i=0;
$i<count($this->
data[
"ctrl"]);
$i++) {
659 if ($this->
data[
"ctrl"][
$i][
"type"] == $row[
"name"]) {
664 if ($row[
"max"] ==
"" || $count < $row[
"max"]) {
665 $subobj[] = $row[
"name"];
670 if (is_array($subobj)) {
673 $this->tpl->setCurrentBlock(
"add_object");
674 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
675 $this->tpl->setVariable(
"BTN_NAME",
"create");
676 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
677 $this->tpl->parseCurrentBlock();
690 $_GET[
"new_type"] = $this->
object->getType();
691 $_POST[
"Fobject"][
"title"] = $this->
object->getTitle();
692 $_POST[
"Fobject"][
"desc"] = $this->
object->getDescription();
695 $newObj = parent::saveObject();
702 $this->ctrl->redirect($this,
"view");
714 $this->tabs_gui->addTarget(
716 $this->ctrl->getLinkTarget($this,
"view"),
721 $this->tabs_gui->addTarget(
723 $this->ctrl->getLinkTarget($this,
"editSettings"),
724 array(
"editSettings"),
730 $this->tabs_gui->addTarget(
732 $this->ctrl->getLinkTargetByClass(
733 array(get_class($this),
'ilpermissiongui'),
748 $this->tpl->setContent($a_form->getHTML());
756 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->MESSAGE);
760 if (
$form->checkInput()) {
761 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
763 $privacy->enableRbacLog((
int)
$_POST[
'rbac_log']);
764 $privacy->setRbacLogAge((
int) $_POST[
'rbac_log_age']);
767 if ($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID)) {
768 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
770 $security->protectedAdminRole((
int) $_POST[
'admin_role']);
775 $this->ctrl->redirect($this,
"editSettings");
778 $form->setValuesByPost();
786 $this->lng->loadLanguageModule(
'ps');
788 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
789 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
793 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
795 $form->setFormAction($this->ctrl->getFormAction($this,
"saveSettings"));
796 $form->setTitle($this->lng->txt(
'settings'));
800 $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID));
801 $admin->setInfo($this->lng->txt(
'adm_adm_role_protect_info'));
802 $admin->setChecked((
int) $security->isAdminRoleProtected());
804 $form->addItem($admin);
806 $check =
new ilCheckboxInputGui($this->lng->txt(
'rbac_log'),
'rbac_log');
807 $check->setInfo($this->lng->txt(
'rbac_log_info'));
808 $check->setChecked($privacy->enabledRbacLog());
809 $form->addItem($check);
811 $age =
new ilNumberInputGUI($this->lng->txt(
'rbac_log_age'),
'rbac_log_age');
812 $age->
setInfo($this->lng->txt(
'rbac_log_age_info'));
813 $age->setValue($privacy->getRbacLogAge());
814 $age->setMinValue(1);
815 $age->setMaxValue(24);
817 $age->setMaxLength(2);
818 $check->addSubItem($age);
820 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
827 switch ($a_form_id) {
830 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
839 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
843 if ((
bool) $privacy->enabledRbacLog()) {
844 $subitems =
array(
'rbac_log_age' => $privacy->getRbacLogAge());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
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.
deleteObject($a_error=false)
display deletion confirmation screen DEPRECATED !!! public
if(!array_key_exists('StateId', $_REQUEST)) $id
static _lookupTitle($a_id)
lookup object title
deleteRoleObject()
Delete roles.
roleSearchListObject()
List roles.
Class ilObjRoleFolderGUI.
TableGUI for the presentation og roles and role templates.
__construct($a_data, $a_id, $a_call_by_reference)
Constructor public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
prepareOutput($a_show_subobjects=true)
prepare output
if(isset($_POST['submit'])) $form
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.
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
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.
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
Create new PHPExcel object
obj_idprivate
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.
static _getInstance()
Get instance of ilPrivacySettings.
if(empty($password)) $table
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.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
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.