19 declare(strict_types=1);
37 private ILIAS\Http\Services
$http;
42 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
48 $this->
logger = $DIC->logger()->auth();
50 $this->
ui = $DIC->ui()->factory();
51 $this->renderer = $DIC->ui()->renderer();
52 $this->
http = $DIC->http();
54 $this->
lng->loadLanguageModule(
'registration');
55 $this->
lng->loadLanguageModule(
'auth');
56 $this->
lng->loadLanguageModule(
'content');
57 $this->content_style_gui = $DIC->contentStyle()->gui();
70 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
71 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
74 $this->tabs_gui->setTabActive(
'authentication_settings');
76 $this->tabs_gui->setSubTabActive(
"auth_settings");
78 $generalSettingsTpl =
new ilTemplate(
'tpl.auth_general.html',
true,
true,
'components/ILIAS/Authentication');
80 $generalSettingsTpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
81 $generalSettingsTpl->setVariable(
"TXT_AUTH_TITLE", $this->
lng->txt(
"auth_select"));
83 $generalSettingsTpl->setVariable(
"TXT_AUTH_MODE", $this->
lng->txt(
"auth_mode"));
84 $generalSettingsTpl->setVariable(
"TXT_AUTH_DEFAULT", $this->
lng->txt(
"default"));
85 $generalSettingsTpl->setVariable(
"TXT_AUTH_ACTIVE", $this->
lng->txt(
"active"));
86 $generalSettingsTpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->
lng->txt(
"num_users"));
88 $generalSettingsTpl->setVariable(
"TXT_LOCAL", $this->
lng->txt(
"auth_local"));
89 $generalSettingsTpl->setVariable(
"TXT_LDAP", $this->
lng->txt(
"auth_ldap"));
90 $generalSettingsTpl->setVariable(
"TXT_SHIB", $this->
lng->txt(
"auth_shib"));
92 $generalSettingsTpl->setVariable(
"TXT_CAS", $this->
lng->txt(
"auth_cas"));
94 $generalSettingsTpl->setVariable(
"TXT_SCRIPT", $this->
lng->txt(
"auth_script"));
96 $generalSettingsTpl->setVariable(
"TXT_APACHE", $this->
lng->txt(
"auth_apache"));
111 $icon_ok = $this->renderer->render(
114 $icon_not_ok = $this->renderer->render(
118 $this->
logger->debug(print_r($auth_modes,
true));
119 foreach ($auth_modes as $mode => $mode_name) {
124 $generalSettingsTpl->setCurrentBlock(
'auth_mode');
128 $generalSettingsTpl->setVariable(
"AUTH_NAME",
$server->getName());
129 $generalSettingsTpl->setVariable(
'AUTH_ACTIVE',
$server->isActive() ? $icon_ok : $icon_not_ok);
132 $generalSettingsTpl->setVariable(
'AUTH_NAME', $idp->getEntityId());
133 $generalSettingsTpl->setVariable(
'AUTH_ACTIVE', $idp->isActive() ? $icon_ok : $icon_not_ok);
135 $generalSettingsTpl->setVariable(
"AUTH_NAME", $this->
lng->txt(
"auth_" . $mode_name));
138 $generalSettingsTpl->setVariable(
"AUTH_NAME", $this->
lng->txt(
"auth_" . $mode_name));
139 $generalSettingsTpl->setVariable(
'AUTH_ACTIVE', $this->
ilias->getSetting($mode_name .
'_active') || (
int) $mode ===
ilAuthUtils::AUTH_LOCAL ? $icon_ok : $icon_not_ok);
142 $auth_cnt_mode = $auth_cnt[$mode_name] ?? 0;
143 if ($this->
settings->get(
'auth_mode') === (string) $mode) {
144 $generalSettingsTpl->setVariable(
"AUTH_CHECKED",
"checked=\"checked\"");
145 $auth_cnt_default = $auth_cnt[
"default"] ?? 0;
146 $generalSettingsTpl->setVariable(
148 ((
int) $auth_cnt_mode + $auth_cnt_default) .
" (" . $this->
lng->txt(
"auth_per_default") .
149 ": " . $auth_cnt_default .
")" 152 $generalSettingsTpl->setVariable(
157 $generalSettingsTpl->setVariable(
"AUTH_ID", $mode_name);
158 $generalSettingsTpl->setVariable(
"AUTH_VAL", $mode);
159 $generalSettingsTpl->parseCurrentBlock();
162 $generalSettingsTpl->setVariable(
"TXT_CONFIGURE", $this->
lng->txt(
"auth_configure"));
164 if ($this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
165 $generalSettingsTpl->setVariable(
"TXT_AUTH_REMARK", $this->
lng->txt(
"auth_remark_non_local_auth"));
166 $generalSettingsTpl->setCurrentBlock(
'auth_mode_submit');
167 $generalSettingsTpl->setVariable(
"TXT_SUBMIT", $this->
lng->txt(
"save"));
168 $generalSettingsTpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
169 $generalSettingsTpl->parseCurrentBlock();
174 $generalSettingsTpl->setVariable(
'TABLE_AUTH_DETERMINATION', $this->
form->getHTML());
178 $generalSettingsTpl->setVariable(
180 $this->
ctrl->getFormAction($this)
182 $generalSettingsTpl->setVariable(
"TXT_AUTH_ROLES", $this->
lng->txt(
"auth_active_roles"));
183 $generalSettingsTpl->setVariable(
"TXT_ROLE", $this->
lng->txt(
"obj_role"));
184 $generalSettingsTpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->
lng->txt(
"auth_role_auth_mode"));
185 if ($this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
186 $generalSettingsTpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
187 $generalSettingsTpl->setVariable(
'BTN_SUBMIT_ROLES', $this->
lng->txt(
'save'));
195 foreach ($reg_roles as $role) {
196 foreach ($active_auth_modes as $auth_name => $auth_key) {
200 if ($auth_name ===
"default" || $auth_name ===
"cas" 201 || $auth_name ===
'saml' 202 || $auth_name ===
"shibboleth" || $auth_name ===
'ldap' 203 || $auth_name ===
'apache' || $auth_name ===
"ecs" 204 || $auth_name ===
"openid") {
208 $generalSettingsTpl->setCurrentBlock(
"auth_mode_selection");
210 if ($auth_name ===
'default') {
217 $name = $idp->getEntityId();
219 $name = $this->
lng->txt(
'auth_' . $auth_name);
222 $generalSettingsTpl->setVariable(
"AUTH_MODE_NAME", $name);
224 $generalSettingsTpl->setVariable(
"AUTH_MODE", $auth_name);
226 if ($role[
'auth_mode'] === $auth_name) {
227 $generalSettingsTpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
230 $generalSettingsTpl->parseCurrentBlock();
233 $generalSettingsTpl->setCurrentBlock(
"roles");
234 $generalSettingsTpl->setVariable(
"ROLE", $role[
'title']);
236 $generalSettingsTpl->setVariable(
"ROLE_ID",
"r_" . $role[
'id']);
237 $generalSettingsTpl->parseCurrentBlock();
240 $default_auth_info = $this->ui_factory->messageBox()->info(
241 $this->
lng->txt(
'auth_mode_default_change_info')
244 $this->tpl->setContent($this->ui_renderer->render($default_auth_info) . $generalSettingsTpl->get());
255 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
256 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
259 $this->tabs_gui->setTabActive(
"authentication_settings");
261 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
263 $this->
lng->loadLanguageModule(
"meta");
265 $this->tpl->addBlockFile(
268 "tpl.auth_login_messages.html",
269 "components/ILIAS/Authentication" 271 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
272 $this->tpl->setVariable(
"TXT_HEADLINE", $this->
lng->txt(
"login_information"));
273 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->
lng->txt(
"login_information_desc"));
274 $this->tpl->setVariable(
"TXT_SUBMIT", $this->
lng->txt(
"save"));
275 $this->tpl->setVariable(
'LOGIN_INFO', $this->
form->getHTML());
281 $this->
ctrl->redirect($this,
"authSettings");
286 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
287 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
289 $this->
logger->debug(
'auth mode available:' . $this->request_wrapper->has(
"auth_mode"));
291 if (!$this->
http->wrapper()->post()->has(
"auth_mode")) {
292 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
294 $new_auth_mode = $this->
http->wrapper()->post()->retrieve(
"auth_mode", $this->
refinery->to()->string());
295 $this->
logger->debug(
'auth mode:' . $new_auth_mode);
296 $current_auth_mode = $this->
settings->get(
'auth_mode',
'');
297 if ($new_auth_mode === $current_auth_mode) {
298 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"auth_mode") .
": " . $this->
getAuthModeTitle() .
" " . $this->
lng->txt(
"auth_mode_not_changed"),
true);
299 $this->
ctrl->redirect($this,
'authSettings');
302 switch ((
int) $new_auth_mode) {
319 if ($this->
object->checkAuthSHIB() !==
true) {
320 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"auth_shib_not_configured"),
true);
324 $this->
ctrl->getLinkTargetByClass(
325 ilAuthShibbolethSettingsGUI::class,
337 if ($this->
object->checkAuthScript() !==
true) {
338 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"auth_script_not_configured"),
true);
344 $this->
ilias->setSetting(
"auth_mode", $new_auth_mode);
346 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_default_mode_changed_to") .
" " . $this->
getAuthModeTitle(),
true);
347 $this->
ctrl->redirect($this,
'authSettings');
351 string $submit_action
354 $role_list = $this->rbac_review->getRolesByFilter(2, $this->
object->getId());
357 foreach ($role_list as $role) {
358 $roles[$role[
'obj_id']] = $role[
'title'];
361 $active = $this->
ui->input()->field()
362 ->checkbox($this->
lng->txt(
"active"))
365 $server = $this->
ui->input()->field()->text(
366 $this->
lng->txt(
"server"),
367 $this->
lng->txt(
"auth_soap_server_desc")
368 )->withRequired(
true)
370 ->withValue($this->
settings->get(
"soap_auth_server",
""));
372 $port = $this->
ui->input()->field()->numeric(
373 $this->
lng->txt(
"port"),
374 $this->
lng->txt(
"auth_soap_port_desc")
377 $this->
refinery->int()->isLessThan(65536)
380 $use_https = $this->
ui->input()->field()->checkbox($this->
lng->txt(
"auth_soap_use_https"))
383 $uri = $this->
ui->input()->field()->text(
384 $this->
lng->txt(
"uri"),
385 $this->
lng->txt(
"auth_soap_uri_desc")
386 )->withMaxLength(256)
387 ->withValue($this->
settings->get(
"soap_auth_uri",
""));
390 $this->
lng->txt(
"auth_soap_namespace"),
391 $this->
lng->txt(
"auth_soap_namespace_desc")
392 )->withMaxLength(256)
393 ->withValue($this->
settings->get(
"soap_auth_namespace",
""));
395 $dotnet = $this->
ui->input()->field()->checkbox($this->
lng->txt(
"auth_soap_use_dotnet"))
398 $createuser = $this->
ui->input()->field()->checkbox(
399 $this->
lng->txt(
"auth_create_users"),
400 $this->
lng->txt(
"auth_soap_create_users_desc")
403 $sendmail = $this->
ui->input()->field()->checkbox(
404 $this->
lng->txt(
"user_send_new_account_mail"),
405 $this->
lng->txt(
"auth_new_account_mail_desc")
408 $defaultrole = $this->
ui->input()->field()->select(
409 $this->
lng->txt(
"auth_user_default_role"),
411 $this->
lng->txt(
"auth_soap_user_default_role_desc")
415 $allowlocal = $this->
ui->input()->field()->checkbox(
416 $this->
lng->txt(
"auth_allow_local"),
417 $this->
lng->txt(
"auth_soap_allow_local_desc")
420 $form = $this->
ui->input()->container()->form()->standard(
422 [
"active" => $active,
425 "use_https" => $use_https,
429 "createuser" => $createuser,
430 "sendmail" => $sendmail,
431 "defaultrole" => $defaultrole,
432 "allowlocal" => $allowlocal
439 string $submit_action
448 ->checkbox(
"new_user");
449 $form = $this->
ui->input()->container()->form()->standard(
455 )->withSubmitLabel(
"Send");
465 if (!$this->rbac_system->checkAccess(
"read", $this->object->getRefId())) {
466 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
469 $soap_form = $this->
buildSOAPForm($this->
ctrl->getFormAction($this,
"saveSOAP"));
472 $this->tabs_gui->setTabActive(
'auth_soap');
473 $panel = $this->
ui->panel()->standard(
"SOAP", [$soap_form, $test_form]);
474 $this->tpl->setContent($this->renderer->render($panel));
479 if (!$this->rbac_system->checkAccess(
"read", $this->object->getRefId())) {
480 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
484 $soap_form = $this->
buildSOAPForm($this->
ctrl->getFormAction($this,
"saveSOAP"));
486 $panel_content = [$soap_form, $test_form];
487 if ($this->request->getMethod() ==
"POST") {
488 $test_form = $test_form->withRequest($this->request);
489 $result = $test_form->getData();
490 if (!is_null($result)) {
491 $panel_content[] = $this->
ui->legacy(
496 $this->tabs_gui->setTabActive(
'auth_soap');
497 $panel = $this->
ui->panel()->standard(
"SOAP", $panel_content);
498 $this->tpl->setContent($this->renderer->render($panel));
506 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
507 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
510 $soap_form = $this->
buildSOAPForm($this->
ctrl->getFormAction($this,
"saveSOAP"));
512 if ($this->request->getMethod() ===
"POST") {
513 $soap_form = $soap_form->withRequest($this->request);
514 $result = $soap_form->getData();
515 if (!is_null($result)) {
516 $this->
settings->set(
"soap_auth_active", (
string) $result[
"active"]);
517 $this->
settings->set(
"soap_auth_server", $result[
"server"]);
518 $this->
settings->set(
"soap_auth_port", (
string) $result[
"port"]);
519 $this->
settings->set(
"soap_auth_use_https", (
string) $result[
"use_https"]);
520 $this->
settings->set(
"soap_auth_uri", $result[
"uri"]);
521 $this->
settings->set(
"soap_auth_namespace", $result[
"namespace"]);
522 $this->
settings->set(
"soap_auth_use_dotnet", (
string) $result[
"dotnet"]);
523 $this->
settings->set(
"soap_auth_create_users", (
string) $result[
"createuser"]);
524 $this->
settings->set(
"soap_auth_account_mail", (
string) $result[
"sendmail"]);
525 $this->
settings->set(
"soap_auth_user_default_role", (
string) $result[
"defaultrole"]);
526 $this->
settings->set(
"soap_auth_allow_local", (
string) $result[
"allowlocal"]);
528 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_soap_settings_saved"),
true);
529 $this->
logger->info(
"data" . print_r($result,
true));
530 $this->
ctrl->redirect($this,
'editSOAP');
534 $this->tabs_gui->setTabActive(
'auth_soap');
535 $panel = $this->
ui->panel()->standard(
"SOAP", [$soap_form, $test_form]);
536 $this->tpl->setContent($this->renderer->render($panel));
544 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
545 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
548 if ($_SESSION[
"error_post_vars"]) {
549 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", $_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
554 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME",
$settings[
"auth_script_name"]);
557 $this->tabs_gui->setTabActive(
'auth_script');
559 $this->tpl->addBlockFile(
562 "tpl.auth_script.html",
563 "components/ILIAS/Authentication" 566 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
567 $this->tpl->setVariable(
"COLSPAN", 3);
568 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->
lng->txt(
"auth_script_configure"));
569 $this->tpl->setVariable(
"TXT_OPTIONS", $this->
lng->txt(
"options"));
570 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->
lng->txt(
"auth_script_name"));
572 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->
lng->txt(
"required_field"));
573 $this->tpl->setVariable(
"TXT_CANCEL", $this->
lng->txt(
"cancel"));
574 $this->tpl->setVariable(
"TXT_SUBMIT", $this->
lng->txt(
"save"));
575 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
584 if (!
$_POST[
"auth_script"][
"name"]) {
585 $this->
ilias->raiseError($this->
lng->txt(
"fill_out_all_required_fields"), $this->
ilias->error_obj->MESSAGE);
598 $this->
ilias->setSetting(
"auth_script_name",
$_POST[
"auth_script"][
"name"]);
601 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_mode_changed_to") .
" " . $this->
getAuthModeTitle(),
true);
602 $this->
ctrl->redirect($this,
'editScript');
613 switch ($this->
ilias->getSetting(
"auth_mode")) {
615 return $this->
lng->txt(
"auth_local");
619 return $this->
lng->txt(
"auth_ldap");
623 return $this->
lng->txt(
"auth_shib");
627 return $this->
lng->txt(
"auth_saml");
632 return $this->
lng->txt(
"auth_script");
636 return $this->
lng->txt(
"auth_apache");
640 return $this->
lng->txt(
"unknown");
647 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
648 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
650 if (!$this->
http->wrapper()->post()->has(
"Fobject")) {
651 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
653 $f_object_unconverted = $this->
http->wrapper()->post()->retrieve(
659 foreach ($f_object_unconverted as $role_id => $auth_mode) {
660 $f_object[substr($role_id, 2)] = $auth_mode;
664 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_mode_roles_changed"),
true);
665 $this->
ctrl->redirect($this,
'authSettings');
673 if (isset($this->
form) && is_object($this->
form)) {
678 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
679 $this->
form->setTableWidth(
'100%');
680 $this->
form->setTitle($this->
lng->txt(
'auth_auth_settings'));
682 if ($this->
access->checkAccess(
'write',
'', $this->object->getRefId())) {
683 $this->
form->addCommandButton(
'updateAuthModeDetermination', $this->
lng->txt(
'save'));
687 if ($det->getCountActiveAuthModes() <= 1) {
692 $header->setTitle($this->
lng->txt(
'auth_auth_mode_determination'));
693 $this->
form->addItem($header);
696 $kind->
setInfo($this->
lng->txt(
'auth_mode_determination_info'));
697 $kind->setValue((
string) $det->getKind());
698 $kind->setRequired(
true);
701 $kind->addOption($option_user);
703 $option_determination =
new ilRadioOption($this->
lng->txt(
'auth_automatic'),
"1");
705 $auth_sequenced = $det->getAuthModeSequence();
708 foreach ($auth_sequenced as $auth_mode) {
709 switch ($auth_mode) {
716 $text = $this->
lng->txt(
'auth_local');
719 $text = $this->
lng->txt(
'auth_soap');
722 $text = $this->
lng->txt(
'auth_apache');
726 $option = $pl->getMultipleAuthModeOptions($auth_mode);
727 $text = $option[$auth_mode][
'txt'];
733 $pos->setValue($counter++);
735 $pos->setMaxLength(1);
736 $option_determination->addSubItem($pos);
738 $kind->addOption($option_determination);
739 $this->
form->addItem($kind);
748 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
749 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
752 if (!$this->
http->wrapper()->post()->has(
"kind")) {
753 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
755 $kind = $this->
http->wrapper()->post()->retrieve(
"kind", $this->
refinery->kindlyTo()->int());
757 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
762 $det->setKind($kind);
764 $pos = $this->
http->wrapper()->post()->retrieve(
768 $this->
logger->debug(
'pos mode:' . print_r($pos,
true));
769 asort($pos, SORT_NUMERIC);
770 $this->
logger->debug(
'pos mode:' . print_r($pos,
true));
773 foreach (array_keys($pos) as $auth_mode) {
774 $position[$counter++] = substr($auth_mode, 1);
776 $this->
logger->debug(
'position mode:' . print_r($position,
true));
777 $det->setAuthModeSequence($position);
781 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
782 $this->
ctrl->redirect($this,
'authSettings');
790 $next_class = $this->
ctrl->getNextClass($this) ??
'';
791 $cmd = $this->
ctrl->getCmd() ??
'';
794 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
795 $this->error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->WARNING);
798 switch ($next_class) {
799 case 'ilopenidconnectsettingsgui':
801 $this->tabs_gui->activateTab(
'auth_oidconnect');
804 $this->
ctrl->forwardCommand($oid);
807 case 'ilsamlsettingsgui':
808 $this->tabs_gui->setTabActive(
'auth_saml');
811 $this->
ctrl->forwardCommand($os);
814 case 'ilregistrationsettingsgui':
817 $this->tabs_gui->setTabActive(
'registration_settings');
819 $this->
ctrl->forwardCommand($registration_gui);
822 case 'ilpermissiongui':
825 $this->tabs_gui->setTabActive(
'perm_settings');
828 $this->
ctrl->forwardCommand($perm_gui);
831 case 'illdapsettingsgui':
834 $this->tabs_gui->setTabActive(
'auth_ldap');
837 $this->
ctrl->forwardCommand($ldap_settings_gui);
840 case 'ilauthshibbolethsettingsgui':
842 $this->tabs_gui->setTabActive(
'auth_shib');
844 $this->
ctrl->forwardCommand($shib_settings_gui);
847 case 'ilcassettingsgui':
849 $this->tabs_gui->setTabActive(
'auth_cas');
851 $this->
ctrl->forwardCommand($cas_settings);
854 case strtolower(ilAuthPageEditorGUI::class):
857 $this->tabs_gui->setTabActive(
'authentication_settings');
858 $this->tabs_gui->setSubTabActive(
'auth_login_editor');
861 $this->
ctrl->forwardCommand($lpe);
864 case strtolower(ilObjectContentStyleSettingsGUI::class):
868 $this->tabs_gui->activateTab(
'authentication_settings');
869 $this->tabs_gui->activateSubTab(
'style');
870 $settings_gui = $this->content_style_gui
871 ->objectSettingsGUIForRefId(
875 $this->
ctrl->forwardCommand($settings_gui);
878 case strtolower(ilAuthLogoutBehaviourGUI::class):
880 $this->tabs_gui->setTabActive(
'authentication_settings');
881 $this->tabs_gui->setSubTabActive(
'logout_behaviour');
884 $this->
ctrl->forwardCommand($gui);
889 $cmd =
'authSettings';
908 $this->
ctrl->setParameter($this,
"ref_id", $this->
object->getRefId());
910 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
911 $this->tabs_gui->addTarget(
912 "authentication_settings",
913 $this->
ctrl->getLinkTarget($this,
"authSettings"),
919 $this->tabs_gui->addTarget(
920 'registration_settings',
921 $this->
ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view')
924 $this->tabs_gui->addTarget(
926 $this->
ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
933 #$this->tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"), 936 $this->tabs_gui->addTarget(
'auth_shib', $this->
ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui',
'settings'));
938 $this->tabs_gui->addTarget(
940 $this->
ctrl->getLinkTargetByClass(
'ilcassettingsgui',
'settings')
943 $this->tabs_gui->addTarget(
945 $this->
ctrl->getLinkTarget($this,
"editSOAP"),
951 $this->tabs_gui->addTarget(
952 "apache_auth_settings",
953 $this->
ctrl->getLinkTarget($this,
'apacheAuthSettings'),
959 $this->tabs_gui->addTarget(
967 $this->tabs_gui->addTab(
969 $this->
lng->txt(
'auth_oidconnect'),
970 $this->
ctrl->getLinkTargetByClass(
'ilopenidconnectsettingsgui')
974 if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
975 $this->tabs_gui->addTarget(
977 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
978 array(
"perm",
"info",
"owner"),
986 $this->
lng->loadLanguageModule(
'auth');
988 if ($a_tab ===
'authSettings' && $this->
access->checkAccess(
'write',
'', $this->object->getRefId())) {
989 $this->tabs_gui->addSubTabTarget(
991 $this->
ctrl->getLinkTarget($this,
'authSettings'),
995 foreach (AuthPageEditorContext::cases() as $auth_ipe_context) {
996 $this->
ctrl->setParameterByClass(
997 ilAuthPageEditorGUI::class,
999 $auth_ipe_context->value
1001 $this->tabs_gui->addSubTabTarget(
1002 $auth_ipe_context->tabIdentifier(),
1003 $this->
ctrl->getLinkTargetByClass(
1004 ilAuthPageEditorGUI::class,
1008 $this->
ctrl->setParameterByClass(
1009 ilAuthPageEditorGUI::class,
1015 $this->tabs_gui->addSubTabTarget(
1017 $this->
ctrl->getLinkTargetByClass(ilAuthLogoutBehaviourGUI::class,
''),
1021 $this->tabs_gui->addSubTab(
1023 $this->
lng->txt(
'cont_style'),
1024 $this->
ctrl->getLinkTargetByClass(ilObjectContentStyleSettingsGUI::class)
1032 $this->tabs_gui->setTabActive(
"apache_auth_settings");
1034 if (null === $form) {
1041 if (file_exists(
$path) && is_readable(
$path)) {
1042 $settingsMap[
'apache_auth_domains'] = file_get_contents(
$path);
1047 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHtml());
1057 'apache_auth_indicator_name',
'apache_auth_indicator_value',
1058 'apache_enable_auth',
'apache_enable_local',
'apache_local_autocreate',
1059 'apache_enable_ldap',
'apache_auth_username_config_type',
1060 'apache_auth_username_direct_mapping_fieldname',
1061 'apache_default_role',
'apache_auth_target_override_login_page',
1062 'apache_auth_enable_override_login_page',
1063 'apache_auth_authenticate_on_login_page',
1067 foreach ($fields as $field) {
1071 if ($form->
getInput(
'apache_enable_auth')) {
1072 $this->
ilias->setSetting(
'apache_active',
'1');
1074 $this->
ilias->setSetting(
'apache_active',
'0');
1086 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'apache_settings_changed_success'),
true);
1087 $this->
ctrl->redirect($this,
'apacheAuthSettings');
1097 $form->
setTitle($this->
lng->txt(
'apache_settings'));
1100 $chb_enabled->setValue(
'1');
1103 $chb_local_create_account =
new ilCheckboxInputGUI($this->
lng->txt(
'apache_autocreate'),
'apache_local_autocreate');
1104 $chb_local_create_account->setValue(
'1');
1105 $chb_enabled->addSubitem($chb_local_create_account);
1107 $roles = $this->rbac_review->getGlobalRolesArray();
1108 $select =
new ilSelectInputGUI($this->
lng->txt(
'apache_default_role'),
'apache_default_role');
1110 foreach ($roles as $role) {
1113 $select->setOptions($roleOptions);
1114 $select->setValue(4);
1116 $chb_local_create_account->addSubitem($select);
1119 $chb_local->setValue(
'1');
1123 $chb_local->setValue(
'1');
1125 $chb_ldap->setInfo($this->
lng->txt(
'apache_ldap_hint_ldap_must_be_configured'));
1127 $this->
lng->loadLanguageModule(
'auth');
1130 if (count($servers)) {
1131 $ldap_server_select =
new ilSelectInputGUI($this->
lng->txt(
'auth_ldap_server_ds'),
'apache_ldap_sid');
1132 $options[0] = $this->
lng->txt(
'select_one');
1133 foreach ($servers as $server_id) {
1135 $options[$server_id] = $ldap_server->getName();
1138 $ldap_server_select->setRequired(
true);
1141 $ldap_server_select->setValue($ds);
1143 $chb_ldap->addSubItem($ldap_server_select);
1147 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_indicator_name'),
'apache_auth_indicator_name');
1148 $txt->setRequired(
true);
1151 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_indicator_value'),
'apache_auth_indicator_value');
1152 $txt->setRequired(
true);
1155 $chb =
new ilCheckboxInputGUI($this->
lng->txt(
'apache_auth_enable_override_login'),
'apache_auth_enable_override_login_page');
1156 $chb->setValue(
'1');
1159 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_target_override_login'),
'apache_auth_target_override_login_page');
1160 $txt->setRequired(
true);
1161 $chb->addSubItem(
$txt);
1163 $chb =
new ilCheckboxInputGUI($this->
lng->txt(
'apache_auth_authenticate_on_login_page'),
'apache_auth_authenticate_on_login_page');
1164 $chb->setValue(
'1');
1168 $sec->setTitle($this->
lng->txt(
'apache_auth_username_config'));
1171 $rag =
new ilRadioGroupInputGUI($this->
lng->txt(
'apache_auth_username_config_type'),
'apache_auth_username_config_type');
1174 $rao =
new ilRadioOption($this->
lng->txt(
'apache_auth_username_direct_mapping'),
"1");
1175 $rag->addOption($rao);
1177 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_username_direct_mapping_fieldname'),
'apache_auth_username_direct_mapping_fieldname');
1179 $rao->addSubItem(
$txt);
1181 $rao =
new ilRadioOption($this->
lng->txt(
'apache_auth_username_extended_mapping'),
"2");
1183 $rag->addOption($rao);
1185 $rao =
new ilRadioOption($this->
lng->txt(
'apache_auth_username_by_function'),
"3");
1186 $rag->addOption($rao);
1189 $sec->setTitle($this->
lng->txt(
'apache_auth_security'));
1193 $txt->setInfo($this->
lng->txt(
'apache_auth_domains_description'));
1197 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
1207 return implode(
"\n", preg_split(
"/[\r\n]+/", $text));
1213 $this->
ctrl->redirect($registration_gui);
if($err=$client->getError()) $namespace
ILIAS Http Services $http
const AUTH_OPENID_CONNECT
editScriptObject()
Configure Custom settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isAuthModeSaml(string $a_auth_mode)
static getDataSource(int $a_auth_mode)
registrationSettingsObject()
Class ilAuthShibbolethSettingsGUI.
ILIAS UI Renderer $renderer
getAuthModeTitle()
get the title of auth mode
static _lookupRegisterAllowed()
get all roles that are activated in user registration
setDisabled(bool $a_disabled)
static getInstanceByServerId(int $a_server_id)
Get instance by server id.
prepareOutput(bool $show_sub_objects=true)
Interface Observer Contains several chained tasks and infos about them.
set(string $a_key, string $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
loginInfoObject()
displays login information of all installed languages
Facade for consumer gui interface.
static _getActiveAuthModes()
buildSOAPTestForm(string $submit_action)
validateApacheAuthAllowedDomains(string $text)
static getInstanceByIdpId(int $a_idp_id)
static getIdpIdByAuthMode(string $a_auth_mode)
static _getAuthModeName($a_auth_key)
ilAuthLogoutBehaviourGUI: ilObjAuthSettingsGUI ilAuthLogoutBehaviourGUI: ilLoginPageGUI ...
buildSOAPForm(string $submit_action)
static getServerIdByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
static getAuthPlugins()
Get active enabled auth plugins.
initAuthModeDetermination()
init auth mode determinitation form
editSOAPObject()
Configure soap settings.
saveScriptObject()
validates all input data, save them to database if correct and active chosen auth mode ...
static http()
Fetches the global http state from ILIAS.
static getServerIds()
Get all server ids.
static _lookupTitle(int $obj_id)
apacheAuthSettingsObject(?ilPropertyFormGUI $form=null)
executeCommand()
Execute command.
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
Class ilObjectGUI Basic methods of all Output classes.
ilAuthPageEditorGUI: ilObjAuthSettingsGUI ilAuthPageEditorGUI: ilLoginPageGUI, ilLogoutPageGUI ...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Class ilRegistrationSettingsGUI.
Class ilObjForumAdministration.
getApacheAuthSettingsForm()
authSettingsObject()
display settings menu
static redirect(string $a_script)
form( $class_path, string $cmd, string $submit_caption="")
static testConnection(string $a_ext_uid, string $a_soap_pw, bool $a_new_user)
static _getAllAuthModes()
static _getInstance()
Get instance.
testSoapAuthConnectionObject()
updateAuthModeDeterminationObject()
update auth mode determination
static _updateAuthMode(array $a_roles)
__construct(Container $dic, ilPlugin $plugin)
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
This class represents a text area property in a property form.
final const CONTEXT_HTTP_PARAM
static isAuthModeLDAP(string $a_auth_mode)
Check if user auth mode is LDAP.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
saveSOAPObject()
validates all input data, save them to database if correct and active chosen auth mode ...
saveApacheSettingsObject()
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
final const DEFAULT_COMMAND
GUIService $content_style_gui
setSubTabs(string $a_tab)