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);
43 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
46 $this->tabs_gui->setTabActive(
'registration_settings');
49 $this->ctrl->setCmdClass(
'ilregistrationsettingsgui');
50 $this->ctrl->forwardCommand($registration_gui);
63 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
65 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
68 $this->tabs_gui->setTabActive(
'authentication_settings');
70 $this->tabs_gui->setSubTabActive(
"auth_settings");
74 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
75 $this->tpl->setVariable(
"TXT_AUTH_TITLE", $this->lng->txt(
"auth_select"));
77 $this->tpl->setVariable(
"TXT_AUTH_MODE", $this->lng->txt(
"auth_mode"));
78 $this->tpl->setVariable(
"TXT_AUTH_DEFAULT", $this->lng->txt(
"default"));
79 $this->tpl->setVariable(
"TXT_AUTH_ACTIVE", $this->lng->txt(
"active"));
80 $this->tpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->lng->txt(
"num_users"));
82 $this->tpl->setVariable(
"TXT_LOCAL", $this->lng->txt(
"auth_local"));
83 $this->tpl->setVariable(
"TXT_LDAP", $this->lng->txt(
"auth_ldap"));
84 $this->tpl->setVariable(
"TXT_SHIB", $this->lng->txt(
"auth_shib"));
86 $this->tpl->setVariable(
"TXT_CAS", $this->lng->txt(
"auth_cas"));
88 $this->tpl->setVariable(
"TXT_RADIUS", $this->lng->txt(
"auth_radius"));
89 $this->tpl->setVariable(
"TXT_SCRIPT", $this->lng->txt(
"auth_script"));
91 $this->tpl->setVariable(
"TXT_APACHE", $this->lng->txt(
"auth_apache"));
96 foreach($auth_modes as $mode => $mode_name)
99 if ($ilSetting->get(
'auth_mode') == $mode)
101 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
102 ((
int) $auth_cnt[$mode_name] + $auth_cnt[
"default"]).
" (".$this->lng->txt(
"auth_per_default").
103 ": ".$auth_cnt[
"default"].
")");
107 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
108 (
int) $auth_cnt[$mode_name]);
112 $this->tpl->setVariable(
"TXT_CONFIGURE", $this->lng->txt(
"auth_configure"));
113 $this->tpl->setVariable(
"TXT_AUTH_REMARK", $this->lng->txt(
"auth_remark_non_local_auth"));
114 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
115 $this->tpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
118 $checked =
"checked=\"checked\"";
119 $disabled =
"disabled=\"disabled\"";
120 $style_disabled =
"_disabled";
123 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$this->lng->txt(
"enabled").
"\" title=\"".$this->lng->txt(
"enabled").
"\" border=\"0\" vspace=\"0\"/>";
124 $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\"/>";
126 $this->tpl->setVariable(
"AUTH_LOCAL_ACTIVE", $icon_ok);
128 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
130 #$this->tpl->setVariable("AUTH_LDAP_ACTIVE", $this->ilias->getSetting('ldap_active') ? $icon_ok : $icon_not_ok);
131 $this->tpl->setVariable(
"AUTH_RADIUS_ACTIVE", $this->ilias->getSetting(
'radius_active') ? $icon_ok : $icon_not_ok);
132 $this->tpl->setVariable(
"AUTH_SHIB_ACTIVE", $this->ilias->getSetting(
'shib_active') ? $icon_ok : $icon_not_ok);
133 $this->tpl->setVariable(
"AUTH_SCRIPT_ACTIVE", $this->ilias->getSetting(
'script_active') ? $icon_ok : $icon_not_ok);
134 $this->tpl->setVariable(
"AUTH_CAS_ACTIVE", $this->ilias->getSetting(
'cas_active') ? $icon_ok : $icon_not_ok);
135 $this->tpl->setVariable(
"AUTH_APACHE_ACTIVE", $this->ilias->getSetting(
'apache_active') ? $icon_ok : $icon_not_ok);
138 switch ($this->ilias->getSetting(
'auth_mode'))
141 $this->tpl->setVariable(
"CHK_LOCAL", $checked);
145 $this->tpl->setVariable(
"CHK_LDAP", $checked);
149 $this->tpl->setVariable(
"CHK_SHIB", $checked);
153 $this->tpl->setVariable(
"CHK_RADIUS", $checked);
157 $this->tpl->setVariable(
"CHK_CAS", $checked);
161 $this->tpl->setVariable(
"CHK_SCRIPT", $checked);
165 $this->tpl->setVariable(
"CHK_APACHE", $checked);
172 $this->tpl->setVariable(
'TABLE_AUTH_DETERMINATION',$this->form->getHTML());
176 $this->tpl->setVariable(
"FORMACTION_ROLES",
177 $this->ctrl->getFormAction($this));
178 $this->tpl->setVariable(
"TXT_AUTH_ROLES", $this->lng->txt(
"auth_active_roles"));
179 $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
"obj_role"));
180 $this->tpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->lng->txt(
"auth_role_auth_mode"));
181 $this->tpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
183 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
187 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
190 foreach ($reg_roles as $role)
192 foreach ($active_auth_modes as $auth_name => $auth_key)
197 if ($auth_name ==
"default" || $auth_name ==
"cas"
198 || $auth_name ==
"shibboleth" || $auth_name ==
'ldap' || $auth_name ==
'apache')
203 $this->tpl->setCurrentBlock(
"auth_mode_selection");
205 if ($auth_name ==
'default')
211 $name = $this->lng->txt(
'auth_'.$auth_name);
214 $this->tpl->setVariable(
"AUTH_MODE_NAME", $name);
216 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
218 if ($role[
'auth_mode'] == $auth_name)
220 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
223 $this->tpl->parseCurrentBlock();
226 $this->tpl->setCurrentBlock(
"roles");
227 $this->tpl->setVariable(
"ROLE", $role[
'title']);
228 $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
229 $this->tpl->parseCurrentBlock();
244 if (!$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId()))
246 $this->ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
249 $this->tabs_gui->setTabActive(
"authentication_settings");
251 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
253 $lng->loadLanguageModule(
"meta");
255 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_login_messages.html");
256 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
257 $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
"login_information"));
258 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"login_information_desc"));
259 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
260 $this->initLoginForm();
261 $this->tpl->setVariable(
'LOGIN_INFO',$this->form->getHTML());
267 $this->ctrl->redirect($this,
"authSettings");
274 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
276 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
279 if (empty(
$_POST[
"auth_mode"]))
281 $this->ilias->raiseError($this->lng->txt(
"auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
284 if (
$_POST[
"auth_mode"] == AUTH_DEFAULT)
287 $this->ctrl->redirect($this,
'authSettings');
290 switch (
$_POST[
"auth_mode"])
304 if ($this->object->checkAuthSHIB() !==
true)
312 if ($this->object->checkAuthRADIUS() !==
true)
315 $this->ctrl->redirect($this,
'editRADIUS');
320 if ($this->object->checkAuthScript() !==
true)
328 $this->ilias->setSetting(
"auth_mode",
$_POST[
"auth_mode"]);
331 $this->ctrl->redirect($this,
'authSettings');
344 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
346 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
349 $this->tabs_gui->setTabActive(
'auth_soap');
352 $stpl =
new ilTemplate(
"tpl.auth_soap.html",
true,
true,
"");
357 $settings = $ilSetting->getAll();
362 if (
$_SESSION[
"error_post_vars"][
"soap"][
"active"] ==
"1")
364 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
366 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_https"] ==
"1")
368 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
370 if (
$_SESSION[
"error_post_vars"][
"soap"][
"create_users"] ==
"1")
372 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
374 if (
$_SESSION[
"error_post_vars"][
"soap"][
"allow_local"] ==
"1")
376 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
378 if (
$_SESSION[
"error_post_vars"][
"soap"][
"account_mail"] ==
"1")
380 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
382 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_dotnet"] ==
"1")
384 $stpl->setVariable(
"CHK_USEDOTNET",
"checked=\"checked\"");
387 $stpl->setVariable(
"SOAP_SERVER",
$_SESSION[
"error_post_vars"][
"soap"][
"server"]);
388 $stpl->setVariable(
"SOAP_PORT",
$_SESSION[
"error_post_vars"][
"soap"][
"port"]);
389 $stpl->setVariable(
"SOAP_URI",
$_SESSION[
"error_post_vars"][
"soap"][
"uri"]);
390 $stpl->setVariable(
"SOAP_NAMESPACE",
$_SESSION[
"error_post_vars"][
"soap"][
"namespace"]);
391 $current_default_role =
$_SESSION[
"error_post_vars"][
"soap"][
"user_default_role"];
395 if ($settings[
"soap_auth_active"] ==
"1")
397 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
399 if ($settings[
"soap_auth_use_https"] ==
"1")
401 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
403 if ($settings[
"soap_auth_create_users"] ==
"1")
405 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
407 if ($settings[
"soap_auth_allow_local"] ==
"1")
409 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
411 if ($settings[
"soap_auth_account_mail"] ==
"1")
413 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
415 if ($settings[
"soap_auth_use_dotnet"] ==
"1")
417 $stpl->setVariable(
"CHK_USE_DOTNET",
"checked=\"checked\"");
420 $stpl->setVariable(
"SOAP_SERVER", $settings[
"soap_auth_server"]);
421 $stpl->setVariable(
"SOAP_PORT", $settings[
"soap_auth_port"]);
422 $stpl->setVariable(
"SOAP_URI", $settings[
"soap_auth_uri"]);
423 $stpl->setVariable(
"SOAP_NAMESPACE", $settings[
"soap_auth_namespace"]);
424 $current_default_role = $settings[
"soap_auth_user_default_role"];
428 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
429 if (!$current_default_role)
431 $current_default_role = 4;
434 foreach ($role_list as $role)
436 $roles[$role[
'obj_id']] = $role[
'title'];
439 "soap[user_default_role]", $roles,
false,
true);
441 $stpl->setVariable(
"SOAP_USER_DEFAULT_ROLE", $selectElement);
442 $stpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
443 $stpl->setVariable(
"COLSPAN", 3);
444 $stpl->setVariable(
"TXT_SOAP_TITLE", $this->lng->txt(
"auth_soap_auth"));
445 $stpl->setVariable(
"TXT_SOAP_DESC", $this->lng->txt(
"auth_soap_auth_desc"));
446 $stpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
447 $stpl->setVariable(
"TXT_SOAP_ACTIVE", $this->lng->txt(
"active"));
448 $stpl->setVariable(
"TXT_SOAP_SERVER", $this->lng->txt(
"server"));
449 $stpl->setVariable(
"TXT_SOAP_SERVER_DESC", $this->lng->txt(
"auth_soap_server_desc"));
450 $stpl->setVariable(
"TXT_SOAP_PORT", $this->lng->txt(
"port"));
451 $stpl->setVariable(
"TXT_SOAP_PORT_DESC", $this->lng->txt(
"auth_soap_port_desc"));
452 $stpl->setVariable(
"TXT_SOAP_URI", $this->lng->txt(
"uri"));
453 $stpl->setVariable(
"TXT_SOAP_URI_DESC", $this->lng->txt(
"auth_soap_uri_desc"));
454 $stpl->setVariable(
"TXT_SOAP_NAMESPACE", $this->lng->txt(
"auth_soap_namespace"));
455 $stpl->setVariable(
"TXT_SOAP_NAMESPACE_DESC", $this->lng->txt(
"auth_soap_namespace_desc"));
456 $stpl->setVariable(
"TXT_USE_DOTNET", $this->lng->txt(
"auth_soap_use_dotnet"));
457 $stpl->setVariable(
"TXT_USE_HTTPS", $this->lng->txt(
"auth_soap_use_https"));
458 $stpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
459 $stpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_soap_create_users_desc"));
460 $stpl->setVariable(
"TXT_ACCOUNT_MAIL", $this->lng->txt(
"user_send_new_account_mail"));
461 $stpl->setVariable(
"TXT_ACCOUNT_MAIL_DESC", $this->lng->txt(
"auth_new_account_mail_desc"));
462 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
463 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE_DESC",
464 $this->lng->txt(
"auth_soap_user_default_role_desc"));
465 $stpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
466 $stpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_soap_allow_local_desc"));
467 $stpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
468 $stpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
469 $stpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
470 $stpl->setVariable(
"CMD_SUBMIT",
"saveSOAP");
473 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
475 $form->setFormAction($ilCtrl->getFormAction($this));
476 $form->setTitle(
"Test Request");
478 $form->addItem($text_prop);
480 $form->addItem($text_prop2);
484 $form->addCommandButton(
"testSoapAuthConnection",
487 if ($ilCtrl->getCmd() ==
"testSoapAuthConnection")
489 include_once(
"./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
490 $ret =
"<br />".ilSOAPAuth::testConnection(
493 (
boolean)
$_POST[
"new_user"]
497 $stpl->setVariable(
"TEST_FORM", $form->getHtml().$ret);
498 $this->tpl->setContent($stpl->get());
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);
532 $ilSetting->set(
"soap_auth_server",
$_POST[
"soap"][
"server"]);
533 $ilSetting->set(
"soap_auth_port",
$_POST[
"soap"][
"port"]);
534 $ilSetting->set(
"soap_auth_active",
$_POST[
"soap"][
"active"]);
535 $ilSetting->set(
"soap_auth_uri",
$_POST[
"soap"][
"uri"]);
536 $ilSetting->set(
"soap_auth_namespace",
$_POST[
"soap"][
"namespace"]);
537 $ilSetting->set(
"soap_auth_create_users",
$_POST[
"soap"][
"create_users"]);
538 $ilSetting->set(
"soap_auth_allow_local",
$_POST[
"soap"][
"allow_local"]);
539 $ilSetting->set(
"soap_auth_account_mail",
$_POST[
"soap"][
"account_mail"]);
540 $ilSetting->set(
"soap_auth_use_https",
$_POST[
"soap"][
"use_https"]);
541 $ilSetting->set(
"soap_auth_use_dotnet",
$_POST[
"soap"][
"use_dotnet"]);
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');
578 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
579 $this->tpl->setVariable(
"COLSPAN", 3);
580 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->lng->txt(
"auth_script_configure"));
581 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
582 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->lng->txt(
"auth_script_name"));
584 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
585 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
586 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
587 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
598 if (!
$_POST[
"auth_script"][
"name"])
600 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
613 $this->ilias->setSetting(
"auth_script_name",
$_POST[
"auth_script"][
"name"]);
614 $this->ilias->setSetting(
"auth_mode",
AUTH_SCRIPT);
617 $this->ctrl->redirect($this,
'editScript');
629 switch ($this->ilias->getSetting(
"auth_mode"))
632 return $this->lng->txt(
"auth_local");
636 return $this->lng->txt(
"auth_ldap");
640 return $this->lng->txt(
"auth_shib");
644 return $this->lng->txt(
"auth_radius");
648 return $this->lng->txt(
"auth_script");
652 return $this->lng->txt(
"auth_apache");
656 return $this->lng->txt(
"unknown");
665 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
667 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
670 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
674 $this->ctrl->redirect($this,
'authSettings');
684 if(is_object($this->form))
690 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
692 if($det->getCountActiveAuthModes() <= 1)
697 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
699 $this->form->setFormAction($this->ctrl->getFormAction($this));
700 $this->form->setTableWidth(
'100%');
701 $this->form->setTitle($this->lng->txt(
'auth_auth_mode_determination'));
702 $this->form->addCommandButton(
'updateAuthModeDetermination',$this->lng->txt(
'save'));
703 $this->form->addCommandButton(
'authSettings',$this->lng->txt(
'cancel'));
706 $kind->
setInfo($this->lng->txt(
'auth_mode_determination_info'));
707 $kind->setValue($det->getKind());
708 $kind->setRequired(
true);
710 $option_user =
new ilRadioOption($this->lng->txt(
'auth_by_user'),0);
711 $kind->addOption($option_user);
713 $option_determination =
new ilRadioOption($this->lng->txt(
'auth_automatic'),1);
715 include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
717 $auth_sequenced = $det->getAuthModeSequence();
719 foreach($auth_sequenced as $auth_mode)
724 $text = $this->lng->txt(
'auth_ldap');
727 $text = $this->lng->txt(
'auth_radius');
730 $text = $this->lng->txt(
'auth_local');
733 $text = $this->lng->txt(
'auth_soap');
736 $text = $this->lng->txt(
'auth_apache');
742 $pos->setValue($counter++);
744 $pos->setMaxLength(1);
745 $option_determination->addSubItem($pos);
747 $kind->addOption($option_determination);
748 $this->form->addItem($kind);
760 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
763 $det->setKind((
int)
$_POST[
'kind']);
765 $pos = $_POST[
'position'] ? $_POST[
'position'] : array();
766 asort($pos,SORT_NUMERIC);
769 foreach($pos as $auth_mode => $dummy)
771 $position[$counter++] = $auth_mode;
773 $det->setAuthModeSequence($position ? $position : array());
790 $next_class = $this->ctrl->getNextClass($this);
791 $cmd = $this->ctrl->getCmd();
795 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
797 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
802 case 'ilregistrationsettingsgui':
804 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
807 $this->tabs_gui->setTabActive(
'registration_settings');
809 $this->ctrl->forwardCommand($registration_gui);
812 case 'ilpermissiongui':
815 $this->tabs_gui->setTabActive(
'perm_settings');
817 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
819 $ret =& $this->ctrl->forwardCommand($perm_gui);
822 case 'illdapsettingsgui':
825 $this->tabs_gui->setTabActive(
'auth_ldap');
827 include_once
'./Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
829 $this->ctrl->forwardCommand($ldap_settings_gui);
832 case 'ilauthshibbolethsettingsgui':
834 $this->tabs_gui->setTabActive(
'auth_shib');
835 include_once(
'./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
837 $this->ctrl->forwardCommand($shib_settings_gui);
840 case 'ilcassettingsgui':
842 $this->tabs_gui->setTabActive(
'auth_cas');
843 include_once
'./Services/CAS/classes/class.ilCASSettingsGUI.php';
845 $this->ctrl->forwardCommand($cas_settings);
848 case 'ilradiussettingsgui':
850 $this->tabs_gui->setTabActive(
'auth_radius');
851 include_once
'./Services/Radius/classes/class.ilRadiusSettingsGUI.php';
853 $this->ctrl->forwardCommand($radius_settings_gui);
856 case 'ilopenidsettingsgui':
858 $this->tabs_gui->setTabActive(
'auth_openid');
860 include_once
'./Services/OpenId/classes/class.ilOpenIdSettingsGUI.php';
862 $this->ctrl->forwardCommand($os);
865 case 'ilauthloginpageeditorgui':
868 $this->tabs_gui->setTabActive(
'authentication_settings');
869 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
871 include_once
'./Services/Authentication/classes/class.ilAuthLoginPageEditorGUI.php';
873 $this->ctrl->forwardCommand($lpe);
879 $cmd =
"authSettings";
903 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
905 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
908 $tabs_gui->addTarget(
'registration_settings',
909 $this->ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view'));
911 $tabs_gui->addTarget(
"authentication_settings", $this->ctrl->getLinkTarget($this,
"authSettings"),
914 $tabs_gui->addTarget(
"auth_ldap", $this->ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
918 #$tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
921 $tabs_gui->addTarget(
'auth_shib',$this->ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui',
'settings'));
923 $tabs_gui->addTarget(
925 $this->ctrl->getLinkTargetByClass(
'ilcassettingsgui',
'settings')
928 $tabs_gui->addTarget(
"auth_radius", $this->ctrl->getLinkTargetByClass(
'ilradiussettingsgui',
"settings"),
931 $tabs_gui->addTarget(
"auth_soap", $this->ctrl->getLinkTarget($this,
"editSOAP"),
934 $tabs_gui->addTarget(
936 $this->ctrl->getLinkTargetByClass(
'ilopenidsettingsgui',
'settings'),
942 $tabs_gui->addTarget(
"apache_auth_settings", $this->ctrl->getLinkTarget($this,
'apacheAuthSettings'),
946 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
948 $tabs_gui->addTarget(
"perm_settings",
949 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
950 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
959 global $rbacsystem,$ilUser,$ilAccess;
961 $GLOBALS[
'lng']->loadLanguageModule(
'auth');
966 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
968 $this->tabs_gui->addSubTabTarget(
"auth_settings",
969 $this->ctrl->getLinkTarget($this,
'authSettings'),
972 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
974 $this->tabs_gui->addSubTabTarget(
976 $this->ctrl->getLinkTargetByClass(
'ilauthloginpageeditorgui',
''),
989 $this->tabs_gui->setTabActive(
"apache_auth_settings");
996 $settings =
new ilSetting(
'apache_auth');
997 $settingsMap = $settings->getAll();
999 $path = ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt';
1000 if (file_exists(
$path) && is_readable(
$path)) {
1001 $settingsMap[
'apache_auth_domains'] = file_get_contents(
$path);
1004 $form->setValuesByArray($settingsMap);
1006 $tpl->setVariable(
'ADM_CONTENT', $form->getHtml());
1013 $form->setValuesByPost();
1017 if ($form->checkInput())
1019 $settings =
new ilSetting(
'apache_auth');
1022 'apache_auth_indicator_name',
'apache_auth_indicator_value',
1023 'apache_enable_auth',
'apache_enable_local',
'apache_local_autocreate',
1024 'apache_enable_ldap',
'apache_auth_username_config_type',
1025 'apache_auth_username_direct_mapping_fieldname',
1026 'apache_default_role',
'apache_auth_target_override_login_page',
1027 'apache_auth_enable_override_login_page',
1028 'apache_auth_authenticate_on_login_page'
1032 foreach($fields as $field)
1033 $settings->set($field, $form->getInput($field));
1035 if ($form->getInput(
'apache_enable_auth'))
1036 $this->ilias->setSetting(
'apache_active',
true);
1038 $this->ilias->setSetting(
'apache_active',
false);
1040 if ($ilSetting->get(
"auth_mode") ==
AUTH_APACHE) {
1046 file_put_contents(ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt', $allowedDomains);
1049 $this->ctrl->redirect($this,
'apacheAuthSettings');
1059 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1062 $form->setFormAction($this->ctrl->getFormAction($this));
1063 $form->setTitle($this->lng->txt(
'apache_settings'));
1065 $chb_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_auth'),
'apache_enable_auth');
1066 $form->addItem($chb_enabled);
1068 $chb_local_create_account =
new ilCheckboxInputGUI($this->lng->txt(
'apache_autocreate'),
'apache_local_autocreate');
1069 $chb_enabled->addSubitem($chb_local_create_account);
1072 $roles = $rbacreview->getGlobalRolesArray();
1073 $select =
new ilSelectInputGUI($this->lng->txt(
'apache_default_role'),
'apache_default_role');
1074 $roleOptions = array();
1075 foreach($roles as $role) {
1078 $select->setOptions($roleOptions);
1079 $select->setValue(4);
1081 $chb_local_create_account->addSubitem($select);
1083 $chb_local =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_local'),
'apache_enable_local');
1084 $form->addItem($chb_local);
1090 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_name'),
'apache_auth_indicator_name');
1092 $form->addItem($txt);
1094 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_value'),
'apache_auth_indicator_value');
1096 $form->addItem($txt);
1099 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_enable_override_login'),
'apache_auth_enable_override_login_page');
1100 $form->addItem($chb);
1102 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_target_override_login'),
'apache_auth_target_override_login_page');
1104 $chb->addSubItem($txt);
1106 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_authenticate_on_login_page'),
'apache_auth_authenticate_on_login_page');
1107 $form->addItem($chb);
1110 $sec->setTitle($this->lng->txt(
'apache_auth_username_config'));
1111 $form->addItem($sec);
1113 $rag =
new ilRadioGroupInputGUI($this->lng->txt(
'apache_auth_username_config_type'),
'apache_auth_username_config_type');
1114 $form->addItem($rag);
1116 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_direct_mapping'), 1);
1117 $rag->addOption($rao);
1119 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_username_direct_mapping_fieldname'),
'apache_auth_username_direct_mapping_fieldname');
1123 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_extended_mapping'), 2);
1125 $rag->addOption($rao);
1127 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_by_function'), 3);
1128 $rag->addOption($rao);
1134 $sec->setTitle($this->lng->txt(
'apache_auth_security'));
1135 $form->addItem($sec);
1137 $txt =
new ilTextAreaInputGUI($this->lng->txt(
'apache_auth_domains'),
'apache_auth_domains');
1138 $txt->
setInfo($this->lng->txt(
'apache_auth_domains_description'));
1140 $form->addItem($txt);
1142 $form->addCommandButton(
'saveApacheSettings',$this->lng->txt(
'save'));
1143 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1149 return join(
"\n", preg_split(
"/[\r\n]+/", $text));