17 require_once
"./classes/class.ilObjectGUI.php";
28 $this->
ilObjectGUI($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);
40 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
43 $this->tabs_gui->setTabActive(
'registration_settings');
46 $this->ctrl->setCmdClass(
'ilregistrationsettingsgui');
47 $this->ctrl->forwardCommand($registration_gui);
60 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
62 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
65 $this->tabs_gui->setTabActive(
'authentication_settings');
67 $this->tabs_gui->setSubTabActive(
"auth_settings");
71 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
72 $this->tpl->setVariable(
"TXT_AUTH_TITLE", $this->lng->txt(
"auth_select"));
74 $this->tpl->setVariable(
"TXT_AUTH_MODE", $this->lng->txt(
"auth_mode"));
75 $this->tpl->setVariable(
"TXT_AUTH_DEFAULT", $this->lng->txt(
"default"));
76 $this->tpl->setVariable(
"TXT_AUTH_ACTIVE", $this->lng->txt(
"active"));
77 $this->tpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->lng->txt(
"num_users"));
79 $this->tpl->setVariable(
"TXT_LOCAL", $this->lng->txt(
"auth_local"));
80 $this->tpl->setVariable(
"TXT_LDAP", $this->lng->txt(
"auth_ldap"));
81 $this->tpl->setVariable(
"TXT_SHIB", $this->lng->txt(
"auth_shib"));
83 $this->tpl->setVariable(
"TXT_CAS", $this->lng->txt(
"auth_cas"));
85 $this->tpl->setVariable(
"TXT_RADIUS", $this->lng->txt(
"auth_radius"));
86 $this->tpl->setVariable(
"TXT_SCRIPT", $this->lng->txt(
"auth_script"));
88 $this->tpl->setVariable(
"TXT_APACHE", $this->lng->txt(
"auth_apache"));
93 foreach($auth_modes as $mode => $mode_name)
96 if ($ilSetting->get(
'auth_mode') == $mode)
98 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
99 ((
int) $auth_cnt[$mode_name] + $auth_cnt[
"default"]).
" (".$this->lng->txt(
"auth_per_default").
100 ": ".$auth_cnt[
"default"].
")");
104 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
105 (
int) $auth_cnt[$mode_name]);
109 $this->tpl->setVariable(
"TXT_CONFIGURE", $this->lng->txt(
"auth_configure"));
110 $this->tpl->setVariable(
"TXT_AUTH_REMARK", $this->lng->txt(
"auth_remark_non_local_auth"));
111 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
112 $this->tpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
115 $checked =
"checked=\"checked\"";
116 $disabled =
"disabled=\"disabled\"";
117 $style_disabled =
"_disabled";
120 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$this->lng->txt(
"enabled").
"\" title=\"".$this->lng->txt(
"enabled").
"\" border=\"0\" vspace=\"0\"/>";
121 $icon_not_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_not_ok.gif").
"\" alt=\"".$this->lng->txt(
"disabled").
"\" title=\"".$this->lng->txt(
"disabled").
"\" border=\"0\" vspace=\"0\"/>";
123 $this->tpl->setVariable(
"AUTH_LOCAL_ACTIVE", $icon_ok);
125 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
127 #$this->tpl->setVariable("AUTH_LDAP_ACTIVE", $this->ilias->getSetting('ldap_active') ? $icon_ok : $icon_not_ok);
128 $this->tpl->setVariable(
"AUTH_RADIUS_ACTIVE", $this->ilias->getSetting(
'radius_active') ? $icon_ok : $icon_not_ok);
129 $this->tpl->setVariable(
"AUTH_SHIB_ACTIVE", $this->ilias->getSetting(
'shib_active') ? $icon_ok : $icon_not_ok);
130 $this->tpl->setVariable(
"AUTH_SCRIPT_ACTIVE", $this->ilias->getSetting(
'script_active') ? $icon_ok : $icon_not_ok);
131 $this->tpl->setVariable(
"AUTH_CAS_ACTIVE", $this->ilias->getSetting(
'cas_active') ? $icon_ok : $icon_not_ok);
132 $this->tpl->setVariable(
"AUTH_APACHE_ACTIVE", $this->ilias->getSetting(
'apache_active') ? $icon_ok : $icon_not_ok);
135 switch ($this->ilias->getSetting(
'auth_mode'))
138 $this->tpl->setVariable(
"CHK_LOCAL", $checked);
142 $this->tpl->setVariable(
"CHK_LDAP", $checked);
146 $this->tpl->setVariable(
"CHK_SHIB", $checked);
150 $this->tpl->setVariable(
"CHK_RADIUS", $checked);
154 $this->tpl->setVariable(
"CHK_CAS", $checked);
158 $this->tpl->setVariable(
"CHK_SCRIPT", $checked);
162 $this->tpl->setVariable(
"CHK_APACHE", $checked);
169 $this->tpl->setVariable(
'TABLE_AUTH_DETERMINATION',$this->form->getHTML());
173 $this->tpl->setVariable(
"FORMACTION_ROLES",
174 $this->ctrl->getFormAction($this));
175 $this->tpl->setVariable(
"TXT_AUTH_ROLES", $this->lng->txt(
"auth_active_roles"));
176 $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
"obj_role"));
177 $this->tpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->lng->txt(
"auth_role_auth_mode"));
178 $this->tpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
180 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
184 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
187 foreach ($reg_roles as $role)
189 foreach ($active_auth_modes as $auth_name => $auth_key)
194 if ($auth_name ==
"default" || $auth_name ==
"cas"
195 || $auth_name ==
"shibboleth" || $auth_name ==
'ldap' || $auth_name ==
'apache')
200 $this->tpl->setCurrentBlock(
"auth_mode_selection");
202 if ($auth_name ==
'default')
208 $name = $this->lng->txt(
'auth_'.$auth_name);
211 $this->tpl->setVariable(
"AUTH_MODE_NAME", $name);
213 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
215 if ($role[
'auth_mode'] == $auth_name)
217 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
220 $this->tpl->parseCurrentBlock();
223 $this->tpl->setCurrentBlock(
"roles");
224 $this->tpl->setVariable(
"ROLE", $role[
'title']);
225 $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
226 $this->tpl->parseCurrentBlock();
241 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
243 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
247 if ($this->form->checkInput())
251 $this->loginSettings =
new ilSetting(
"login_settings");
253 foreach (
$_POST as $key => $val)
255 if (substr($key, 0, 14) ==
"login_message_")
257 $this->loginSettings->set($key, $val);
262 if(
$_POST[
'default_auth_mode'])
264 $ilSetting->set(
'default_auth_mode',(
int)
$_POST[
'default_auth_mode']);
283 if (!$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId()))
285 $this->ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
288 $this->tabs_gui->setTabActive(
"authentication_settings");
290 $this->tabs_gui->setSubTabActive(
"login_information");
292 $lng->loadLanguageModule(
"meta");
294 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_login_messages.html");
295 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
296 $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
"login_information"));
297 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"login_information_desc"));
298 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
300 $this->tpl->setVariable(
'LOGIN_INFO',$this->form->getHTML());
310 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
312 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveLoginInfo'));
313 $this->form->setTableWidth(
'80%');
314 $this->form->setTitle($this->lng->txt(
'login_information'));
315 #$form->setInfo($this->lng->txt('login_information_desc'));
317 $this->form->addCommandButton(
'saveLoginInfo',$this->lng->txt(
'save'));
318 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
320 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
321 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
325 $select =
new ilSelectInputGUI($this->lng->txt(
'default_auth_mode'),
'default_auth_mode');
327 $select->setInfo($this->lng->txt(
'default_auth_mode_info'));
328 $options[
AUTH_LOCAL] = $this->lng->txt(
'auth_local');
331 $options[
AUTH_LDAP] = $this->lng->txt(
'auth_ldap');
333 if($rad_settings->isActive())
335 $options [
AUTH_RADIUS] = $this->lng->txt(
'auth_radius');
337 $select->setOptions($options);
338 $this->form->addItem($select);
341 if (!is_object($this->loginSettings))
343 $this->loginSettings =
new ilSetting(
"login_settings");
346 $login_settings = $this->loginSettings->getAll();
347 $languages = $lng->getInstalledLanguages();
348 $def_language = $lng->getDefaultLanguage();
350 foreach ($this->
setDefLangFirst($def_language, $languages) as $lang_key)
353 if ($lang_key == $def_language)
355 $add =
" (".$lng->txt(
"default").
")";
359 'login_message_'.$lang_key);
361 $textarea->setValue($login_settings[
"login_message_".$lang_key]);
362 $textarea->setUseRte(
true);
363 $textarea->setRteTagSet(
"extended");
364 $this->form->addItem($textarea);
366 unset($login_settings[
"login_message_".$lang_key]);
369 foreach ($login_settings as $key => $message)
371 $lang_key = substr($key, strrpos($key,
"_") + 1, strlen($key) - strrpos($key,
"_"));
374 'login_message_'.$lang_key);
376 $textarea->setValue($message);
377 $textarea->setUseRte(
true);
379 if(!in_array($lang_key,$languages))
381 $textarea->setAlert($lng->txt(
"not_installed"));
383 $this->form->addItem($textarea);
400 if (is_array($a_languages) && $a_def_language !=
"")
402 $languages = array();
403 $languages[] = $a_def_language;
405 foreach ($a_languages as $val)
407 if (!in_array($val, $languages))
423 $this->ctrl->redirect($this,
"authSettings");
430 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
432 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
435 if (empty(
$_POST[
"auth_mode"]))
437 $this->ilias->raiseError($this->lng->txt(
"auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
440 if (
$_POST[
"auth_mode"] == AUTH_DEFAULT)
443 $this->ctrl->redirect($this,
'authSettings');
446 switch (
$_POST[
"auth_mode"])
460 if ($this->object->checkAuthSHIB() !==
true)
468 if ($this->object->checkAuthRADIUS() !==
true)
471 $this->ctrl->redirect($this,
'editRADIUS');
476 if ($this->object->checkAuthScript() !==
true)
484 $this->ilias->setSetting(
"auth_mode",
$_POST[
"auth_mode"]);
487 $this->ctrl->redirect($this,
'authSettings');
503 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
505 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
508 $this->tabs_gui->setTabActive(
'auth_cas');
514 $settings = $ilSetting->getAll();
519 if (
$_SESSION[
"error_post_vars"][
"cas"][
"active"] ==
"1")
521 $this->tpl->setVariable(
"CHK_CAS_ACTIVE",
"checked=\"checked\"");
523 if (
$_SESSION[
"error_post_vars"][
"cas"][
"create_users"] ==
"1")
525 $this->tpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
527 if (
$_SESSION[
"error_post_vars"][
"cas"][
"allow_local"] ==
"1")
529 $this->tpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
532 $this->tpl->setVariable(
"CAS_SERVER",
$_SESSION[
"error_post_vars"][
"cas"][
"server"]);
533 $this->tpl->setVariable(
"CAS_PORT",
$_SESSION[
"error_post_vars"][
"cas"][
"port"]);
534 $this->tpl->setVariable(
"CAS_URI",
$_SESSION[
"error_post_vars"][
"cas"][
"uri"]);
535 $this->tpl->setVariable(
"CAS_LOGIN_INSTRUCTIONS",
$_SESSION[
"error_post_vars"][
"cas"][
"login_instructions"]);
536 $current_default_role =
$_SESSION[
"error_post_vars"][
"cas"][
"user_default_role"];
540 if ($settings[
"cas_active"] ==
"1")
542 $this->tpl->setVariable(
"CHK_CAS_ACTIVE",
"checked=\"checked\"");
544 if ($settings[
"cas_create_users"] ==
"1")
546 $this->tpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
548 if ($settings[
"cas_allow_local"] ==
"1")
550 $this->tpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
553 $this->tpl->setVariable(
"CAS_SERVER", $settings[
"cas_server"]);
554 $this->tpl->setVariable(
"CAS_PORT", $settings[
"cas_port"]);
555 $this->tpl->setVariable(
"CAS_URI", $settings[
"cas_uri"]);
556 $this->tpl->setVariable(
"CAS_LOGIN_INSTRUCTIONS", $settings[
"cas_login_instructions"]);
557 $current_default_role = $settings[
"cas_user_default_role"];
561 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
562 if (!$current_default_role)
564 $current_default_role = 4;
567 foreach ($role_list as $role)
569 $roles[$role[
'obj_id']] = $role[
'title'];
572 "cas[user_default_role]", $roles,
false,
true);
574 $this->tpl->setVariable(
"CAS_USER_DEFAULT_ROLE", $selectElement);
575 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
576 $this->tpl->setVariable(
"COLSPAN", 3);
577 $this->tpl->setVariable(
"TXT_CAS_TITLE", $this->lng->txt(
"auth_cas_auth"));
578 $this->tpl->setVariable(
"TXT_CAS_DESC", $this->lng->txt(
"auth_cas_auth_desc"));
579 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
580 $this->tpl->setVariable(
"TXT_CAS_ACTIVE", $this->lng->txt(
"active"));
581 $this->tpl->setVariable(
"TXT_CAS_SERVER", $this->lng->txt(
"server"));
582 $this->tpl->setVariable(
"TXT_CAS_SERVER_DESC", $this->lng->txt(
"auth_cas_server_desc"));
583 $this->tpl->setVariable(
"TXT_CAS_PORT", $this->lng->txt(
"port"));
584 $this->tpl->setVariable(
"TXT_CAS_PORT_DESC", $this->lng->txt(
"auth_cas_port_desc"));
585 $this->tpl->setVariable(
"TXT_CAS_URI", $this->lng->txt(
"uri"));
586 $this->tpl->setVariable(
"TXT_CAS_URI_DESC", $this->lng->txt(
"auth_cas_uri_desc"));
587 $this->tpl->setVariable(
"TXT_CAS_LOGIN_INSTRUCTIONS", $this->lng->txt(
"auth_login_instructions"));
588 $this->tpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
589 $this->tpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_cas_create_users_desc"));
590 $this->tpl->setVariable(
"TXT_CAS_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
591 $this->tpl->setVariable(
"TXT_CAS_USER_DEFAULT_ROLE_DESC",
592 $this->lng->txt(
"auth_cas_user_default_role_desc"));
593 $this->tpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
594 $this->tpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_cas_allow_local_desc"));
595 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
596 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
597 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
598 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveCAS");
610 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
612 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
618 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
622 if ((preg_match(
"/^[0-9]{0,5}$/",
$_POST[
"cas"][
"port"])) ==
false)
624 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
627 $ilSetting->set(
"cas_server",
$_POST[
"cas"][
"server"]);
628 $ilSetting->set(
"cas_port",
$_POST[
"cas"][
"port"]);
629 $ilSetting->set(
"cas_uri",
$_POST[
"cas"][
"uri"]);
630 $ilSetting->set(
"cas_login_instructions",
$_POST[
"cas"][
"login_instructions"]);
631 $ilSetting->set(
"cas_active",
$_POST[
"cas"][
"active"]);
632 $ilSetting->set(
"cas_create_users",
$_POST[
"cas"][
"create_users"]);
633 $ilSetting->set(
"cas_allow_local",
$_POST[
"cas"][
"allow_local"]);
634 $ilSetting->set(
"cas_active",
$_POST[
"cas"][
"active"]);
635 $ilSetting->set(
"cas_user_default_role",
$_POST[
"cas"][
"user_default_role"]);
638 $this->ctrl->redirect($this,
'editCAS');
650 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
652 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
655 $this->tabs_gui->setTabActive(
'auth_soap');
658 $stpl =
new ilTemplate(
"tpl.auth_soap.html",
true,
true,
"");
663 $settings = $ilSetting->getAll();
668 if (
$_SESSION[
"error_post_vars"][
"soap"][
"active"] ==
"1")
670 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
672 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_https"] ==
"1")
674 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
676 if (
$_SESSION[
"error_post_vars"][
"soap"][
"create_users"] ==
"1")
678 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
680 if (
$_SESSION[
"error_post_vars"][
"soap"][
"allow_local"] ==
"1")
682 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
684 if (
$_SESSION[
"error_post_vars"][
"soap"][
"account_mail"] ==
"1")
686 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
688 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_dotnet"] ==
"1")
690 $stpl->setVariable(
"CHK_USEDOTNET",
"checked=\"checked\"");
693 $stpl->setVariable(
"SOAP_SERVER",
$_SESSION[
"error_post_vars"][
"soap"][
"server"]);
694 $stpl->setVariable(
"SOAP_PORT",
$_SESSION[
"error_post_vars"][
"soap"][
"port"]);
695 $stpl->setVariable(
"SOAP_URI",
$_SESSION[
"error_post_vars"][
"soap"][
"uri"]);
696 $stpl->setVariable(
"SOAP_NAMESPACE",
$_SESSION[
"error_post_vars"][
"soap"][
"namespace"]);
697 $current_default_role =
$_SESSION[
"error_post_vars"][
"soap"][
"user_default_role"];
701 if ($settings[
"soap_auth_active"] ==
"1")
703 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
705 if ($settings[
"soap_auth_use_https"] ==
"1")
707 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
709 if ($settings[
"soap_auth_create_users"] ==
"1")
711 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
713 if ($settings[
"soap_auth_allow_local"] ==
"1")
715 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
717 if ($settings[
"soap_auth_account_mail"] ==
"1")
719 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
721 if ($settings[
"soap_auth_use_dotnet"] ==
"1")
723 $stpl->setVariable(
"CHK_USE_DOTNET",
"checked=\"checked\"");
726 $stpl->setVariable(
"SOAP_SERVER", $settings[
"soap_auth_server"]);
727 $stpl->setVariable(
"SOAP_PORT", $settings[
"soap_auth_port"]);
728 $stpl->setVariable(
"SOAP_URI", $settings[
"soap_auth_uri"]);
729 $stpl->setVariable(
"SOAP_NAMESPACE", $settings[
"soap_auth_namespace"]);
730 $current_default_role = $settings[
"soap_auth_user_default_role"];
734 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
735 if (!$current_default_role)
737 $current_default_role = 4;
740 foreach ($role_list as $role)
742 $roles[$role[
'obj_id']] = $role[
'title'];
745 "soap[user_default_role]", $roles,
false,
true);
747 $stpl->setVariable(
"SOAP_USER_DEFAULT_ROLE", $selectElement);
748 $stpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
749 $stpl->setVariable(
"COLSPAN", 3);
750 $stpl->setVariable(
"TXT_SOAP_TITLE", $this->lng->txt(
"auth_soap_auth"));
751 $stpl->setVariable(
"TXT_SOAP_DESC", $this->lng->txt(
"auth_soap_auth_desc"));
752 $stpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
753 $stpl->setVariable(
"TXT_SOAP_ACTIVE", $this->lng->txt(
"active"));
754 $stpl->setVariable(
"TXT_SOAP_SERVER", $this->lng->txt(
"server"));
755 $stpl->setVariable(
"TXT_SOAP_SERVER_DESC", $this->lng->txt(
"auth_soap_server_desc"));
756 $stpl->setVariable(
"TXT_SOAP_PORT", $this->lng->txt(
"port"));
757 $stpl->setVariable(
"TXT_SOAP_PORT_DESC", $this->lng->txt(
"auth_soap_port_desc"));
758 $stpl->setVariable(
"TXT_SOAP_URI", $this->lng->txt(
"uri"));
759 $stpl->setVariable(
"TXT_SOAP_URI_DESC", $this->lng->txt(
"auth_soap_uri_desc"));
760 $stpl->setVariable(
"TXT_SOAP_NAMESPACE", $this->lng->txt(
"auth_soap_namespace"));
761 $stpl->setVariable(
"TXT_SOAP_NAMESPACE_DESC", $this->lng->txt(
"auth_soap_namespace_desc"));
762 $stpl->setVariable(
"TXT_USE_DOTNET", $this->lng->txt(
"auth_soap_use_dotnet"));
763 $stpl->setVariable(
"TXT_USE_HTTPS", $this->lng->txt(
"auth_soap_use_https"));
764 $stpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
765 $stpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_soap_create_users_desc"));
766 $stpl->setVariable(
"TXT_ACCOUNT_MAIL", $this->lng->txt(
"user_send_new_account_mail"));
767 $stpl->setVariable(
"TXT_ACCOUNT_MAIL_DESC", $this->lng->txt(
"auth_new_account_mail_desc"));
768 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
769 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE_DESC",
770 $this->lng->txt(
"auth_soap_user_default_role_desc"));
771 $stpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
772 $stpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_soap_allow_local_desc"));
773 $stpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
774 $stpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
775 $stpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
776 $stpl->setVariable(
"CMD_SUBMIT",
"saveSOAP");
779 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
781 $form->setFormAction($ilCtrl->getFormAction($this));
782 $form->setTitle(
"Test Request");
784 $form->addItem($text_prop);
786 $form->addItem($text_prop2);
790 $form->addCommandButton(
"testSoapAuthConnection",
793 if ($ilCtrl->getCmd() ==
"testSoapAuthConnection")
795 include_once(
"./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
796 $ret =
"<br />".ilSOAPAuth::testConnection(
799 (
boolean)
$_POST[
"new_user"]
803 $stpl->setVariable(
"TEST_FORM", $form->getHtml().$ret);
804 $this->tpl->setContent($stpl->get());
821 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
823 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
827 if (!
$_POST[
"soap"][
"server"])
829 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
833 if (
$_POST[
"soap"][
"server"] !=
"" && (preg_match(
"/^[0-9]{0,5}$/",
$_POST[
"soap"][
"port"])) ==
false)
835 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
838 $ilSetting->set(
"soap_auth_server",
$_POST[
"soap"][
"server"]);
839 $ilSetting->set(
"soap_auth_port",
$_POST[
"soap"][
"port"]);
840 $ilSetting->set(
"soap_auth_active",
$_POST[
"soap"][
"active"]);
841 $ilSetting->set(
"soap_auth_uri",
$_POST[
"soap"][
"uri"]);
842 $ilSetting->set(
"soap_auth_namespace",
$_POST[
"soap"][
"namespace"]);
843 $ilSetting->set(
"soap_auth_create_users",
$_POST[
"soap"][
"create_users"]);
844 $ilSetting->set(
"soap_auth_allow_local",
$_POST[
"soap"][
"allow_local"]);
845 $ilSetting->set(
"soap_auth_account_mail",
$_POST[
"soap"][
"account_mail"]);
846 $ilSetting->set(
"soap_auth_use_https",
$_POST[
"soap"][
"use_https"]);
847 $ilSetting->set(
"soap_auth_use_dotnet",
$_POST[
"soap"][
"use_dotnet"]);
848 $ilSetting->set(
"soap_auth_user_default_role",
$_POST[
"soap"][
"user_default_role"]);
851 $this->ctrl->redirect($this,
'editSOAP');
863 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
865 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
870 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME",
$_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
875 $settings = $this->ilias->getAllSettings();
877 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", $settings[
"auth_script_name"]);
880 $this->tabs_gui->setTabActive(
'auth_script');
884 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
885 $this->tpl->setVariable(
"COLSPAN", 3);
886 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->lng->txt(
"auth_script_configure"));
887 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
888 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->lng->txt(
"auth_script_name"));
890 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
891 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
892 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
893 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
904 if (!
$_POST[
"auth_script"][
"name"])
906 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
919 $this->ilias->setSetting(
"auth_script_name",
$_POST[
"auth_script"][
"name"]);
920 $this->ilias->setSetting(
"auth_mode",
AUTH_SCRIPT);
923 $this->ctrl->redirect($this,
'editScript');
935 switch ($this->ilias->getSetting(
"auth_mode"))
938 return $this->lng->txt(
"auth_local");
942 return $this->lng->txt(
"auth_ldap");
946 return $this->lng->txt(
"auth_shib");
950 return $this->lng->txt(
"auth_radius");
954 return $this->lng->txt(
"auth_script");
958 return $this->lng->txt(
"auth_apache");
962 return $this->lng->txt(
"unknown");
971 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
973 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
976 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
980 $this->ctrl->redirect($this,
'authSettings');
990 if(is_object($this->form))
996 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
998 if($det->getCountActiveAuthModes() <= 1)
1003 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1005 $this->form->setFormAction($this->ctrl->getFormAction($this));
1006 $this->form->setTableWidth(
'100%');
1007 $this->form->setTitle($this->lng->txt(
'auth_auth_mode_determination'));
1008 $this->form->addCommandButton(
'updateAuthModeDetermination',$this->lng->txt(
'save'));
1009 $this->form->addCommandButton(
'authSettings',$this->lng->txt(
'cancel'));
1012 $kind->
setInfo($this->lng->txt(
'auth_mode_determination_info'));
1013 $kind->setValue($det->getKind());
1014 $kind->setRequired(
true);
1016 $option_user =
new ilRadioOption($this->lng->txt(
'auth_by_user'),0);
1017 $kind->addOption($option_user);
1019 $option_determination =
new ilRadioOption($this->lng->txt(
'auth_automatic'),1);
1021 include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
1023 $auth_sequenced = $det->getAuthModeSequence();
1025 foreach($auth_sequenced as $auth_mode)
1030 $text = $this->lng->txt(
'auth_ldap');
1033 $text = $this->lng->txt(
'auth_radius');
1036 $text = $this->lng->txt(
'auth_local');
1039 $text = $this->lng->txt(
'auth_soap');
1042 $text = $this->lng->txt(
'auth_apache');
1048 $pos->setValue($counter++);
1050 $pos->setMaxLength(1);
1051 $option_determination->addSubItem($pos);
1053 $kind->addOption($option_determination);
1054 $this->form->addItem($kind);
1066 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
1069 $det->setKind((
int)
$_POST[
'kind']);
1071 $pos = $_POST[
'position'] ? $_POST[
'position'] : array();
1072 asort($pos,SORT_NUMERIC);
1075 foreach($pos as $auth_mode => $dummy)
1077 $position[$counter++] = $auth_mode;
1079 $det->setAuthModeSequence($position ? $position : array());
1091 $next_class = $this->ctrl->getNextClass($this);
1092 $cmd = $this->ctrl->getCmd();
1096 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
1098 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
1103 case 'ilregistrationsettingsgui':
1105 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
1108 $this->tabs_gui->setTabActive(
'registration_settings');
1110 $this->ctrl->forwardCommand($registration_gui);
1113 case 'ilpermissiongui':
1116 $this->tabs_gui->setTabActive(
'perm_settings');
1118 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
1120 $ret =& $this->ctrl->forwardCommand($perm_gui);
1123 case 'illdapsettingsgui':
1126 $this->tabs_gui->setTabActive(
'auth_ldap');
1128 include_once
'./Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
1130 $this->ctrl->forwardCommand($ldap_settings_gui);
1133 case 'ilauthshibbolethsettingsgui':
1135 $this->tabs_gui->setTabActive(
'auth_shib');
1136 include_once(
'./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
1138 $this->ctrl->forwardCommand($shib_settings_gui);
1141 case 'ilradiussettingsgui':
1143 $this->tabs_gui->setTabActive(
'auth_radius');
1144 include_once
'./Services/Radius/classes/class.ilRadiusSettingsGUI.php';
1146 $this->ctrl->forwardCommand($radius_settings_gui);
1149 case 'ilopenidsettingsgui':
1151 $this->tabs_gui->setTabActive(
'auth_openid');
1153 include_once
'./Services/OpenId/classes/class.ilOpenIdSettingsGUI.php';
1155 $this->ctrl->forwardCommand($os);
1161 $cmd =
"authSettings";
1185 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
1187 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1190 $tabs_gui->addTarget(
'registration_settings',
1191 $this->ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view'));
1193 $tabs_gui->addTarget(
"authentication_settings", $this->ctrl->getLinkTarget($this,
"authSettings"),
1196 $tabs_gui->addTarget(
"auth_ldap", $this->ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
1200 #$tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
1203 $tabs_gui->addTarget(
'auth_shib',$this->ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui',
'settings'));
1205 $tabs_gui->addTarget(
"auth_cas", $this->ctrl->getLinkTarget($this,
"editCAS"),
1208 $tabs_gui->addTarget(
"auth_radius", $this->ctrl->getLinkTargetByClass(
'ilradiussettingsgui',
"settings"),
1211 $tabs_gui->addTarget(
"auth_soap", $this->ctrl->getLinkTarget($this,
"editSOAP"),
1214 $tabs_gui->addTarget(
1216 $this->ctrl->getLinkTargetByClass(
'ilopenidsettingsgui',
'settings'),
1222 $tabs_gui->addTarget(
"apache_auth_settings", $this->ctrl->getLinkTarget($this,
'apacheAuthSettings'),
1226 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1228 $tabs_gui->addTarget(
"perm_settings",
1229 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1230 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1239 global $rbacsystem,$ilUser,$ilAccess;
1243 case 'authSettings':
1244 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1246 $this->tabs_gui->addSubTabTarget(
"auth_settings",
1247 $this->ctrl->getLinkTarget($this,
'authSettings'),
1251 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1253 $this->tabs_gui->addSubTabTarget(
"login_information",
1254 $this->ctrl->getLinkTarget($this,
'loginInfo'),
1266 $this->tabs_gui->setTabActive(
"apache_auth_settings");
1273 $settings =
new ilSetting(
'apache_auth');
1274 $settingsMap = $settings->getAll();
1276 $path = ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt';
1277 if (file_exists(
$path) && is_readable(
$path)) {
1278 $settingsMap[
'apache_auth_domains'] = file_get_contents(
$path);
1281 $form->setValuesByArray($settingsMap);
1283 $tpl->setVariable(
'ADM_CONTENT', $form->getHtml());
1290 $form->setValuesByPost();
1294 if ($form->checkInput())
1296 $settings =
new ilSetting(
'apache_auth');
1299 'apache_auth_indicator_name',
'apache_auth_indicator_value',
1300 'apache_enable_auth',
'apache_enable_local',
'apache_local_autocreate',
1301 'apache_enable_ldap',
'apache_auth_username_config_type',
1302 'apache_auth_username_direct_mapping_fieldname',
1303 'apache_default_role',
'apache_auth_target_override_login_page',
1304 'apache_auth_enable_override_login_page',
1305 'apache_auth_authenticate_on_login_page'
1309 foreach($fields as $field)
1310 $settings->set($field, $form->getInput($field));
1312 if ($form->getInput(
'apache_enable_auth'))
1313 $this->ilias->setSetting(
'apache_active',
true);
1315 $this->ilias->setSetting(
'apache_active',
false);
1317 if ($ilSetting->get(
"auth_mode") ==
AUTH_APACHE) {
1323 file_put_contents(ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt', $allowedDomains);
1326 $this->ctrl->redirect($this,
'apacheAuthSettings');
1336 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1339 $form->setFormAction($this->ctrl->getFormAction($this));
1340 $form->setTitle($this->lng->txt(
'apache_settings'));
1342 $chb_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_auth'),
'apache_enable_auth');
1343 $form->addItem($chb_enabled);
1345 $chb_local_create_account =
new ilCheckboxInputGUI($this->lng->txt(
'apache_autocreate'),
'apache_local_autocreate');
1346 $chb_enabled->addSubitem($chb_local_create_account);
1349 $roles = $rbacreview->getGlobalRolesArray();
1350 $select =
new ilSelectInputGUI($this->lng->txt(
'apache_default_role'),
'apache_default_role');
1351 $roleOptions = array();
1352 foreach($roles as $role) {
1355 $select->setOptions($roleOptions);
1356 $select->setValue(4);
1358 $chb_local_create_account->addSubitem($select);
1360 $chb_local =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_local'),
'apache_enable_local');
1361 $form->addItem($chb_local);
1367 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_name'),
'apache_auth_indicator_name');
1369 $form->addItem($txt);
1371 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_value'),
'apache_auth_indicator_value');
1373 $form->addItem($txt);
1376 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_enable_override_login'),
'apache_auth_enable_override_login_page');
1377 $form->addItem($chb);
1379 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_target_override_login'),
'apache_auth_target_override_login_page');
1381 $chb->addSubItem($txt);
1383 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_authenticate_on_login_page'),
'apache_auth_authenticate_on_login_page');
1384 $form->addItem($chb);
1387 $sec->setTitle($this->lng->txt(
'apache_auth_username_config'));
1388 $form->addItem($sec);
1390 $rag =
new ilRadioGroupInputGUI($this->lng->txt(
'apache_auth_username_config_type'),
'apache_auth_username_config_type');
1391 $form->addItem($rag);
1393 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_direct_mapping'), 1);
1394 $rag->addOption($rao);
1396 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_username_direct_mapping_fieldname'),
'apache_auth_username_direct_mapping_fieldname');
1400 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_extended_mapping'), 2);
1402 $rag->addOption($rao);
1404 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_by_function'), 3);
1405 $rag->addOption($rao);
1411 $sec->setTitle($this->lng->txt(
'apache_auth_security'));
1412 $form->addItem($sec);
1414 $txt =
new ilTextAreaInputGUI($this->lng->txt(
'apache_auth_domains'),
'apache_auth_domains');
1415 $txt->
setInfo($this->lng->txt(
'apache_auth_domains_description'));
1417 $form->addItem($txt);
1419 $form->addCommandButton(
'saveApacheSettings',$this->lng->txt(
'save'));
1420 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1426 return join(
"\n", preg_split(
"/[\r\n]+/", $text));