19 declare(strict_types=1);
33 private ILIAS\Http\Services
$http;
37 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
43 $this->
logger = $DIC->logger()->auth();
45 $this->
ui = $DIC->ui()->factory();
46 $this->renderer = $DIC->ui()->renderer();
47 $this->
http = $DIC->http();
49 $this->
lng->loadLanguageModule(
'registration');
50 $this->
lng->loadLanguageModule(
'auth');
63 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
64 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
67 $this->tabs_gui->setTabActive(
'authentication_settings');
69 $this->tabs_gui->setSubTabActive(
"auth_settings");
71 $generalSettingsTpl =
new ilTemplate(
'tpl.auth_general.html',
true,
true,
'Services/Authentication');
73 $generalSettingsTpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
74 $generalSettingsTpl->setVariable(
"TXT_AUTH_TITLE", $this->
lng->txt(
"auth_select"));
76 $generalSettingsTpl->setVariable(
"TXT_AUTH_MODE", $this->
lng->txt(
"auth_mode"));
77 $generalSettingsTpl->setVariable(
"TXT_AUTH_DEFAULT", $this->
lng->txt(
"default"));
78 $generalSettingsTpl->setVariable(
"TXT_AUTH_ACTIVE", $this->
lng->txt(
"active"));
79 $generalSettingsTpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->
lng->txt(
"num_users"));
81 $generalSettingsTpl->setVariable(
"TXT_LOCAL", $this->
lng->txt(
"auth_local"));
82 $generalSettingsTpl->setVariable(
"TXT_LDAP", $this->
lng->txt(
"auth_ldap"));
83 $generalSettingsTpl->setVariable(
"TXT_SHIB", $this->
lng->txt(
"auth_shib"));
85 $generalSettingsTpl->setVariable(
"TXT_CAS", $this->
lng->txt(
"auth_cas"));
87 $generalSettingsTpl->setVariable(
"TXT_SCRIPT", $this->
lng->txt(
"auth_script"));
89 $generalSettingsTpl->setVariable(
"TXT_APACHE", $this->
lng->txt(
"auth_apache"));
104 $icon_ok = $this->renderer->render(
107 $icon_not_ok = $this->renderer->render(
111 $this->
logger->debug(print_r($auth_modes,
true));
112 foreach ($auth_modes as $mode => $mode_name) {
117 $generalSettingsTpl->setCurrentBlock(
'auth_mode');
121 $generalSettingsTpl->setVariable(
"AUTH_NAME",
$server->getName());
122 $generalSettingsTpl->setVariable(
'AUTH_ACTIVE',
$server->isActive() ? $icon_ok : $icon_not_ok);
125 $generalSettingsTpl->setVariable(
'AUTH_NAME', $idp->getEntityId());
126 $generalSettingsTpl->setVariable(
'AUTH_ACTIVE', $idp->isActive() ? $icon_ok : $icon_not_ok);
128 $generalSettingsTpl->setVariable(
"AUTH_NAME", $this->
lng->txt(
"auth_" . $mode_name));
131 $generalSettingsTpl->setVariable(
"AUTH_NAME", $this->
lng->txt(
"auth_" . $mode_name));
132 $generalSettingsTpl->setVariable(
'AUTH_ACTIVE', $this->
ilias->getSetting($mode_name .
'_active') || (
int) $mode ===
ilAuthUtils::AUTH_LOCAL ? $icon_ok : $icon_not_ok);
135 $auth_cnt_mode = $auth_cnt[$mode_name] ?? 0;
136 if ($this->
settings->get(
'auth_mode') === (string) $mode) {
137 $generalSettingsTpl->setVariable(
"AUTH_CHECKED",
"checked=\"checked\"");
138 $auth_cnt_default = $auth_cnt[
"default"] ?? 0;
139 $generalSettingsTpl->setVariable(
141 ((
int) $auth_cnt_mode + $auth_cnt_default) .
" (" . $this->
lng->txt(
"auth_per_default") .
142 ": " . $auth_cnt_default .
")" 145 $generalSettingsTpl->setVariable(
150 $generalSettingsTpl->setVariable(
"AUTH_ID", $mode_name);
151 $generalSettingsTpl->setVariable(
"AUTH_VAL", $mode);
152 $generalSettingsTpl->parseCurrentBlock();
155 $generalSettingsTpl->setVariable(
"TXT_CONFIGURE", $this->
lng->txt(
"auth_configure"));
157 if ($this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
158 $generalSettingsTpl->setVariable(
"TXT_AUTH_REMARK", $this->
lng->txt(
"auth_remark_non_local_auth"));
159 $generalSettingsTpl->setCurrentBlock(
'auth_mode_submit');
160 $generalSettingsTpl->setVariable(
"TXT_SUBMIT", $this->
lng->txt(
"save"));
161 $generalSettingsTpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
162 $generalSettingsTpl->parseCurrentBlock();
167 $generalSettingsTpl->setVariable(
'TABLE_AUTH_DETERMINATION', $this->
form->getHTML());
171 $generalSettingsTpl->setVariable(
173 $this->
ctrl->getFormAction($this)
175 $generalSettingsTpl->setVariable(
"TXT_AUTH_ROLES", $this->
lng->txt(
"auth_active_roles"));
176 $generalSettingsTpl->setVariable(
"TXT_ROLE", $this->
lng->txt(
"obj_role"));
177 $generalSettingsTpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->
lng->txt(
"auth_role_auth_mode"));
178 if ($this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
179 $generalSettingsTpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
180 $generalSettingsTpl->setVariable(
'BTN_SUBMIT_ROLES', $this->
lng->txt(
'save'));
188 foreach ($reg_roles as $role) {
189 foreach ($active_auth_modes as $auth_name => $auth_key) {
193 if ($auth_name ===
"default" || $auth_name ===
"cas" 194 || $auth_name ===
'saml' 195 || $auth_name ===
"shibboleth" || $auth_name ===
'ldap' 196 || $auth_name ===
'apache' || $auth_name ===
"ecs" 197 || $auth_name ===
"openid") {
201 $generalSettingsTpl->setCurrentBlock(
"auth_mode_selection");
203 if ($auth_name ===
'default') {
210 $name = $idp->getEntityId();
212 $name = $this->
lng->txt(
'auth_' . $auth_name);
215 $generalSettingsTpl->setVariable(
"AUTH_MODE_NAME", $name);
217 $generalSettingsTpl->setVariable(
"AUTH_MODE", $auth_name);
219 if ($role[
'auth_mode'] === $auth_name) {
220 $generalSettingsTpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
223 $generalSettingsTpl->parseCurrentBlock();
226 $generalSettingsTpl->setCurrentBlock(
"roles");
227 $generalSettingsTpl->setVariable(
"ROLE", $role[
'title']);
229 $generalSettingsTpl->setVariable(
"ROLE_ID",
"r_" . $role[
'id']);
230 $generalSettingsTpl->parseCurrentBlock();
233 $default_auth_info = $this->ui_factory->messageBox()->info(
234 $this->
lng->txt(
'auth_mode_default_change_info')
237 $this->tpl->setContent($this->ui_renderer->render($default_auth_info) . $generalSettingsTpl->get());
248 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
249 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
252 $this->tabs_gui->setTabActive(
"authentication_settings");
254 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
256 $this->
lng->loadLanguageModule(
"meta");
258 $this->tpl->addBlockFile(
261 "tpl.auth_login_messages.html",
262 "Services/Authentication" 264 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
265 $this->tpl->setVariable(
"TXT_HEADLINE", $this->
lng->txt(
"login_information"));
266 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->
lng->txt(
"login_information_desc"));
267 $this->tpl->setVariable(
"TXT_SUBMIT", $this->
lng->txt(
"save"));
268 $this->tpl->setVariable(
'LOGIN_INFO', $this->
form->getHTML());
274 $this->
ctrl->redirect($this,
"authSettings");
279 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
280 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
282 $this->
logger->debug(
'auth mode available:' . $this->request_wrapper->has(
"auth_mode"));
284 if (!$this->
http->wrapper()->post()->has(
"auth_mode")) {
285 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
287 $new_auth_mode = $this->
http->wrapper()->post()->retrieve(
"auth_mode", $this->
refinery->to()->string());
288 $this->
logger->debug(
'auth mode:' . $new_auth_mode);
289 $current_auth_mode = $this->
settings->get(
'auth_mode',
'');
290 if ($new_auth_mode === $current_auth_mode) {
291 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"auth_mode") .
": " . $this->
getAuthModeTitle() .
" " . $this->
lng->txt(
"auth_mode_not_changed"),
true);
292 $this->
ctrl->redirect($this,
'authSettings');
295 switch ((
int) $new_auth_mode) {
312 if ($this->
object->checkAuthSHIB() !==
true) {
313 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"auth_shib_not_configured"),
true);
317 $this->
ctrl->getLinkTargetByClass(
318 ilAuthShibbolethSettingsGUI::class,
330 if ($this->
object->checkAuthScript() !==
true) {
331 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"auth_script_not_configured"),
true);
337 $this->
ilias->setSetting(
"auth_mode", $new_auth_mode);
339 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_default_mode_changed_to") .
" " . $this->
getAuthModeTitle(),
true);
340 $this->
ctrl->redirect($this,
'authSettings');
344 string $submit_action
347 $role_list = $this->rbac_review->getRolesByFilter(2, $this->
object->getId());
350 foreach ($role_list as $role) {
351 $roles[$role[
'obj_id']] = $role[
'title'];
354 $active = $this->
ui->input()->field()
355 ->checkbox($this->
lng->txt(
"active"))
358 $server = $this->
ui->input()->field()->text(
359 $this->
lng->txt(
"server"),
360 $this->
lng->txt(
"auth_soap_server_desc")
361 )->withRequired(
true)
363 ->withValue($this->
settings->get(
"soap_auth_server",
""));
365 $port = $this->
ui->input()->field()->numeric(
366 $this->
lng->txt(
"port"),
367 $this->
lng->txt(
"auth_soap_port_desc")
370 $this->
refinery->int()->isLessThan(65536)
373 $use_https = $this->
ui->input()->field()->checkbox($this->
lng->txt(
"auth_soap_use_https"))
376 $uri = $this->
ui->input()->field()->text(
377 $this->
lng->txt(
"uri"),
378 $this->
lng->txt(
"auth_soap_uri_desc")
379 )->withMaxLength(256)
380 ->withValue($this->
settings->get(
"soap_auth_uri",
""));
383 $this->
lng->txt(
"auth_soap_namespace"),
384 $this->
lng->txt(
"auth_soap_namespace_desc")
385 )->withMaxLength(256)
386 ->withValue($this->
settings->get(
"soap_auth_namespace",
""));
388 $dotnet = $this->
ui->input()->field()->checkbox($this->
lng->txt(
"auth_soap_use_dotnet"))
391 $createuser = $this->
ui->input()->field()->checkbox(
392 $this->
lng->txt(
"auth_create_users"),
393 $this->
lng->txt(
"auth_soap_create_users_desc")
396 $sendmail = $this->
ui->input()->field()->checkbox(
397 $this->
lng->txt(
"user_send_new_account_mail"),
398 $this->
lng->txt(
"auth_new_account_mail_desc")
401 $defaultrole = $this->
ui->input()->field()->select(
402 $this->
lng->txt(
"auth_user_default_role"),
404 $this->
lng->txt(
"auth_soap_user_default_role_desc")
408 $allowlocal = $this->
ui->input()->field()->checkbox(
409 $this->
lng->txt(
"auth_allow_local"),
410 $this->
lng->txt(
"auth_soap_allow_local_desc")
413 $form = $this->
ui->input()->container()->form()->standard(
415 [
"active" => $active,
418 "use_https" => $use_https,
422 "createuser" => $createuser,
423 "sendmail" => $sendmail,
424 "defaultrole" => $defaultrole,
425 "allowlocal" => $allowlocal
432 string $submit_action
441 ->checkbox(
"new_user");
442 $form = $this->
ui->input()->container()->form()->standard(
448 )->withSubmitLabel(
"Send");
458 if (!$this->rbac_system->checkAccess(
"read", $this->object->getRefId())) {
459 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
462 $soap_form = $this->
buildSOAPForm($this->
ctrl->getFormAction($this,
"saveSOAP"));
465 $this->tabs_gui->setTabActive(
'auth_soap');
466 $panel = $this->
ui->panel()->standard(
"SOAP", [$soap_form, $test_form]);
467 $this->tpl->setContent($this->renderer->render($panel));
472 if (!$this->rbac_system->checkAccess(
"read", $this->object->getRefId())) {
473 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
477 $soap_form = $this->
buildSOAPForm($this->
ctrl->getFormAction($this,
"saveSOAP"));
479 $panel_content = [$soap_form, $test_form];
480 if ($this->request->getMethod() ==
"POST") {
481 $test_form = $test_form->withRequest($this->request);
482 $result = $test_form->getData();
483 if (!is_null($result)) {
484 $panel_content[] = $this->
ui->legacy(
489 $this->tabs_gui->setTabActive(
'auth_soap');
490 $panel = $this->
ui->panel()->standard(
"SOAP", $panel_content);
491 $this->tpl->setContent($this->renderer->render($panel));
499 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
500 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
503 $soap_form = $this->
buildSOAPForm($this->
ctrl->getFormAction($this,
"saveSOAP"));
505 if ($this->request->getMethod() ===
"POST") {
506 $soap_form = $soap_form->withRequest($this->request);
507 $result = $soap_form->getData();
508 if (!is_null($result)) {
509 $this->
settings->set(
"soap_auth_active", (
string) $result[
"active"]);
510 $this->
settings->set(
"soap_auth_server", $result[
"server"]);
511 $this->
settings->set(
"soap_auth_port", (
string) $result[
"port"]);
512 $this->
settings->set(
"soap_auth_use_https", (
string) $result[
"use_https"]);
513 $this->
settings->set(
"soap_auth_uri", $result[
"uri"]);
514 $this->
settings->set(
"soap_auth_namespace", $result[
"namespace"]);
515 $this->
settings->set(
"soap_auth_use_dotnet", (
string) $result[
"dotnet"]);
516 $this->
settings->set(
"soap_auth_create_users", (
string) $result[
"createuser"]);
517 $this->
settings->set(
"soap_auth_account_mail", (
string) $result[
"sendmail"]);
518 $this->
settings->set(
"soap_auth_user_default_role", (
string) $result[
"defaultrole"]);
519 $this->
settings->set(
"soap_auth_allow_local", (
string) $result[
"allowlocal"]);
521 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_soap_settings_saved"),
true);
522 $this->
logger->info(
"data" . print_r($result,
true));
523 $this->
ctrl->redirect($this,
'editSOAP');
527 $this->tabs_gui->setTabActive(
'auth_soap');
528 $panel = $this->
ui->panel()->standard(
"SOAP", [$soap_form, $test_form]);
529 $this->tpl->setContent($this->renderer->render($panel));
537 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
538 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
541 if ($_SESSION[
"error_post_vars"]) {
542 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", $_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
547 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME",
$settings[
"auth_script_name"]);
550 $this->tabs_gui->setTabActive(
'auth_script');
552 $this->tpl->addBlockFile(
555 "tpl.auth_script.html",
556 "Services/Authentication" 559 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this));
560 $this->tpl->setVariable(
"COLSPAN", 3);
561 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->
lng->txt(
"auth_script_configure"));
562 $this->tpl->setVariable(
"TXT_OPTIONS", $this->
lng->txt(
"options"));
563 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->
lng->txt(
"auth_script_name"));
565 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->
lng->txt(
"required_field"));
566 $this->tpl->setVariable(
"TXT_CANCEL", $this->
lng->txt(
"cancel"));
567 $this->tpl->setVariable(
"TXT_SUBMIT", $this->
lng->txt(
"save"));
568 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
577 if (!$_POST[
"auth_script"][
"name"]) {
578 $this->
ilias->raiseError($this->
lng->txt(
"fill_out_all_required_fields"), $this->
ilias->error_obj->MESSAGE);
591 $this->
ilias->setSetting(
"auth_script_name", $_POST[
"auth_script"][
"name"]);
594 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_mode_changed_to") .
" " . $this->
getAuthModeTitle(),
true);
595 $this->
ctrl->redirect($this,
'editScript');
606 switch ($this->
ilias->getSetting(
"auth_mode")) {
608 return $this->
lng->txt(
"auth_local");
612 return $this->
lng->txt(
"auth_ldap");
616 return $this->
lng->txt(
"auth_shib");
620 return $this->
lng->txt(
"auth_saml");
625 return $this->
lng->txt(
"auth_script");
629 return $this->
lng->txt(
"auth_apache");
633 return $this->
lng->txt(
"unknown");
640 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
641 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
643 if (!$this->
http->wrapper()->post()->has(
"Fobject")) {
644 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
646 $f_object_unconverted = $this->
http->wrapper()->post()->retrieve(
652 foreach ($f_object_unconverted as $role_id => $auth_mode) {
653 $f_object[substr($role_id, 2)] = $auth_mode;
657 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"auth_mode_roles_changed"),
true);
658 $this->
ctrl->redirect($this,
'authSettings');
666 if (isset($this->
form) && is_object($this->
form)) {
671 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
672 $this->
form->setTableWidth(
'100%');
673 $this->
form->setTitle($this->
lng->txt(
'auth_auth_settings'));
675 if ($this->
access->checkAccess(
'write',
'', $this->object->getRefId())) {
676 $this->
form->addCommandButton(
'updateAuthModeDetermination', $this->
lng->txt(
'save'));
680 if ($det->getCountActiveAuthModes() <= 1) {
685 $header->setTitle($this->
lng->txt(
'auth_auth_mode_determination'));
686 $this->
form->addItem($header);
689 $kind->
setInfo($this->
lng->txt(
'auth_mode_determination_info'));
690 $kind->setValue((
string) $det->getKind());
691 $kind->setRequired(
true);
694 $kind->addOption($option_user);
696 $option_determination =
new ilRadioOption($this->
lng->txt(
'auth_automatic'),
"1");
698 $auth_sequenced = $det->getAuthModeSequence();
701 foreach ($auth_sequenced as $auth_mode) {
702 switch ($auth_mode) {
709 $text = $this->
lng->txt(
'auth_local');
712 $text = $this->
lng->txt(
'auth_soap');
715 $text = $this->
lng->txt(
'auth_apache');
719 $option = $pl->getMultipleAuthModeOptions($auth_mode);
720 $text = $option[$auth_mode][
'txt'];
725 $pos =
new ilTextInputGUI($text,
'position[m' . $auth_mode .
']');
726 $pos->setValue($counter++);
728 $pos->setMaxLength(1);
729 $option_determination->addSubItem($pos);
731 $kind->addOption($option_determination);
732 $this->
form->addItem($kind);
741 if (!$this->rbac_system->checkAccess(
"write", $this->object->getRefId())) {
742 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
745 if (!$this->
http->wrapper()->post()->has(
"kind")) {
746 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
748 $kind = $this->
http->wrapper()->post()->retrieve(
"kind", $this->
refinery->kindlyTo()->int());
750 $this->
ilias->raiseError($this->
lng->txt(
"auth_err_no_mode_selected"), $this->
ilias->error_obj->MESSAGE);
755 $det->setKind($kind);
757 $pos = $this->
http->wrapper()->post()->retrieve(
761 $this->
logger->debug(
'pos mode:' . print_r($pos,
true));
762 asort($pos, SORT_NUMERIC);
763 $this->
logger->debug(
'pos mode:' . print_r($pos,
true));
766 foreach (array_keys($pos) as $auth_mode) {
767 $position[$counter++] = substr($auth_mode, 1);
769 $this->
logger->debug(
'position mode:' . print_r($position,
true));
770 $det->setAuthModeSequence($position);
774 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
775 $this->
ctrl->redirect($this,
'authSettings');
783 $next_class = $this->
ctrl->getNextClass($this);
784 $cmd = $this->
ctrl->getCmd();
787 if (!$this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
788 $this->error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->WARNING);
791 switch ($next_class) {
792 case 'ilopenidconnectsettingsgui':
794 $this->tabs_gui->activateTab(
'auth_oidconnect');
797 $this->
ctrl->forwardCommand($oid);
800 case 'ilsamlsettingsgui':
801 $this->tabs_gui->setTabActive(
'auth_saml');
804 $this->
ctrl->forwardCommand($os);
807 case 'ilregistrationsettingsgui':
810 $this->tabs_gui->setTabActive(
'registration_settings');
812 $this->
ctrl->forwardCommand($registration_gui);
815 case 'ilpermissiongui':
818 $this->tabs_gui->setTabActive(
'perm_settings');
821 $this->
ctrl->forwardCommand($perm_gui);
824 case 'illdapsettingsgui':
827 $this->tabs_gui->setTabActive(
'auth_ldap');
830 $this->
ctrl->forwardCommand($ldap_settings_gui);
833 case 'ilauthshibbolethsettingsgui':
835 $this->tabs_gui->setTabActive(
'auth_shib');
837 $this->
ctrl->forwardCommand($shib_settings_gui);
840 case 'ilcassettingsgui':
842 $this->tabs_gui->setTabActive(
'auth_cas');
844 $this->
ctrl->forwardCommand($cas_settings);
847 case 'ilauthloginpageeditorgui':
850 $this->tabs_gui->setTabActive(
'authentication_settings');
851 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
854 $this->
ctrl->forwardCommand($lpe);
859 $cmd =
"authSettings";
878 $this->
ctrl->setParameter($this,
"ref_id", $this->
object->getRefId());
880 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
881 $this->tabs_gui->addTarget(
882 "authentication_settings",
883 $this->
ctrl->getLinkTarget($this,
"authSettings"),
889 $this->tabs_gui->addTarget(
890 'registration_settings',
891 $this->
ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view')
894 $this->tabs_gui->addTarget(
896 $this->
ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
903 #$this->tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"), 906 $this->tabs_gui->addTarget(
'auth_shib', $this->
ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui',
'settings'));
908 $this->tabs_gui->addTarget(
910 $this->
ctrl->getLinkTargetByClass(
'ilcassettingsgui',
'settings')
913 $this->tabs_gui->addTarget(
915 $this->
ctrl->getLinkTarget($this,
"editSOAP"),
921 $this->tabs_gui->addTarget(
922 "apache_auth_settings",
923 $this->
ctrl->getLinkTarget($this,
'apacheAuthSettings'),
929 $this->tabs_gui->addTarget(
937 $this->tabs_gui->addTab(
939 $this->
lng->txt(
'auth_oidconnect'),
940 $this->
ctrl->getLinkTargetByClass(
'ilopenidconnectsettingsgui')
944 if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
945 $this->tabs_gui->addTarget(
947 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
948 array(
"perm",
"info",
"owner"),
959 $this->
lng->loadLanguageModule(
'auth');
961 if ($a_tab ===
'authSettings') {
962 if ($this->
access->checkAccess(
'write',
'', $this->object->getRefId())) {
963 $this->tabs_gui->addSubTabTarget(
965 $this->
ctrl->getLinkTarget($this,
'authSettings'),
969 if ($this->
access->checkAccess(
'write',
'', $this->object->getRefId())) {
970 $this->tabs_gui->addSubTabTarget(
972 $this->
ctrl->getLinkTargetByClass(
'ilauthloginpageeditorgui',
''),
982 $this->tabs_gui->setTabActive(
"apache_auth_settings");
984 if (null === $form) {
991 if (file_exists(
$path) && is_readable(
$path)) {
992 $settingsMap[
'apache_auth_domains'] = file_get_contents(
$path);
997 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHtml());
1007 'apache_auth_indicator_name',
'apache_auth_indicator_value',
1008 'apache_enable_auth',
'apache_enable_local',
'apache_local_autocreate',
1009 'apache_enable_ldap',
'apache_auth_username_config_type',
1010 'apache_auth_username_direct_mapping_fieldname',
1011 'apache_default_role',
'apache_auth_target_override_login_page',
1012 'apache_auth_enable_override_login_page',
1013 'apache_auth_authenticate_on_login_page',
1017 foreach ($fields as $field) {
1021 if ($form->
getInput(
'apache_enable_auth')) {
1022 $this->
ilias->setSetting(
'apache_active',
'1');
1024 $this->
ilias->setSetting(
'apache_active',
'0');
1036 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'apache_settings_changed_success'),
true);
1037 $this->
ctrl->redirect($this,
'apacheAuthSettings');
1047 $form->
setTitle($this->
lng->txt(
'apache_settings'));
1050 $chb_enabled->setValue(
'1');
1053 $chb_local_create_account =
new ilCheckboxInputGUI($this->
lng->txt(
'apache_autocreate'),
'apache_local_autocreate');
1054 $chb_local_create_account->setValue(
'1');
1055 $chb_enabled->addSubitem($chb_local_create_account);
1057 $roles = $this->rbac_review->getGlobalRolesArray();
1058 $select =
new ilSelectInputGUI($this->
lng->txt(
'apache_default_role'),
'apache_default_role');
1060 foreach ($roles as $role) {
1063 $select->setOptions($roleOptions);
1064 $select->setValue(4);
1066 $chb_local_create_account->addSubitem($select);
1069 $chb_local->setValue(
'1');
1073 $chb_local->setValue(
'1');
1075 $chb_ldap->setInfo($this->
lng->txt(
'apache_ldap_hint_ldap_must_be_configured'));
1077 $this->
lng->loadLanguageModule(
'auth');
1080 if (count($servers)) {
1081 $ldap_server_select =
new ilSelectInputGUI($this->
lng->txt(
'auth_ldap_server_ds'),
'apache_ldap_sid');
1082 $options[0] = $this->
lng->txt(
'select_one');
1083 foreach ($servers as $server_id) {
1085 $options[$server_id] = $ldap_server->getName();
1088 $ldap_server_select->setRequired(
true);
1091 $ldap_server_select->setValue($ds);
1093 $chb_ldap->addSubItem($ldap_server_select);
1097 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_indicator_name'),
'apache_auth_indicator_name');
1098 $txt->setRequired(
true);
1101 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_indicator_value'),
'apache_auth_indicator_value');
1102 $txt->setRequired(
true);
1105 $chb =
new ilCheckboxInputGUI($this->
lng->txt(
'apache_auth_enable_override_login'),
'apache_auth_enable_override_login_page');
1106 $chb->setValue(
'1');
1109 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_target_override_login'),
'apache_auth_target_override_login_page');
1110 $txt->setRequired(
true);
1111 $chb->addSubItem(
$txt);
1113 $chb =
new ilCheckboxInputGUI($this->
lng->txt(
'apache_auth_authenticate_on_login_page'),
'apache_auth_authenticate_on_login_page');
1114 $chb->setValue(
'1');
1118 $sec->setTitle($this->
lng->txt(
'apache_auth_username_config'));
1121 $rag =
new ilRadioGroupInputGUI($this->
lng->txt(
'apache_auth_username_config_type'),
'apache_auth_username_config_type');
1124 $rao =
new ilRadioOption($this->
lng->txt(
'apache_auth_username_direct_mapping'),
"1");
1125 $rag->addOption($rao);
1127 $txt =
new ilTextInputGUI($this->
lng->txt(
'apache_auth_username_direct_mapping_fieldname'),
'apache_auth_username_direct_mapping_fieldname');
1129 $rao->addSubItem(
$txt);
1131 $rao =
new ilRadioOption($this->
lng->txt(
'apache_auth_username_extended_mapping'),
"2");
1133 $rag->addOption($rao);
1135 $rao =
new ilRadioOption($this->
lng->txt(
'apache_auth_username_by_function'),
"3");
1136 $rag->addOption($rao);
1139 $sec->setTitle($this->
lng->txt(
'apache_auth_security'));
1143 $txt->setInfo($this->
lng->txt(
'apache_auth_domains_description'));
1147 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
1157 return implode(
"\n", preg_split(
"/[\r\n]+/", $text));
1163 $this->
ctrl->redirect($registration_gui);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
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 ilOpenIdConnectSettingsGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
Class ChatMainBarProvider .
set(string $a_key, string $a_val)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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
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)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
executeCommand()
Execute command.
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
Class ilObjectGUI Basic methods of all Output classes.
Class ilRegistrationSettingsGUI.
header include for all ilias files.
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)
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.
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 ...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
saveApacheSettingsObject()
setSubTabs(string $a_tab)
set sub tabs