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"));
91 foreach($auth_modes as $mode => $mode_name)
94 if ($ilSetting->get(
'auth_mode') == $mode)
96 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
97 ((
int) $auth_cnt[$mode_name] + $auth_cnt[
"default"]).
" (".$this->lng->txt(
"auth_per_default").
98 ": ".$auth_cnt[
"default"].
")");
102 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
103 (
int) $auth_cnt[$mode_name]);
107 $this->tpl->setVariable(
"TXT_CONFIGURE", $this->lng->txt(
"auth_configure"));
108 $this->tpl->setVariable(
"TXT_AUTH_REMARK", $this->lng->txt(
"auth_remark_non_local_auth"));
109 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
110 $this->tpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
113 $checked =
"checked=\"checked\"";
114 $disabled =
"disabled=\"disabled\"";
115 $style_disabled =
"_disabled";
118 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$this->lng->txt(
"enabled").
"\" title=\"".$this->lng->txt(
"enabled").
"\" border=\"0\" vspace=\"0\"/>";
119 $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\"/>";
121 $this->tpl->setVariable(
"AUTH_LOCAL_ACTIVE", $icon_ok);
123 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
125 #$this->tpl->setVariable("AUTH_LDAP_ACTIVE", $this->ilias->getSetting('ldap_active') ? $icon_ok : $icon_not_ok);
126 $this->tpl->setVariable(
"AUTH_RADIUS_ACTIVE", $this->ilias->getSetting(
'radius_active') ? $icon_ok : $icon_not_ok);
127 $this->tpl->setVariable(
"AUTH_SHIB_ACTIVE", $this->ilias->getSetting(
'shib_active') ? $icon_ok : $icon_not_ok);
128 $this->tpl->setVariable(
"AUTH_SCRIPT_ACTIVE", $this->ilias->getSetting(
'script_active') ? $icon_ok : $icon_not_ok);
129 $this->tpl->setVariable(
"AUTH_CAS_ACTIVE", $this->ilias->getSetting(
'cas_active') ? $icon_ok : $icon_not_ok);
132 switch ($this->ilias->getSetting(
'auth_mode'))
135 $this->tpl->setVariable(
"CHK_LOCAL", $checked);
139 $this->tpl->setVariable(
"CHK_LDAP", $checked);
143 $this->tpl->setVariable(
"CHK_SHIB", $checked);
147 $this->tpl->setVariable(
"CHK_RADIUS", $checked);
151 $this->tpl->setVariable(
"CHK_CAS", $checked);
155 $this->tpl->setVariable(
"CHK_SCRIPT", $checked);
162 $this->tpl->setVariable(
'TABLE_AUTH_DETERMINATION',$this->form->getHTML());
166 $this->tpl->setVariable(
"FORMACTION_ROLES",
167 $this->ctrl->getFormAction($this));
168 $this->tpl->setVariable(
"TXT_AUTH_ROLES", $this->lng->txt(
"auth_active_roles"));
169 $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
"obj_role"));
170 $this->tpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->lng->txt(
"auth_role_auth_mode"));
171 $this->tpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
173 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
177 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
180 foreach ($reg_roles as $role)
182 foreach ($active_auth_modes as $auth_name => $auth_key)
187 if ($auth_name ==
"default" || $auth_name ==
"cas"
188 || $auth_name ==
"shibboleth" || $auth_name ==
'ldap')
193 $this->tpl->setCurrentBlock(
"auth_mode_selection");
195 if ($auth_name ==
'default')
201 $name = $this->lng->txt(
'auth_'.$auth_name);
204 $this->tpl->setVariable(
"AUTH_MODE_NAME",
$name);
206 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
208 if ($role[
'auth_mode'] == $auth_name)
210 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
213 $this->tpl->parseCurrentBlock();
216 $this->tpl->setCurrentBlock(
"roles");
217 $this->tpl->setVariable(
"ROLE", $role[
'title']);
218 $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
219 $this->tpl->parseCurrentBlock();
234 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
236 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
240 if ($this->form->checkInput())
244 $this->loginSettings =
new ilSetting(
"login_settings");
248 if (substr(
$key, 0, 14) ==
"login_message_")
250 $this->loginSettings->set(
$key, $val);
255 if(
$_POST[
'default_auth_mode'])
257 $ilSetting->set(
'default_auth_mode',(
int)
$_POST[
'default_auth_mode']);
276 if (!$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId()))
278 $this->ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
281 $this->tabs_gui->setTabActive(
"authentication_settings");
283 $this->tabs_gui->setSubTabActive(
"login_information");
285 $lng->loadLanguageModule(
"meta");
287 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_login_messages.html");
288 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
289 $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
"login_information"));
290 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"login_information_desc"));
291 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
293 $this->tpl->setVariable(
'LOGIN_INFO',$this->form->getHTML());
303 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
305 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveLoginInfo'));
306 $this->form->setTableWidth(
'80%');
307 $this->form->setTitle($this->lng->txt(
'login_information'));
308 #$form->setInfo($this->lng->txt('login_information_desc'));
310 $this->form->addCommandButton(
'saveLoginInfo',$this->lng->txt(
'save'));
311 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
313 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
314 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
318 $select =
new ilSelectInputGUI($this->lng->txt(
'default_auth_mode'),
'default_auth_mode');
320 $select->setInfo($this->lng->txt(
'default_auth_mode_info'));
321 $options[
AUTH_LOCAL] = $this->lng->txt(
'auth_local');
324 $options[
AUTH_LDAP] = $this->lng->txt(
'auth_ldap');
326 if($rad_settings->isActive())
328 $options [
AUTH_RADIUS] = $this->lng->txt(
'auth_radius');
330 $select->setOptions($options);
331 $this->form->addItem($select);
334 if (!is_object($this->loginSettings))
336 $this->loginSettings =
new ilSetting(
"login_settings");
339 $login_settings = $this->loginSettings->getAll();
340 $languages = $lng->getInstalledLanguages();
341 $def_language = $lng->getDefaultLanguage();
343 foreach ($this->
setDefLangFirst($def_language, $languages) as $lang_key)
346 if ($lang_key == $def_language)
348 $add =
" (".$lng->txt(
"default").
")";
352 'login_message_'.$lang_key);
354 $textarea->setValue($login_settings[
"login_message_".$lang_key]);
355 $textarea->setUseRte(
true);
356 $this->form->addItem($textarea);
358 unset($login_settings[
"login_message_".$lang_key]);
361 foreach ($login_settings as
$key => $message)
363 $lang_key = substr(
$key, strrpos(
$key,
"_") + 1, strlen(
$key) - strrpos(
$key,
"_"));
366 'login_message_'.$lang_key);
368 $textarea->setValue($message);
369 $textarea->setUseRte(
true);
371 if(!in_array($lang_key,$languages))
373 $textarea->setAlert($lng->txt(
"not_installed"));
375 $this->form->addItem($textarea);
392 if (is_array($a_languages) && $a_def_language !=
"")
394 $languages = array();
395 $languages[] = $a_def_language;
397 foreach ($a_languages as $val)
399 if (!in_array($val, $languages))
415 $this->ctrl->redirect($this,
"authSettings");
422 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
424 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
427 if (empty(
$_POST[
"auth_mode"]))
429 $this->ilias->raiseError($this->lng->txt(
"auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
432 if (
$_POST[
"auth_mode"] == AUTH_DEFAULT)
435 $this->ctrl->redirect($this,
'authSettings');
438 switch (
$_POST[
"auth_mode"])
452 if ($this->object->checkAuthSHIB() !==
true)
460 if ($this->object->checkAuthRADIUS() !==
true)
463 $this->ctrl->redirect($this,
'editRADIUS');
468 if ($this->object->checkAuthScript() !==
true)
476 $this->ilias->setSetting(
"auth_mode",
$_POST[
"auth_mode"]);
479 $this->ctrl->redirect($this,
'authSettings');
495 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
497 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
500 $this->tabs_gui->setTabActive(
'auth_cas');
506 $settings = $ilSetting->getAll();
511 if (
$_SESSION[
"error_post_vars"][
"cas"][
"active"] ==
"1")
513 $this->tpl->setVariable(
"CHK_CAS_ACTIVE",
"checked=\"checked\"");
515 if (
$_SESSION[
"error_post_vars"][
"cas"][
"create_users"] ==
"1")
517 $this->tpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
519 if (
$_SESSION[
"error_post_vars"][
"cas"][
"allow_local"] ==
"1")
521 $this->tpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
524 $this->tpl->setVariable(
"CAS_SERVER",
$_SESSION[
"error_post_vars"][
"cas"][
"server"]);
525 $this->tpl->setVariable(
"CAS_PORT",
$_SESSION[
"error_post_vars"][
"cas"][
"port"]);
526 $this->tpl->setVariable(
"CAS_URI",
$_SESSION[
"error_post_vars"][
"cas"][
"uri"]);
527 $this->tpl->setVariable(
"CAS_LOGIN_INSTRUCTIONS",
$_SESSION[
"error_post_vars"][
"cas"][
"login_instructions"]);
528 $current_default_role =
$_SESSION[
"error_post_vars"][
"cas"][
"user_default_role"];
532 if ($settings[
"cas_active"] ==
"1")
534 $this->tpl->setVariable(
"CHK_CAS_ACTIVE",
"checked=\"checked\"");
536 if ($settings[
"cas_create_users"] ==
"1")
538 $this->tpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
540 if ($settings[
"cas_allow_local"] ==
"1")
542 $this->tpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
545 $this->tpl->setVariable(
"CAS_SERVER", $settings[
"cas_server"]);
546 $this->tpl->setVariable(
"CAS_PORT", $settings[
"cas_port"]);
547 $this->tpl->setVariable(
"CAS_URI", $settings[
"cas_uri"]);
548 $this->tpl->setVariable(
"CAS_LOGIN_INSTRUCTIONS", $settings[
"cas_login_instructions"]);
549 $current_default_role = $settings[
"cas_user_default_role"];
553 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
554 if (!$current_default_role)
556 $current_default_role = 4;
559 foreach ($role_list as $role)
561 $roles[$role[
'obj_id']] = $role[
'title'];
564 "cas[user_default_role]", $roles,
false,
true);
566 $this->tpl->setVariable(
"CAS_USER_DEFAULT_ROLE", $selectElement);
567 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
568 $this->tpl->setVariable(
"COLSPAN", 3);
569 $this->tpl->setVariable(
"TXT_CAS_TITLE", $this->lng->txt(
"auth_cas_auth"));
570 $this->tpl->setVariable(
"TXT_CAS_DESC", $this->lng->txt(
"auth_cas_auth_desc"));
571 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
572 $this->tpl->setVariable(
"TXT_CAS_ACTIVE", $this->lng->txt(
"active"));
573 $this->tpl->setVariable(
"TXT_CAS_SERVER", $this->lng->txt(
"server"));
574 $this->tpl->setVariable(
"TXT_CAS_SERVER_DESC", $this->lng->txt(
"auth_cas_server_desc"));
575 $this->tpl->setVariable(
"TXT_CAS_PORT", $this->lng->txt(
"port"));
576 $this->tpl->setVariable(
"TXT_CAS_PORT_DESC", $this->lng->txt(
"auth_cas_port_desc"));
577 $this->tpl->setVariable(
"TXT_CAS_URI", $this->lng->txt(
"uri"));
578 $this->tpl->setVariable(
"TXT_CAS_URI_DESC", $this->lng->txt(
"auth_cas_uri_desc"));
579 $this->tpl->setVariable(
"TXT_CAS_LOGIN_INSTRUCTIONS", $this->lng->txt(
"auth_login_instructions"));
580 $this->tpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
581 $this->tpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_cas_create_users_desc"));
582 $this->tpl->setVariable(
"TXT_CAS_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
583 $this->tpl->setVariable(
"TXT_CAS_USER_DEFAULT_ROLE_DESC",
584 $this->lng->txt(
"auth_cas_user_default_role_desc"));
585 $this->tpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
586 $this->tpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_cas_allow_local_desc"));
587 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
588 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
589 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
590 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveCAS");
602 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
604 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
610 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
614 if ((preg_match(
"/^[0-9]{0,5}$/",
$_POST[
"cas"][
"port"])) ==
false)
616 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
619 $ilSetting->set(
"cas_server",
$_POST[
"cas"][
"server"]);
620 $ilSetting->set(
"cas_port",
$_POST[
"cas"][
"port"]);
621 $ilSetting->set(
"cas_uri",
$_POST[
"cas"][
"uri"]);
622 $ilSetting->set(
"cas_login_instructions",
$_POST[
"cas"][
"login_instructions"]);
623 $ilSetting->set(
"cas_active",
$_POST[
"cas"][
"active"]);
624 $ilSetting->set(
"cas_create_users",
$_POST[
"cas"][
"create_users"]);
625 $ilSetting->set(
"cas_allow_local",
$_POST[
"cas"][
"allow_local"]);
626 $ilSetting->set(
"cas_active",
$_POST[
"cas"][
"active"]);
627 $ilSetting->set(
"cas_user_default_role",
$_POST[
"cas"][
"user_default_role"]);
630 $this->ctrl->redirect($this,
'editCAS');
642 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
644 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
647 $this->tabs_gui->setTabActive(
'auth_soap');
650 $stpl =
new ilTemplate(
"tpl.auth_soap.html",
true,
true,
"");
655 $settings = $ilSetting->getAll();
660 if (
$_SESSION[
"error_post_vars"][
"soap"][
"active"] ==
"1")
662 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
664 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_https"] ==
"1")
666 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
668 if (
$_SESSION[
"error_post_vars"][
"soap"][
"create_users"] ==
"1")
670 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
672 if (
$_SESSION[
"error_post_vars"][
"soap"][
"allow_local"] ==
"1")
674 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
676 if (
$_SESSION[
"error_post_vars"][
"soap"][
"account_mail"] ==
"1")
678 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
680 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_dotnet"] ==
"1")
682 $stpl->setVariable(
"CHK_USEDOTNET",
"checked=\"checked\"");
685 $stpl->setVariable(
"SOAP_SERVER",
$_SESSION[
"error_post_vars"][
"soap"][
"server"]);
686 $stpl->setVariable(
"SOAP_PORT",
$_SESSION[
"error_post_vars"][
"soap"][
"port"]);
687 $stpl->setVariable(
"SOAP_URI",
$_SESSION[
"error_post_vars"][
"soap"][
"uri"]);
688 $stpl->setVariable(
"SOAP_NAMESPACE",
$_SESSION[
"error_post_vars"][
"soap"][
"namespace"]);
689 $current_default_role =
$_SESSION[
"error_post_vars"][
"soap"][
"user_default_role"];
693 if ($settings[
"soap_auth_active"] ==
"1")
695 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
697 if ($settings[
"soap_auth_use_https"] ==
"1")
699 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
701 if ($settings[
"soap_auth_create_users"] ==
"1")
703 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
705 if ($settings[
"soap_auth_allow_local"] ==
"1")
707 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
709 if ($settings[
"soap_auth_account_mail"] ==
"1")
711 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
713 if ($settings[
"soap_auth_use_dotnet"] ==
"1")
715 $stpl->setVariable(
"CHK_USE_DOTNET",
"checked=\"checked\"");
718 $stpl->setVariable(
"SOAP_SERVER", $settings[
"soap_auth_server"]);
719 $stpl->setVariable(
"SOAP_PORT", $settings[
"soap_auth_port"]);
720 $stpl->setVariable(
"SOAP_URI", $settings[
"soap_auth_uri"]);
721 $stpl->setVariable(
"SOAP_NAMESPACE", $settings[
"soap_auth_namespace"]);
722 $current_default_role = $settings[
"soap_auth_user_default_role"];
726 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
727 if (!$current_default_role)
729 $current_default_role = 4;
732 foreach ($role_list as $role)
734 $roles[$role[
'obj_id']] = $role[
'title'];
737 "soap[user_default_role]", $roles,
false,
true);
739 $stpl->setVariable(
"SOAP_USER_DEFAULT_ROLE", $selectElement);
740 $stpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
741 $stpl->setVariable(
"COLSPAN", 3);
742 $stpl->setVariable(
"TXT_SOAP_TITLE", $this->lng->txt(
"auth_soap_auth"));
743 $stpl->setVariable(
"TXT_SOAP_DESC", $this->lng->txt(
"auth_soap_auth_desc"));
744 $stpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
745 $stpl->setVariable(
"TXT_SOAP_ACTIVE", $this->lng->txt(
"active"));
746 $stpl->setVariable(
"TXT_SOAP_SERVER", $this->lng->txt(
"server"));
747 $stpl->setVariable(
"TXT_SOAP_SERVER_DESC", $this->lng->txt(
"auth_soap_server_desc"));
748 $stpl->setVariable(
"TXT_SOAP_PORT", $this->lng->txt(
"port"));
749 $stpl->setVariable(
"TXT_SOAP_PORT_DESC", $this->lng->txt(
"auth_soap_port_desc"));
750 $stpl->setVariable(
"TXT_SOAP_URI", $this->lng->txt(
"uri"));
751 $stpl->setVariable(
"TXT_SOAP_URI_DESC", $this->lng->txt(
"auth_soap_uri_desc"));
752 $stpl->setVariable(
"TXT_SOAP_NAMESPACE", $this->lng->txt(
"auth_soap_namespace"));
753 $stpl->setVariable(
"TXT_SOAP_NAMESPACE_DESC", $this->lng->txt(
"auth_soap_namespace_desc"));
754 $stpl->setVariable(
"TXT_USE_DOTNET", $this->lng->txt(
"auth_soap_use_dotnet"));
755 $stpl->setVariable(
"TXT_USE_HTTPS", $this->lng->txt(
"auth_soap_use_https"));
756 $stpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
757 $stpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_soap_create_users_desc"));
758 $stpl->setVariable(
"TXT_ACCOUNT_MAIL", $this->lng->txt(
"user_send_new_account_mail"));
759 $stpl->setVariable(
"TXT_ACCOUNT_MAIL_DESC", $this->lng->txt(
"auth_new_account_mail_desc"));
760 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
761 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE_DESC",
762 $this->lng->txt(
"auth_soap_user_default_role_desc"));
763 $stpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
764 $stpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_soap_allow_local_desc"));
765 $stpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
766 $stpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
767 $stpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
768 $stpl->setVariable(
"CMD_SUBMIT",
"saveSOAP");
771 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
773 $form->setFormAction($ilCtrl->getFormAction($this));
774 $form->setTitle(
"Test Request");
776 $form->addItem($text_prop);
778 $form->addItem($text_prop2);
782 $form->addCommandButton(
"testSoapAuthConnection",
785 if ($ilCtrl->getCmd() ==
"testSoapAuthConnection")
787 include_once(
"./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
788 $ret =
"<br />".ilSOAPAuth::testConnection(
791 (
boolean)
$_POST[
"new_user"]
795 $stpl->setVariable(
"TEST_FORM", $form->getHtml().$ret);
796 $this->tpl->setContent($stpl->get());
813 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
815 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
819 if (!
$_POST[
"soap"][
"server"])
821 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
825 if (
$_POST[
"soap"][
"server"] !=
"" && (preg_match(
"/^[0-9]{0,5}$/",
$_POST[
"soap"][
"port"])) ==
false)
827 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
830 $ilSetting->set(
"soap_auth_server",
$_POST[
"soap"][
"server"]);
831 $ilSetting->set(
"soap_auth_port",
$_POST[
"soap"][
"port"]);
832 $ilSetting->set(
"soap_auth_active",
$_POST[
"soap"][
"active"]);
833 $ilSetting->set(
"soap_auth_uri",
$_POST[
"soap"][
"uri"]);
834 $ilSetting->set(
"soap_auth_namespace",
$_POST[
"soap"][
"namespace"]);
835 $ilSetting->set(
"soap_auth_create_users",
$_POST[
"soap"][
"create_users"]);
836 $ilSetting->set(
"soap_auth_allow_local",
$_POST[
"soap"][
"allow_local"]);
837 $ilSetting->set(
"soap_auth_account_mail",
$_POST[
"soap"][
"account_mail"]);
838 $ilSetting->set(
"soap_auth_use_https",
$_POST[
"soap"][
"use_https"]);
839 $ilSetting->set(
"soap_auth_use_dotnet",
$_POST[
"soap"][
"use_dotnet"]);
840 $ilSetting->set(
"soap_auth_user_default_role",
$_POST[
"soap"][
"user_default_role"]);
843 $this->ctrl->redirect($this,
'editSOAP');
855 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
857 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
862 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME",
$_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
867 $settings = $this->ilias->getAllSettings();
869 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", $settings[
"auth_script_name"]);
872 $this->tabs_gui->setTabActive(
'auth_script');
876 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
877 $this->tpl->setVariable(
"COLSPAN", 3);
878 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->lng->txt(
"auth_script_configure"));
879 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
880 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->lng->txt(
"auth_script_name"));
882 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
883 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
884 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
885 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
896 if (!
$_POST[
"auth_script"][
"name"])
898 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
911 $this->ilias->setSetting(
"auth_script_name",
$_POST[
"auth_script"][
"name"]);
912 $this->ilias->setSetting(
"auth_mode",
AUTH_SCRIPT);
915 $this->ctrl->redirect($this,
'editScript');
927 switch ($this->ilias->getSetting(
"auth_mode"))
930 return $this->lng->txt(
"auth_local");
934 return $this->lng->txt(
"auth_ldap");
938 return $this->lng->txt(
"auth_shib");
942 return $this->lng->txt(
"auth_radius");
946 return $this->lng->txt(
"auth_script");
950 return $this->lng->txt(
"unknown");
959 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
961 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
964 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
968 $this->ctrl->redirect($this,
'authSettings');
978 if(is_object($this->form))
984 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
986 if($det->getCountActiveAuthModes() <= 1)
991 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
993 $this->form->setFormAction($this->ctrl->getFormAction($this));
994 $this->form->setTableWidth(
'100%');
995 $this->form->setTitle($this->lng->txt(
'auth_auth_mode_determination'));
996 $this->form->addCommandButton(
'updateAuthModeDetermination',$this->lng->txt(
'save'));
997 $this->form->addCommandButton(
'authSettings',$this->lng->txt(
'cancel'));
1000 $kind->
setInfo($this->lng->txt(
'auth_mode_determination_info'));
1001 $kind->setValue($det->getKind());
1002 $kind->setRequired(
true);
1004 $option_user =
new ilRadioOption($this->lng->txt(
'auth_by_user'),0);
1005 $kind->addOption($option_user);
1007 $option_determination =
new ilRadioOption($this->lng->txt(
'auth_automatic'),1);
1009 include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
1011 $auth_sequenced = $det->getAuthModeSequence();
1013 foreach($auth_sequenced as $auth_mode)
1018 $text = $this->lng->txt(
'auth_ldap');
1021 $text = $this->lng->txt(
'auth_radius');
1024 $text = $this->lng->txt(
'auth_local');
1027 $text = $this->lng->txt(
'auth_soap');
1033 $pos->setValue($counter++);
1035 $pos->setMaxLength(1);
1036 $option_determination->addSubItem($pos);
1038 $kind->addOption($option_determination);
1039 $this->form->addItem($kind);
1051 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
1054 $det->setKind((
int)
$_POST[
'kind']);
1056 $pos = $_POST[
'position'] ? $_POST[
'position'] : array();
1057 asort($pos,SORT_NUMERIC);
1060 foreach($pos as $auth_mode => $dummy)
1062 $position[$counter++] = $auth_mode;
1064 $det->setAuthModeSequence($position ? $position : array());
1076 $next_class = $this->ctrl->getNextClass($this);
1077 $cmd = $this->ctrl->getCmd();
1081 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
1083 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
1088 case 'ilregistrationsettingsgui':
1090 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
1093 $this->tabs_gui->setTabActive(
'registration_settings');
1095 $this->ctrl->forwardCommand($registration_gui);
1098 case 'ilpermissiongui':
1101 $this->tabs_gui->setTabActive(
'perm_settings');
1103 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
1105 $ret =& $this->ctrl->forwardCommand($perm_gui);
1108 case 'illdapsettingsgui':
1111 $this->tabs_gui->setTabActive(
'auth_ldap');
1113 include_once
'./Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
1115 $this->ctrl->forwardCommand($ldap_settings_gui);
1118 case 'ilauthshibbolethsettingsgui':
1120 $this->tabs_gui->setTabActive(
'auth_shib');
1121 include_once(
'./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
1123 $this->ctrl->forwardCommand($shib_settings_gui);
1126 case 'ilradiussettingsgui':
1128 $this->tabs_gui->setTabActive(
'auth_radius');
1129 include_once
'./Services/Radius/classes/class.ilRadiusSettingsGUI.php';
1131 $this->ctrl->forwardCommand($radius_settings_gui);
1138 $cmd =
"authSettings";
1162 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
1164 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1167 $tabs_gui->addTarget(
'registration_settings',
1168 $this->ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view'));
1170 $tabs_gui->addTarget(
"authentication_settings", $this->ctrl->getLinkTarget($this,
"authSettings"),
1173 $tabs_gui->addTarget(
"auth_ldap", $this->ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
1177 #$tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
1180 $tabs_gui->addTarget(
'auth_shib',$this->ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui',
'settings'));
1182 $tabs_gui->addTarget(
"auth_cas", $this->ctrl->getLinkTarget($this,
"editCAS"),
1185 $tabs_gui->addTarget(
"auth_radius", $this->ctrl->getLinkTargetByClass(
'ilradiussettingsgui',
"settings"),
1188 $tabs_gui->addTarget(
"auth_soap", $this->ctrl->getLinkTarget($this,
"editSOAP"),
1193 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1195 $tabs_gui->addTarget(
"perm_settings",
1196 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1197 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1206 global $rbacsystem,$ilUser,$ilAccess;
1210 case 'authSettings':
1211 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1213 $this->tabs_gui->addSubTabTarget(
"auth_settings",
1214 $this->ctrl->getLinkTarget($this,
'authSettings'),
1218 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1220 $this->tabs_gui->addSubTabTarget(
"login_information",
1221 $this->ctrl->getLinkTarget($this,
'loginInfo'),