60 $this->
access = $DIC->access();
61 $this->component_repository =
$DIC[
"component.repository"];
62 $this->
ctrl = $DIC->ctrl();
63 $this->global_settings =
$DIC->settings();
64 $this->
lng = $DIC->language();
65 $this->
lng->loadLanguageModule(
'shib');
66 $this->
rbac = $DIC->rbac();
67 $this->rbac_review =
$DIC->rbac()->review();
70 $this->tabs_gui =
$DIC->tabs();
71 $this->tpl =
$DIC->ui()->mainTemplate();
72 $this->wrapper =
$DIC->http()->wrapper();
81 $cmd = $this->
ctrl->getCmd();
82 if (!$this->
access->checkAccess(
'read',
'', $this->ref_id)) {
85 if ($cmd !==
"settings" && !$this->
access->checkAccess(
'write',
'', $this->ref_id)) {
86 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_write'),
true);
87 $this->
ctrl->redirect($this,
"settings");
101 $this->tabs_gui->activateSubTab(
'shib_settings');
103 $this->shib_settings,
104 $this->
ctrl->getLinkTarget($this,
'save')
116 $this->shib_settings,
117 $this->
ctrl->getLinkTarget($this,
'save')
120 if (
$form->saveObject()) {
121 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"shib_settings_saved"),
true);
122 $this->
ctrl->redirect($this,
'settings');
132 $this->tabs_gui->activateSubTab(
'shib_role_assignment');
134 $this->tpl->addBlockFile(
137 'tpl.shib_role_assignment.html',
138 'components/ILIAS/AuthShibboleth'
140 $this->tpl->setVariable(
'NEW_RULE_TABLE', $this->
form->getHTML());
142 $this->tpl->setVariable(
'RULE_TABLE', $html);
157 $rules_table->setTitle($this->
lng->txt(
'shib_rules_tables'));
158 $rules_table->parse(ilShibbolethRoleAssignmentRules::getAllRules());
159 $rules_table->addMultiCommand(
"confirmDeleteRules", $this->
lng->txt(
"delete"));
160 $rules_table->setSelectAllCheckbox(self::PARAM_RULE_ID);
162 return $rules_table->getHTML();
170 if (!$this->wrapper->post()->has(
'rule_ids')) {
171 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
176 $this->tabs_gui->activateTab(
'shib_role_assignment');
179 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteRules"));
180 $c_gui->setHeaderText($this->
lng->txt(
"shib_confirm_del_role_ass"));
181 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"roleAssignment");
182 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteRules");
184 $rule_ids = $this->wrapper->post()->retrieve(
186 $this->
refinery->to()->listOf($this->refinery->kindlyTo()->int())
188 foreach ($rule_ids as $rule_id) {
194 $c_gui->addItem(
'rule_ids[]', $rule_id,
$info);
196 $this->tpl->setContent($c_gui->getHTML());
205 if (!$this->wrapper->post()->has(
'rule_ids')) {
206 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_once'));
211 $rule_ids = $this->wrapper->post()->retrieve(
213 $this->
refinery->to()->listOf($this->refinery->kindlyTo()->int())
215 foreach ($rule_ids as $rule_id) {
219 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'shib_deleted_rule'));
231 $this->
form->setFormAction($this->
ctrl->getFormAction($this,
'cancel'));
232 $this->
form->setTitle($this->
lng->txt(
'shib_role_ass_table'));
233 if ($a_mode ===
'default') {
234 $this->
form->setTitle($this->
lng->txt(
'shib_role_ass_table'));
235 $this->
form->addCommandButton(
'addRoleAssignmentRule', $this->
lng->txt(
'shib_new_rule'));
236 $this->
form->addCommandButton(
'settings', $this->
lng->txt(
'cancel'));
238 $this->
form->setTitle($this->
lng->txt(
'shib_update_role_ass_table'));
239 $this->
form->addCommandButton(
'updateRoleAssignmentRule', $this->
lng->txt(
'save'));
240 $this->
form->addCommandButton(
'roleAssignment', $this->
lng->txt(
'cancel'));
244 $role->setRequired(
true);
246 $role->addOption($global);
249 $global->addSubItem($role_select);
251 $role->addOption($local);
253 $role_search->setSize(40);
254 $local->addSubItem($role_search);
255 $role->setInfo($this->
lng->txt(
'shib_role_name_info'));
256 $this->
form->addItem($role);
259 $update->setValue($this->
lng->txt(
'shib_check_role_assignment'));
261 $add->setOptionTitle($this->
lng->txt(
'shib_add_missing'));
263 $update->addSubItem($add);
265 $remove->setOptionTitle($this->
lng->txt(
'shib_remove_deprecated'));
266 $remove->setValue(1);
267 $update->addSubItem($remove);
268 $this->
form->addItem($update);
272 $kind->setRequired(
true);
274 $attr->setInfo($this->
lng->txt(
'shib_attr_info'));
277 $attr->addSubItem($name);
278 $value =
new ilTextInputGUI($this->
lng->txt(
'shib_attribute_value'),
'attr_value');
280 $attr->addSubItem($value);
281 $kind->addOption($attr);
282 $pl_active = $this->component_repository->getPluginSlotById(
'shibhk')->hasActivePlugins();
284 $pl->setInfo($this->
lng->txt(
'shib_plugin_info'));
285 $pl->setDisabled(!$pl_active);
287 $id->setDisabled(!$pl_active);
289 $id->setMaxLength(3);
290 $id->setMaxValue(999);
292 $pl->addSubItem(
$id);
293 $kind->addOption($pl);
294 $this->
form->addItem($kind);
307 if (!$this->
access->checkAccess(
'write',
'', $this->ref_id)) {
308 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
314 if (!$this->
form->checkInput() || ($err = $this->checkInput())) {
316 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($err));
318 $this->tabs_gui->activateSubTab(
'shib_role_assignment');
319 $this->
form->setValuesByPost();
320 $this->tpl->addBlockFile(
323 'tpl.shib_role_assignment.html',
324 'components/ILIAS/AuthShibboleth'
326 $this->tpl->setVariable(
'NEW_RULE_TABLE', $this->
form->getHTML());
328 $this->tpl->setVariable(
'RULE_TABLE', $html);
334 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
345 $this->
ctrl->saveParameter($this, self::PARAM_RULE_ID);
346 $this->tabs_gui->activateSubTab(
'shib_role_assignment');
349 $this->tpl->addBlockFile(
352 'tpl.shib_role_assignment.html',
353 'components/ILIAS/AuthShibboleth'
355 $this->tpl->setVariable(
'NEW_RULE_TABLE', $this->
form->getHTML());
365 if (!$this->
access->checkAccess(
'write',
'', $this->ref_id)) {
366 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
373 $role_id = $this->wrapper->query()->retrieve(self::PARAM_RULE_ID, $this->
refinery->kindlyTo()->int());
375 if (!$this->
form->checkInput() || $err = $this->checkInput($role_id)) {
377 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($err));
379 $this->tabs_gui->activateSubTab(
'shib_role_assignment');
380 $this->
form->setValuesByPost();
381 $this->tpl->addBlockFile(
384 'tpl.shib_role_assignment.html',
385 'components/ILIAS/AuthShibboleth'
387 $this->tpl->setVariable(
'NEW_RULE_TABLE', $this->
form->getHTML());
391 $this->rule->update();
392 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
401 if ((
int) $this->
form->getInput(
'role_name') === 0) {
402 $this->rule->setRoleId($this->
form->getInput(
'role_id'));
403 } elseif ($this->
form->getInput(
'role_search')) {
406 $parser->setMinWordLength(1);
410 $object_search->setFilter([
'role']);
411 $res = $object_search->performSearch();
412 $entries =
$res->getEntries();
413 if (count($entries) === 1) {
414 $role = current($entries);
415 $this->rule->setRoleId($role[
'obj_id']);
416 } elseif (count($entries) > 1) {
417 $this->rule->setRoleId(-1);
420 $this->rule->setName($this->
form->getInput(
'attr_name'));
421 $this->rule->setValue($this->
form->getInput(
'attr_value'));
422 $this->rule->enableAddOnUpdate($this->
form->getInput(
'add_missing'));
423 $this->rule->enableRemoveOnUpdate($this->
form->getInput(
'remove_deprecated'));
424 $this->rule->enablePlugin((
int) $this->
form->getInput(
'kind') === 2);
425 $this->rule->setPluginId($this->
form->getInput(
'plugin_id'));
432 $rule_id = $this->wrapper->query()->has(self::PARAM_RULE_ID)
433 ? $this->wrapper->query()->retrieve(self::PARAM_RULE_ID, $this->
refinery->kindlyTo()->int())
438 if ($this->
rbac->review()->isGlobalRole($role)) {
439 $values[
'role_name'] = 0;
440 $values[
'role_id'] = $role;
442 $values[
'role_name'] = 1;
455 $this->
form->setValuesByArray($values);
462 return $this->rule->validate();
470 $global_roles =
ilUtil::_sortIds($this->rbac_review->getGlobalRoles(),
'object_data',
'title',
'obj_id');
471 $select[0] = $this->
lng->txt(
'links_select_one');
472 foreach ($global_roles as $role_id) {
484 if (!$this->global_settings->get(
'shib_active',
'0')) {
487 $this->tabs_gui->addSubTabTarget(
'shib_settings', $this->
ctrl->getLinkTarget($this,
'settings'));
488 $this->tabs_gui->addSubTabTarget(
'shib_role_assignment', $this->
ctrl->getLinkTarget($this,
'roleAssignment'));
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Provides fluid interface to RBAC services.
Class ilAuthShibbolethSettingsGUI.
loadRule(int $a_rule_id=0)
ilGlobalTemplateInterface $tpl
__construct(private int $ref_id)
ilComponentRepository $component_repository
addRoleAutoCompleteObject()
initFormRoleAssignment(string $a_mode='default')
updateRoleAssignmentRule()
ilShibbolethSettings $shib_settings
ilRbacReview $rbac_review
ilSetting $global_settings
ilShibbolethRoleAssignmentRule $rule
checkInput(int $a_rule_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
Base class for ILIAS Exception handling.
This class represents a non editable value in a property form.
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
class ilRbacReview Contains Review functions of core Rbac.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isRemoveOnUpdateEnabled()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Readable part of repository interface to ilComponentDataDB.
form( $class_path, string $cmd, string $submit_caption="")