17require_once
"./Services/Object/classes/class.ilObjectGUI.php";
25 function __construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output =
true)
28 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
30 $this->lng->loadLanguageModule(
'registration');
32 define(
'LDAP_DEFAULT_PORT',389);
33 define(
'RADIUS_DEFAULT_PORT',1812);
54 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
56 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
59 $this->tabs_gui->setTabActive(
'authentication_settings');
61 $this->tabs_gui->setSubTabActive(
"auth_settings");
63 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_general.html",
64 "Services/Authentication");
66 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
67 $this->tpl->setVariable(
"TXT_AUTH_TITLE", $this->lng->txt(
"auth_select"));
69 $this->tpl->setVariable(
"TXT_AUTH_MODE", $this->lng->txt(
"auth_mode"));
70 $this->tpl->setVariable(
"TXT_AUTH_DEFAULT", $this->lng->txt(
"default"));
71 $this->tpl->setVariable(
"TXT_AUTH_ACTIVE", $this->lng->txt(
"active"));
72 $this->tpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->lng->txt(
"num_users"));
74 $this->tpl->setVariable(
"TXT_LOCAL", $this->lng->txt(
"auth_local"));
75 $this->tpl->setVariable(
"TXT_LDAP", $this->lng->txt(
"auth_ldap"));
76 $this->tpl->setVariable(
"TXT_SHIB", $this->lng->txt(
"auth_shib"));
78 $this->tpl->setVariable(
"TXT_CAS", $this->lng->txt(
"auth_cas"));
80 $this->tpl->setVariable(
"TXT_RADIUS", $this->lng->txt(
"auth_radius"));
81 $this->tpl->setVariable(
"TXT_SCRIPT", $this->lng->txt(
"auth_script"));
83 $this->tpl->setVariable(
"TXT_APACHE", $this->lng->txt(
"auth_apache"));
88 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
90 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.svg").
"\" alt=\"".$this->lng->txt(
"enabled").
"\" title=\"".$this->lng->txt(
"enabled").
"\" border=\"0\" vspace=\"0\"/>";
91 $icon_not_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_not_ok.svg").
"\" alt=\"".$this->lng->txt(
"disabled").
"\" title=\"".$this->lng->txt(
"disabled").
"\" border=\"0\" vspace=\"0\"/>";
94 foreach($auth_modes as $mode => $mode_name)
101 $this->tpl->setCurrentBlock(
'auth_mode');
106 $this->tpl->setVariable(
"AUTH_NAME",
$server->getName());
107 $this->tpl->setVariable(
'AUTH_ACTIVE',
$server->isActive() ? $icon_ok : $icon_not_ok);
111 $this->tpl->setVariable(
"AUTH_NAME", $this->lng->txt(
"auth_" . $mode_name));
112 $this->tpl->setVariable(
'AUTH_ACTIVE',$this->
ilias->getSetting($mode_name .
'_active') || $mode ==
AUTH_LOCAL ? $icon_ok : $icon_not_ok);
117 $this->tpl->setVariable(
"AUTH_CHECKED",
"checked=\"checked\"");
119 $this->tpl->setVariable(
"AUTH_USER_NUM",
120 ((
int) $auth_cnt[$mode_name] + $auth_cnt[
"default"]).
" (".$this->lng->txt(
"auth_per_default").
121 ": ".$auth_cnt[
"default"].
")");
125 $this->tpl->setVariable(
"AUTH_USER_NUM",
126 (
int) $auth_cnt[$mode_name]);
128 $this->tpl->setVariable(
"AUTH_ID",$mode_name);
129 $this->tpl->setVariable(
"AUTH_VAL",$mode);
130 $this->tpl->parseCurrentBlock();
133 $this->tpl->setVariable(
"TXT_CONFIGURE", $this->lng->txt(
"auth_configure"));
134 $this->tpl->setVariable(
"TXT_AUTH_REMARK", $this->lng->txt(
"auth_remark_non_local_auth"));
135 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
136 $this->tpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
141 $this->tpl->setVariable(
'TABLE_AUTH_DETERMINATION',$this->form->getHTML());
145 $this->tpl->setVariable(
"FORMACTION_ROLES",
146 $this->ctrl->getFormAction($this));
147 $this->tpl->setVariable(
"TXT_AUTH_ROLES", $this->lng->txt(
"auth_active_roles"));
148 $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
"obj_role"));
149 $this->tpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->lng->txt(
"auth_role_auth_mode"));
150 $this->tpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
152 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
156 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
159 foreach ($reg_roles as $role)
161 foreach ($active_auth_modes as $auth_name => $auth_key)
166 if ($auth_name ==
"default" || $auth_name ==
"cas"
167 || $auth_name ==
"shibboleth" || $auth_name ==
'ldap'
168 || $auth_name ==
'apache' || $auth_name ==
"ecs"
169 || $auth_name ==
"openid")
174 $this->tpl->setCurrentBlock(
"auth_mode_selection");
176 if ($auth_name ==
'default')
187 $name = $this->lng->txt(
'auth_'.$auth_name);
190 $this->tpl->setVariable(
"AUTH_MODE_NAME", $name);
192 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
194 if ($role[
'auth_mode'] == $auth_name)
196 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
199 $this->tpl->parseCurrentBlock();
202 $this->tpl->setCurrentBlock(
"roles");
203 $this->tpl->setVariable(
"ROLE", $role[
'title']);
204 $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
205 $this->tpl->parseCurrentBlock();
220 if (!$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId()))
222 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
225 $this->tabs_gui->setTabActive(
"authentication_settings");
227 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
229 $lng->loadLanguageModule(
"meta");
231 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_login_messages.html",
232 "Services/Authentication");
233 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
234 $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
"login_information"));
235 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"login_information_desc"));
236 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
237 $this->initLoginForm();
238 $this->tpl->setVariable(
'LOGIN_INFO',$this->form->getHTML());
244 $this->ctrl->redirect($this,
"authSettings");
251 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
253 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
256 if (empty(
$_POST[
"auth_mode"]))
258 $this->
ilias->raiseError($this->lng->txt(
"auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
261 if (
$_POST[
"auth_mode"] == AUTH_DEFAULT)
263 ilUtil::sendInfo($this->lng->txt(
"auth_mode").
": ".$this->getAuthModeTitle().
" ".$this->lng->txt(
"auth_mode_not_changed"),
true);
264 $this->ctrl->redirect($this,
'authSettings');
267 switch (
$_POST[
"auth_mode"])
281 if ($this->object->checkAuthSHIB() !==
true)
289 if ($this->object->checkAuthRADIUS() !==
true)
292 $this->ctrl->redirect($this,
'editRADIUS');
297 if ($this->object->checkAuthScript() !==
true)
305 $this->
ilias->setSetting(
"auth_mode",
$_POST[
"auth_mode"]);
307 ilUtil::sendSuccess($this->lng->txt(
"auth_default_mode_changed_to").
" ".$this->getAuthModeTitle(),
true);
308 $this->ctrl->redirect($this,
'authSettings');
320 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
322 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
325 $this->tabs_gui->setTabActive(
'auth_soap');
328 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.auth_soap.html',
'Services/Authentication');
331 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
334 foreach ($role_list as $role)
336 $roles[$role[
'obj_id']] = $role[
'title'];
340 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
343 $soap_config->setTitle($this->lng->txt(
"auth_soap_auth"));
344 $soap_config->setDescription($this->lng->txt(
"auth_soap_auth_desc"));
345 $soap_config->setFormAction($this->ctrl->getFormAction($this,
"editSOAP"));
346 $soap_config->addCommandButton(
"saveSOAP", $this->lng->txt(
"save"));
347 $soap_config->addCommandButton(
"editSOAP", $this->lng->txt(
"cancel"));
351 $active->setTitle($this->lng->txt(
"active"));
352 $active->setPostVar(
"soap[active]");
356 $server->setTitle($this->lng->txt(
"server"));
357 $server->setInfo($this->lng->txt(
"auth_soap_server_desc"));
358 $server->setPostVar(
"soap[server]");
365 $port->setTitle($this->lng->txt(
"port"));
366 $port->setInfo($this->lng->txt(
"auth_soap_port_desc"));
367 $port->setPostVar(
"soap[port]");
369 $port->setMaxLength(5);
373 $https->setTitle($this->lng->txt(
"auth_soap_use_https"));
374 $https->setPostVar(
"soap[use_https]");
378 $uri->setTitle($this->lng->txt(
"uri"));
379 $uri->setInfo($this->lng->txt(
"auth_soap_uri_desc"));
380 $uri->setPostVar(
"soap[uri]");
382 $uri->setMaxLength(256);
386 $namespace->setTitle($this->lng->txt(
"auth_soap_namespace"));
387 $namespace->setInfo($this->lng->txt(
"auth_soap_namespace_desc"));
394 $dotnet->setTitle($this->lng->txt(
"auth_soap_use_dotnet"));
395 $dotnet->setPostVar(
"soap[use_dotnet]");
399 $createuser->setTitle($this->lng->txt(
"auth_create_users"));
400 $createuser->setInfo($this->lng->txt(
"auth_soap_create_users_desc"));
401 $createuser->setPostVar(
"soap[create_users]");
405 $sendmail->setTitle($this->lng->txt(
"user_send_new_account_mail"));
406 $sendmail->setInfo($this->lng->txt(
"auth_new_account_mail_desc"));
407 $sendmail->setPostVar(
"soap[account_mail]");
411 $defaultrole->setTitle($this->lng->txt(
"auth_user_default_role"));
412 $defaultrole->setInfo($this->lng->txt(
"auth_soap_user_default_role_desc"));
413 $defaultrole->setPostVar(
"soap[user_default_role]");
414 $defaultrole->setOptions($roles);
418 $allowlocal->setTitle($this->lng->txt(
"auth_allow_local"));
419 $allowlocal->setInfo($this->lng->txt(
"auth_soap_allow_local_desc"));
420 $allowlocal->setPostVar(
"soap[allow_local]");
428 $active ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"active"]);
430 $port ->setValue(
$_SESSION[
"error_post_vars"][
"soap"][
"port"]);
431 $https ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"use_https"]);
432 $uri ->setValue(
$_SESSION[
"error_post_vars"][
"soap"][
"uri"]);
434 $dotnet ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"use_dotnet"]);
435 $createuser ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"create_users"]);
436 $allowlocal ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"allow_local"]);
437 $defaultrole->setValue(
$_SESSION[
"error_post_vars"][
"soap"][
"user_default_role"]);
438 $sendmail ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"account_mail"]);
442 $active ->setChecked($settings[
"soap_auth_active"]);
443 $server ->setValue($settings[
"soap_auth_server"]);
444 $port ->setValue($settings[
"soap_auth_port"]);
445 $https ->setChecked($settings[
"soap_auth_use_https"]);
446 $uri ->setValue($settings[
"soap_auth_uri"]);
447 $namespace ->setValue($settings[
"soap_auth_namespace"]);
448 $dotnet ->setChecked($settings[
"soap_auth_use_dotnet"]);
449 $createuser ->setChecked($settings[
"soap_auth_create_users"]);
450 $allowlocal ->setChecked($settings[
"soap_auth_allow_local"]);
451 $defaultrole->setValue($settings[
"soap_auth_user_default_role"]);
452 $sendmail ->setChecked($settings[
"soap_auth_account_mail"]);
455 if (!$defaultrole->getValue())
457 $defaultrole->setValue(4);
461 $soap_config->addItem($active);
462 $soap_config->addItem(
$server);
463 $soap_config->addItem($port);
464 $soap_config->addItem(
$https);
465 $soap_config->addItem($uri);
467 $soap_config->addItem($dotnet);
468 $soap_config->addItem($createuser);
469 $soap_config->addItem($sendmail);
470 $soap_config->addItem($defaultrole);
471 $soap_config->addItem($allowlocal);
473 $this->tpl->setVariable(
"CONFIG_FORM", $soap_config->getHTML());
477 $form->setFormAction(
$ilCtrl->getFormAction($this));
478 $form->setTitle(
"Test Request");
480 $form->addItem($text_prop);
482 $form->addItem($text_prop2);
486 $form->addCommandButton(
"testSoapAuthConnection",
489 if (
$ilCtrl->getCmd() ==
"testSoapAuthConnection")
491 include_once(
"./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
492 $ret =
"<br />".ilSOAPAuth::testConnection(
495 (
boolean)
$_POST[
"new_user"]
498 $this->tpl->setVariable(
"TEST_FORM", $form->getHTML().$ret);
515 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
517 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
521 if (!
$_POST[
"soap"][
"server"])
523 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
527 if (
$_POST[
"soap"][
"server"] !=
"" && (preg_match(
"/^[0-9]{0,5}$/",
$_POST[
"soap"][
"port"])) ==
false)
529 $this->
ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
542 $ilSetting->set(
"soap_auth_user_default_role",
$_POST[
"soap"][
"user_default_role"]);
545 $this->ctrl->redirect($this,
'editSOAP');
557 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
559 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
564 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME",
$_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
569 $settings = $this->
ilias->getAllSettings();
571 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", $settings[
"auth_script_name"]);
574 $this->tabs_gui->setTabActive(
'auth_script');
576 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_script.html",
577 "Services/Authentication");
579 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
580 $this->tpl->setVariable(
"COLSPAN", 3);
581 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->lng->txt(
"auth_script_configure"));
582 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
583 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->lng->txt(
"auth_script_name"));
585 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
586 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
587 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
588 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
599 if (!
$_POST[
"auth_script"][
"name"])
601 $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
614 $this->
ilias->setSetting(
"auth_script_name",
$_POST[
"auth_script"][
"name"]);
617 ilUtil::sendSuccess($this->lng->txt(
"auth_mode_changed_to").
" ".$this->getAuthModeTitle(),
true);
618 $this->ctrl->redirect($this,
'editScript');
630 switch ($this->
ilias->getSetting(
"auth_mode"))
633 return $this->lng->txt(
"auth_local");
637 return $this->lng->txt(
"auth_ldap");
641 return $this->lng->txt(
"auth_shib");
645 return $this->lng->txt(
"auth_radius");
649 return $this->lng->txt(
"auth_script");
653 return $this->lng->txt(
"auth_apache");
657 return $this->lng->txt(
"unknown");
666 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
668 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
671 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
675 $this->ctrl->redirect($this,
'authSettings');
685 if(is_object($this->form))
691 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
693 if($det->getCountActiveAuthModes() <= 1)
698 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
700 $this->form->setFormAction($this->ctrl->getFormAction($this));
701 $this->form->setTableWidth(
'100%');
702 $this->form->setTitle($this->lng->txt(
'auth_auth_settings'));
703 $this->form->addCommandButton(
'updateAuthModeDetermination',$this->lng->txt(
'save'));
705 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
706 $cap =
new ilCheckboxInputGUI($this->lng->txt(
'adm_captcha_anonymous_short'),
'activate_captcha_anonym');
707 $cap->setInfo($this->lng->txt(
'adm_captcha_anonymous_auth'));
711 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
713 $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
714 $this->form->addItem($cap);
717 $header->setTitle($this->lng->txt(
'auth_auth_mode_determination'));
721 $kind->setInfo($this->lng->txt(
'auth_mode_determination_info'));
722 $kind->setValue($det->getKind());
723 $kind->setRequired(
true);
725 $option_user =
new ilRadioOption($this->lng->txt(
'auth_by_user'),0);
726 $kind->addOption($option_user);
728 $option_determination =
new ilRadioOption($this->lng->txt(
'auth_automatic'),1);
730 include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
732 $auth_sequenced = $det->getAuthModeSequence();
734 foreach($auth_sequenced as $auth_mode)
746 $text = $this->lng->txt(
'auth_radius');
749 $text = $this->lng->txt(
'auth_local');
752 $text = $this->lng->txt(
'auth_soap');
755 $text = $this->lng->txt(
'auth_apache');
761 $option = $pl->getMultipleAuthModeOptions($auth_mode);
762 $text = $option[$auth_mode][
'txt'];
771 $pos->setMaxLength(1);
772 $option_determination->addSubItem($pos);
774 $kind->addOption($option_determination);
775 $this->form->addItem($kind);
787 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
790 $det->setKind((
int)
$_POST[
'kind']);
792 $pos =
$_POST[
'position'] ?
$_POST[
'position'] : array();
793 asort($pos,SORT_NUMERIC);
796 foreach($pos as $auth_mode => $dummy)
800 $det->setAuthModeSequence($position ? $position : array());
803 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
804 ilCaptchaUtil::setActiveForLogin((
bool)
$_POST[
'activate_captcha_anonym']);
820 $next_class = $this->ctrl->getNextClass($this);
821 $cmd = $this->ctrl->getCmd();
825 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
827 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),
$ilErr->WARNING);
832 case 'ilregistrationsettingsgui':
834 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
837 $this->tabs_gui->setTabActive(
'registration_settings');
839 $this->ctrl->forwardCommand($registration_gui);
842 case 'ilpermissiongui':
845 $this->tabs_gui->setTabActive(
'perm_settings');
847 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
849 $ret =& $this->ctrl->forwardCommand($perm_gui);
852 case 'illdapsettingsgui':
855 $this->tabs_gui->setTabActive(
'auth_ldap');
857 include_once
'./Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
859 $this->ctrl->forwardCommand($ldap_settings_gui);
862 case 'ilauthshibbolethsettingsgui':
864 $this->tabs_gui->setTabActive(
'auth_shib');
865 include_once(
'./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
867 $this->ctrl->forwardCommand($shib_settings_gui);
870 case 'ilcassettingsgui':
872 $this->tabs_gui->setTabActive(
'auth_cas');
873 include_once
'./Services/CAS/classes/class.ilCASSettingsGUI.php';
875 $this->ctrl->forwardCommand($cas_settings);
878 case 'ilradiussettingsgui':
880 $this->tabs_gui->setTabActive(
'auth_radius');
881 include_once
'./Services/Radius/classes/class.ilRadiusSettingsGUI.php';
883 $this->ctrl->forwardCommand($radius_settings_gui);
887 case 'ilauthloginpageeditorgui':
890 $this->tabs_gui->setTabActive(
'authentication_settings');
891 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
893 include_once
'./Services/Authentication/classes/class.ilAuthLoginPageEditorGUI.php';
895 $this->ctrl->forwardCommand($lpe);
901 $cmd =
"authSettings";
925 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
927 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
929 $this->tabs_gui->addTarget(
"authentication_settings", $this->ctrl->getLinkTarget($this,
"authSettings"),
932 $this->tabs_gui->addTarget(
'registration_settings',
933 $this->ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view'));
935 $this->tabs_gui->addTarget(
"auth_ldap", $this->ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
939 #$this->tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
942 $this->tabs_gui->addTarget(
'auth_shib',$this->ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui',
'settings'));
944 $this->tabs_gui->addTarget(
946 $this->ctrl->getLinkTargetByClass(
'ilcassettingsgui',
'settings')
949 $this->tabs_gui->addTarget(
"auth_radius", $this->ctrl->getLinkTargetByClass(
'ilradiussettingsgui',
"settings"),
952 $this->tabs_gui->addTarget(
"auth_soap", $this->ctrl->getLinkTarget($this,
"editSOAP"),
955 $this->tabs_gui->addTarget(
"apache_auth_settings", $this->ctrl->getLinkTarget($this,
'apacheAuthSettings'),
959 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
961 $this->tabs_gui->addTarget(
"perm_settings",
962 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
963 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
972 global $rbacsystem,
$ilUser,$ilAccess;
974 $GLOBALS[
'lng']->loadLanguageModule(
'auth');
979 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
981 $this->tabs_gui->addSubTabTarget(
"auth_settings",
982 $this->ctrl->getLinkTarget($this,
'authSettings'),
985 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
987 $this->tabs_gui->addSubTabTarget(
989 $this->ctrl->getLinkTargetByClass(
'ilauthloginpageeditorgui',
''),
1002 $this->tabs_gui->setTabActive(
"apache_auth_settings");
1008 $settings =
new ilSetting(
'apache_auth');
1009 $settingsMap = $settings->getAll();
1011 $path = ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt';
1012 if (file_exists(
$path) && is_readable(
$path)) {
1013 $settingsMap[
'apache_auth_domains'] = file_get_contents(
$path);
1016 $form->setValuesByArray($settingsMap);
1018 $tpl->setVariable(
'ADM_CONTENT', $form->getHtml());
1025 $form->setValuesByPost();
1029 if ($form->checkInput())
1031 $settings =
new ilSetting(
'apache_auth');
1034 'apache_auth_indicator_name',
'apache_auth_indicator_value',
1035 'apache_enable_auth',
'apache_enable_local',
'apache_local_autocreate',
1036 'apache_enable_ldap',
'apache_auth_username_config_type',
1037 'apache_auth_username_direct_mapping_fieldname',
1038 'apache_default_role',
'apache_auth_target_override_login_page',
1039 'apache_auth_enable_override_login_page',
1040 'apache_auth_authenticate_on_login_page',
1045 foreach($fields as $field)
1046 $settings->set($field, $form->getInput($field));
1048 if ($form->getInput(
'apache_enable_auth'))
1049 $this->
ilias->setSetting(
'apache_active',
true);
1051 $this->
ilias->setSetting(
'apache_active',
false);
1059 file_put_contents(ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt', $allowedDomains);
1062 $this->ctrl->redirect($this,
'apacheAuthSettings');
1072 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1075 $form->setFormAction($this->ctrl->getFormAction($this));
1076 $form->setTitle($this->lng->txt(
'apache_settings'));
1078 $chb_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_auth'),
'apache_enable_auth');
1079 $form->addItem($chb_enabled);
1081 $chb_local_create_account =
new ilCheckboxInputGUI($this->lng->txt(
'apache_autocreate'),
'apache_local_autocreate');
1082 $chb_enabled->addSubitem($chb_local_create_account);
1085 $roles = $rbacreview->getGlobalRolesArray();
1086 $select =
new ilSelectInputGUI($this->lng->txt(
'apache_default_role'),
'apache_default_role');
1087 $roleOptions = array();
1088 foreach($roles as $role) {
1091 $select->setOptions($roleOptions);
1092 $select->setValue(4);
1094 $chb_local_create_account->addSubitem($select);
1096 $chb_local =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_local'),
'apache_enable_local');
1097 $form->addItem($chb_local);
1099 $chb_ldap =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_ldap'),
'apache_enable_ldap');
1100 $chb_ldap->setInfo($this->lng->txt(
'apache_ldap_hint_ldap_must_be_configured'));
1102 $GLOBALS[
'lng']->loadLanguageModule(
'auth');
1103 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
1107 $ldap_server_select =
new ilSelectInputGUI($this->lng->txt(
'auth_ldap_server_ds'),
'apache_ldap_sid');
1108 $options[0] = $this->lng->txt(
'select_one');
1109 foreach($servers as $server_id)
1112 $options[$server_id] = $ldap_server->getName();
1114 $ldap_server_select->setOptions(
$options);
1115 $ldap_server_select->setRequired(
true);
1118 $ldap_server_select->setValue($ds);
1120 $chb_ldap->addSubItem($ldap_server_select);
1122 $form->addItem($chb_ldap);
1124 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_name'),
'apache_auth_indicator_name');
1125 $txt->setRequired(
true);
1126 $form->addItem(
$txt);
1128 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_value'),
'apache_auth_indicator_value');
1129 $txt->setRequired(
true);
1130 $form->addItem(
$txt);
1133 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_enable_override_login'),
'apache_auth_enable_override_login_page');
1134 $form->addItem($chb);
1136 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_target_override_login'),
'apache_auth_target_override_login_page');
1137 $txt->setRequired(
true);
1138 $chb->addSubItem(
$txt);
1140 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_authenticate_on_login_page'),
'apache_auth_authenticate_on_login_page');
1141 $form->addItem($chb);
1144 $sec->setTitle($this->lng->txt(
'apache_auth_username_config'));
1145 $form->addItem($sec);
1147 $rag =
new ilRadioGroupInputGUI($this->lng->txt(
'apache_auth_username_config_type'),
'apache_auth_username_config_type');
1148 $form->addItem($rag);
1150 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_direct_mapping'), 1);
1151 $rag->addOption($rao);
1153 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_username_direct_mapping_fieldname'),
'apache_auth_username_direct_mapping_fieldname');
1155 $rao->addSubItem(
$txt);
1157 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_extended_mapping'), 2);
1158 $rao->setDisabled(
true);
1159 $rag->addOption($rao);
1161 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_by_function'), 3);
1162 $rag->addOption($rao);
1168 $sec->setTitle($this->lng->txt(
'apache_auth_security'));
1169 $form->addItem($sec);
1172 $txt->setInfo($this->lng->txt(
'apache_auth_domains_description'));
1174 $form->addItem(
$txt);
1176 $form->addCommandButton(
'saveApacheSettings',$this->lng->txt(
'save'));
1177 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1183 return join(
"\n", preg_split(
"/[\r\n]+/",
$text));
1195 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
1200 return array(
'authentication_settings' => array(
'authSettings', $fields));
An exception for terminatinating execution or to throw for unit testing.
Login page editor settings GUI ILIAS page editor or richtext editor.
static _getInstance()
Get instance.
Class ilAuthShibbolethSettingsGUI.
static _getActiveAuthModes()
static getAuthPlugins()
Get active enabled auth plugins.
static _getAllAuthModes()
static _getAuthModeName($a_auth_key)
static checkFreetype()
Check whether captcha support is active.
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
static getDataSource($a_auth_mode)
static getInstanceByServerId($a_server_id)
Get instance by server id.
static isAuthModeLDAP($a_auth_mode)
Check if user auth mode is LDAP.
static getServerIds()
Get all server ids @global ilDB $ilDB.
Class ilObjAuthSettingsGUI.
validateApacheAuthAllowedDomains($text)
getAdminTabs()
administration tabs show only permissions and trash folder
setSubTabs($a_tab)
set sub tabs
addToExternalSettingsForm($a_form_id)
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor @access public.
saveScriptObject()
validates all input data, save them to database if correct and active chosen auth mode
getApacheAuthSettingsForm()
updateAuthModeDeterminationObject()
update auth mode determination
loginInfoObject()
displays login information of all installed languages
executeCommand()
Execute command.
apacheAuthSettingsObject($form=false)
getAuthModeTitle()
get the title of auth mode
saveApacheSettingsObject()
editSOAPObject()
Configure soap settings.
cancelObject()
cancel action and go back to previous page @access public
authSettingsObject()
display settings menu
viewObject()
list childs of current object
testSoapAuthConnectionObject()
initAuthModeDetermination()
init auth mode determinitation form
saveSOAPObject()
validates all input data, save them to database if correct and active chosen auth mode
getTabs()
get tabs @access public
editScriptObject()
Configure Custom settings.
static _lookupRegisterAllowed()
get all roles that are activated in user registration
static _updateAuthMode($a_roles)
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
static _lookupTitle($a_id)
lookup object title
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
Class ilRegistrationSettingsGUI.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($err=$client->getError()) $namespace
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
redirection script todo: (a better solution should control the processing via a xml file)
if(!is_array($argv)) $options