17 require_once
"./Services/Object/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");
72 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_general.html",
73 "Services/Authentication");
75 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
76 $this->tpl->setVariable(
"TXT_AUTH_TITLE", $this->lng->txt(
"auth_select"));
78 $this->tpl->setVariable(
"TXT_AUTH_MODE", $this->lng->txt(
"auth_mode"));
79 $this->tpl->setVariable(
"TXT_AUTH_DEFAULT", $this->lng->txt(
"default"));
80 $this->tpl->setVariable(
"TXT_AUTH_ACTIVE", $this->lng->txt(
"active"));
81 $this->tpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->lng->txt(
"num_users"));
83 $this->tpl->setVariable(
"TXT_LOCAL", $this->lng->txt(
"auth_local"));
84 $this->tpl->setVariable(
"TXT_LDAP", $this->lng->txt(
"auth_ldap"));
85 $this->tpl->setVariable(
"TXT_SHIB", $this->lng->txt(
"auth_shib"));
87 $this->tpl->setVariable(
"TXT_CAS", $this->lng->txt(
"auth_cas"));
89 $this->tpl->setVariable(
"TXT_RADIUS", $this->lng->txt(
"auth_radius"));
90 $this->tpl->setVariable(
"TXT_SCRIPT", $this->lng->txt(
"auth_script"));
92 $this->tpl->setVariable(
"TXT_APACHE", $this->lng->txt(
"auth_apache"));
97 foreach($auth_modes as $mode => $mode_name)
100 if ($ilSetting->get(
'auth_mode') == $mode)
102 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
103 ((
int) $auth_cnt[$mode_name] + $auth_cnt[
"default"]).
" (".$this->lng->txt(
"auth_per_default").
104 ": ".$auth_cnt[
"default"].
")");
108 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
109 (
int) $auth_cnt[$mode_name]);
113 $this->tpl->setVariable(
"TXT_CONFIGURE", $this->lng->txt(
"auth_configure"));
114 $this->tpl->setVariable(
"TXT_AUTH_REMARK", $this->lng->txt(
"auth_remark_non_local_auth"));
115 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
116 $this->tpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
119 $checked =
"checked=\"checked\"";
120 $disabled =
"disabled=\"disabled\"";
121 $style_disabled =
"_disabled";
124 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.png").
"\" alt=\"".$this->lng->txt(
"enabled").
"\" title=\"".$this->lng->txt(
"enabled").
"\" border=\"0\" vspace=\"0\"/>";
125 $icon_not_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_not_ok.png").
"\" alt=\"".$this->lng->txt(
"disabled").
"\" title=\"".$this->lng->txt(
"disabled").
"\" border=\"0\" vspace=\"0\"/>";
127 $this->tpl->setVariable(
"AUTH_LOCAL_ACTIVE", $icon_ok);
129 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
131 #$this->tpl->setVariable("AUTH_LDAP_ACTIVE", $this->ilias->getSetting('ldap_active') ? $icon_ok : $icon_not_ok);
132 $this->tpl->setVariable(
"AUTH_RADIUS_ACTIVE", $this->ilias->getSetting(
'radius_active') ? $icon_ok : $icon_not_ok);
133 $this->tpl->setVariable(
"AUTH_SHIB_ACTIVE", $this->ilias->getSetting(
'shib_active') ? $icon_ok : $icon_not_ok);
134 $this->tpl->setVariable(
"AUTH_SCRIPT_ACTIVE", $this->ilias->getSetting(
'script_active') ? $icon_ok : $icon_not_ok);
135 $this->tpl->setVariable(
"AUTH_CAS_ACTIVE", $this->ilias->getSetting(
'cas_active') ? $icon_ok : $icon_not_ok);
136 $this->tpl->setVariable(
"AUTH_APACHE_ACTIVE", $this->ilias->getSetting(
'apache_active') ? $icon_ok : $icon_not_ok);
139 switch ($this->ilias->getSetting(
'auth_mode'))
142 $this->tpl->setVariable(
"CHK_LOCAL", $checked);
146 $this->tpl->setVariable(
"CHK_LDAP", $checked);
150 $this->tpl->setVariable(
"CHK_SHIB", $checked);
154 $this->tpl->setVariable(
"CHK_RADIUS", $checked);
158 $this->tpl->setVariable(
"CHK_CAS", $checked);
162 $this->tpl->setVariable(
"CHK_SCRIPT", $checked);
166 $this->tpl->setVariable(
"CHK_APACHE", $checked);
173 $this->tpl->setVariable(
'TABLE_AUTH_DETERMINATION',$this->form->getHTML());
177 $this->tpl->setVariable(
"FORMACTION_ROLES",
178 $this->ctrl->getFormAction($this));
179 $this->tpl->setVariable(
"TXT_AUTH_ROLES", $this->lng->txt(
"auth_active_roles"));
180 $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
"obj_role"));
181 $this->tpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->lng->txt(
"auth_role_auth_mode"));
182 $this->tpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
184 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
188 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
191 foreach ($reg_roles as $role)
193 foreach ($active_auth_modes as $auth_name => $auth_key)
198 if ($auth_name ==
"default" || $auth_name ==
"cas"
199 || $auth_name ==
"shibboleth" || $auth_name ==
'ldap' || $auth_name ==
'apache')
204 $this->tpl->setCurrentBlock(
"auth_mode_selection");
206 if ($auth_name ==
'default')
212 $name = $this->lng->txt(
'auth_'.$auth_name);
215 $this->tpl->setVariable(
"AUTH_MODE_NAME", $name);
217 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
219 if ($role[
'auth_mode'] == $auth_name)
221 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
224 $this->tpl->parseCurrentBlock();
227 $this->tpl->setCurrentBlock(
"roles");
228 $this->tpl->setVariable(
"ROLE", $role[
'title']);
229 $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
230 $this->tpl->parseCurrentBlock();
245 if (!$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId()))
247 $this->ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
250 $this->tabs_gui->setTabActive(
"authentication_settings");
252 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
254 $lng->loadLanguageModule(
"meta");
256 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_login_messages.html",
257 "Services/Authentication");
258 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
259 $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
"login_information"));
260 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"login_information_desc"));
261 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
262 $this->initLoginForm();
263 $this->tpl->setVariable(
'LOGIN_INFO',$this->form->getHTML());
269 $this->ctrl->redirect($this,
"authSettings");
276 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
278 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
281 if (empty(
$_POST[
"auth_mode"]))
283 $this->ilias->raiseError($this->lng->txt(
"auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
286 if (
$_POST[
"auth_mode"] == AUTH_DEFAULT)
289 $this->ctrl->redirect($this,
'authSettings');
292 switch (
$_POST[
"auth_mode"])
306 if ($this->object->checkAuthSHIB() !==
true)
314 if ($this->object->checkAuthRADIUS() !==
true)
317 $this->ctrl->redirect($this,
'editRADIUS');
322 if ($this->object->checkAuthScript() !==
true)
330 $this->ilias->setSetting(
"auth_mode",
$_POST[
"auth_mode"]);
333 $this->ctrl->redirect($this,
'authSettings');
346 if (!$rbacsystem->checkAccess(
"read",$this->object->getRefId()))
348 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
351 $this->tabs_gui->setTabActive(
'auth_soap');
354 $stpl =
new ilTemplate(
"tpl.auth_soap.html",
true,
true,
355 "Services/Authentication");
358 $settings = $ilSetting->getAll();
363 if (
$_SESSION[
"error_post_vars"][
"soap"][
"active"] ==
"1")
365 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
367 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_https"] ==
"1")
369 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
371 if (
$_SESSION[
"error_post_vars"][
"soap"][
"create_users"] ==
"1")
373 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
375 if (
$_SESSION[
"error_post_vars"][
"soap"][
"allow_local"] ==
"1")
377 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
379 if (
$_SESSION[
"error_post_vars"][
"soap"][
"account_mail"] ==
"1")
381 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
383 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_dotnet"] ==
"1")
385 $stpl->setVariable(
"CHK_USEDOTNET",
"checked=\"checked\"");
388 $stpl->setVariable(
"SOAP_SERVER",
$_SESSION[
"error_post_vars"][
"soap"][
"server"]);
389 $stpl->setVariable(
"SOAP_PORT",
$_SESSION[
"error_post_vars"][
"soap"][
"port"]);
390 $stpl->setVariable(
"SOAP_URI",
$_SESSION[
"error_post_vars"][
"soap"][
"uri"]);
391 $stpl->setVariable(
"SOAP_NAMESPACE",
$_SESSION[
"error_post_vars"][
"soap"][
"namespace"]);
392 $current_default_role =
$_SESSION[
"error_post_vars"][
"soap"][
"user_default_role"];
396 if ($settings[
"soap_auth_active"] ==
"1")
398 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
400 if ($settings[
"soap_auth_use_https"] ==
"1")
402 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
404 if ($settings[
"soap_auth_create_users"] ==
"1")
406 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
408 if ($settings[
"soap_auth_allow_local"] ==
"1")
410 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
412 if ($settings[
"soap_auth_account_mail"] ==
"1")
414 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
416 if ($settings[
"soap_auth_use_dotnet"] ==
"1")
418 $stpl->setVariable(
"CHK_USE_DOTNET",
"checked=\"checked\"");
421 $stpl->setVariable(
"SOAP_SERVER", $settings[
"soap_auth_server"]);
422 $stpl->setVariable(
"SOAP_PORT", $settings[
"soap_auth_port"]);
423 $stpl->setVariable(
"SOAP_URI", $settings[
"soap_auth_uri"]);
424 $stpl->setVariable(
"SOAP_NAMESPACE", $settings[
"soap_auth_namespace"]);
425 $current_default_role = $settings[
"soap_auth_user_default_role"];
429 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
430 if (!$current_default_role)
432 $current_default_role = 4;
435 foreach ($role_list as $role)
437 $roles[$role[
'obj_id']] = $role[
'title'];
440 "soap[user_default_role]", $roles,
false,
true);
442 $stpl->setVariable(
"SOAP_USER_DEFAULT_ROLE", $selectElement);
443 $stpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
444 $stpl->setVariable(
"COLSPAN", 3);
445 $stpl->setVariable(
"TXT_SOAP_TITLE", $this->lng->txt(
"auth_soap_auth"));
446 $stpl->setVariable(
"TXT_SOAP_DESC", $this->lng->txt(
"auth_soap_auth_desc"));
447 $stpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
448 $stpl->setVariable(
"TXT_SOAP_ACTIVE", $this->lng->txt(
"active"));
449 $stpl->setVariable(
"TXT_SOAP_SERVER", $this->lng->txt(
"server"));
450 $stpl->setVariable(
"TXT_SOAP_SERVER_DESC", $this->lng->txt(
"auth_soap_server_desc"));
451 $stpl->setVariable(
"TXT_SOAP_PORT", $this->lng->txt(
"port"));
452 $stpl->setVariable(
"TXT_SOAP_PORT_DESC", $this->lng->txt(
"auth_soap_port_desc"));
453 $stpl->setVariable(
"TXT_SOAP_URI", $this->lng->txt(
"uri"));
454 $stpl->setVariable(
"TXT_SOAP_URI_DESC", $this->lng->txt(
"auth_soap_uri_desc"));
455 $stpl->setVariable(
"TXT_SOAP_NAMESPACE", $this->lng->txt(
"auth_soap_namespace"));
456 $stpl->setVariable(
"TXT_SOAP_NAMESPACE_DESC", $this->lng->txt(
"auth_soap_namespace_desc"));
457 $stpl->setVariable(
"TXT_USE_DOTNET", $this->lng->txt(
"auth_soap_use_dotnet"));
458 $stpl->setVariable(
"TXT_USE_HTTPS", $this->lng->txt(
"auth_soap_use_https"));
459 $stpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
460 $stpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_soap_create_users_desc"));
461 $stpl->setVariable(
"TXT_ACCOUNT_MAIL", $this->lng->txt(
"user_send_new_account_mail"));
462 $stpl->setVariable(
"TXT_ACCOUNT_MAIL_DESC", $this->lng->txt(
"auth_new_account_mail_desc"));
463 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
464 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE_DESC",
465 $this->lng->txt(
"auth_soap_user_default_role_desc"));
466 $stpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
467 $stpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_soap_allow_local_desc"));
468 $stpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
469 $stpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
470 $stpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
471 $stpl->setVariable(
"CMD_SUBMIT",
"saveSOAP");
474 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
476 $form->setFormAction($ilCtrl->getFormAction($this));
477 $form->setTitle(
"Test Request");
479 $form->addItem($text_prop);
481 $form->addItem($text_prop2);
485 $form->addCommandButton(
"testSoapAuthConnection",
488 if ($ilCtrl->getCmd() ==
"testSoapAuthConnection")
490 include_once(
"./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
491 $ret =
"<br />".ilSOAPAuth::testConnection(
494 (
boolean)
$_POST[
"new_user"]
498 $stpl->setVariable(
"TEST_FORM", $form->getHtml().$ret);
499 $this->tpl->setContent($stpl->get());
516 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
518 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
522 if (!
$_POST[
"soap"][
"server"])
524 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
528 if (
$_POST[
"soap"][
"server"] !=
"" && (preg_match(
"/^[0-9]{0,5}$/",
$_POST[
"soap"][
"port"])) ==
false)
530 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
533 $ilSetting->set(
"soap_auth_server",
$_POST[
"soap"][
"server"]);
534 $ilSetting->set(
"soap_auth_port",
$_POST[
"soap"][
"port"]);
535 $ilSetting->set(
"soap_auth_active",
$_POST[
"soap"][
"active"]);
536 $ilSetting->set(
"soap_auth_uri",
$_POST[
"soap"][
"uri"]);
537 $ilSetting->set(
"soap_auth_namespace",
$_POST[
"soap"][
"namespace"]);
538 $ilSetting->set(
"soap_auth_create_users",
$_POST[
"soap"][
"create_users"]);
539 $ilSetting->set(
"soap_auth_allow_local",
$_POST[
"soap"][
"allow_local"]);
540 $ilSetting->set(
"soap_auth_account_mail",
$_POST[
"soap"][
"account_mail"]);
541 $ilSetting->set(
"soap_auth_use_https",
$_POST[
"soap"][
"use_https"]);
542 $ilSetting->set(
"soap_auth_use_dotnet",
$_POST[
"soap"][
"use_dotnet"]);
543 $ilSetting->set(
"soap_auth_user_default_role",
$_POST[
"soap"][
"user_default_role"]);
546 $this->ctrl->redirect($this,
'editSOAP');
558 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
560 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
565 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME",
$_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
570 $settings = $this->ilias->getAllSettings();
572 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", $settings[
"auth_script_name"]);
575 $this->tabs_gui->setTabActive(
'auth_script');
577 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_script.html",
578 "Services/Authentication");
580 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
581 $this->tpl->setVariable(
"COLSPAN", 3);
582 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->lng->txt(
"auth_script_configure"));
583 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
584 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->lng->txt(
"auth_script_name"));
586 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
587 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
588 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
589 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
600 if (!
$_POST[
"auth_script"][
"name"])
602 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
615 $this->ilias->setSetting(
"auth_script_name",
$_POST[
"auth_script"][
"name"]);
616 $this->ilias->setSetting(
"auth_mode",
AUTH_SCRIPT);
619 $this->ctrl->redirect($this,
'editScript');
631 switch ($this->ilias->getSetting(
"auth_mode"))
634 return $this->lng->txt(
"auth_local");
638 return $this->lng->txt(
"auth_ldap");
642 return $this->lng->txt(
"auth_shib");
646 return $this->lng->txt(
"auth_radius");
650 return $this->lng->txt(
"auth_script");
654 return $this->lng->txt(
"auth_apache");
658 return $this->lng->txt(
"unknown");
667 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
669 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
672 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
676 $this->ctrl->redirect($this,
'authSettings');
686 if(is_object($this->form))
692 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
694 if($det->getCountActiveAuthModes() <= 1)
699 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
701 $this->form->setFormAction($this->ctrl->getFormAction($this));
702 $this->form->setTableWidth(
'100%');
703 $this->form->setTitle($this->lng->txt(
'auth_auth_mode_determination'));
704 $this->form->addCommandButton(
'updateAuthModeDetermination',$this->lng->txt(
'save'));
705 $this->form->addCommandButton(
'authSettings',$this->lng->txt(
'cancel'));
708 $kind->
setInfo($this->lng->txt(
'auth_mode_determination_info'));
709 $kind->setValue($det->getKind());
710 $kind->setRequired(
true);
712 $option_user =
new ilRadioOption($this->lng->txt(
'auth_by_user'),0);
713 $kind->addOption($option_user);
715 $option_determination =
new ilRadioOption($this->lng->txt(
'auth_automatic'),1);
717 include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
719 $auth_sequenced = $det->getAuthModeSequence();
721 foreach($auth_sequenced as $auth_mode)
726 $text = $this->lng->txt(
'auth_ldap');
729 $text = $this->lng->txt(
'auth_radius');
732 $text = $this->lng->txt(
'auth_local');
735 $text = $this->lng->txt(
'auth_soap');
738 $text = $this->lng->txt(
'auth_apache');
744 $pos->setValue($counter++);
746 $pos->setMaxLength(1);
747 $option_determination->addSubItem($pos);
749 $kind->addOption($option_determination);
750 $this->form->addItem($kind);
762 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
765 $det->setKind((
int)
$_POST[
'kind']);
767 $pos = $_POST[
'position'] ? $_POST[
'position'] : array();
768 asort($pos,SORT_NUMERIC);
771 foreach($pos as $auth_mode => $dummy)
773 $position[$counter++] = $auth_mode;
775 $det->setAuthModeSequence($position ? $position : array());
792 $next_class = $this->ctrl->getNextClass($this);
793 $cmd = $this->ctrl->getCmd();
797 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
799 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
804 case 'ilregistrationsettingsgui':
806 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
809 $this->tabs_gui->setTabActive(
'registration_settings');
811 $this->ctrl->forwardCommand($registration_gui);
814 case 'ilpermissiongui':
817 $this->tabs_gui->setTabActive(
'perm_settings');
819 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
821 $ret =& $this->ctrl->forwardCommand($perm_gui);
824 case 'illdapsettingsgui':
827 $this->tabs_gui->setTabActive(
'auth_ldap');
829 include_once
'./Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
831 $this->ctrl->forwardCommand($ldap_settings_gui);
834 case 'ilauthshibbolethsettingsgui':
836 $this->tabs_gui->setTabActive(
'auth_shib');
837 include_once(
'./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
839 $this->ctrl->forwardCommand($shib_settings_gui);
842 case 'ilcassettingsgui':
844 $this->tabs_gui->setTabActive(
'auth_cas');
845 include_once
'./Services/CAS/classes/class.ilCASSettingsGUI.php';
847 $this->ctrl->forwardCommand($cas_settings);
850 case 'ilradiussettingsgui':
852 $this->tabs_gui->setTabActive(
'auth_radius');
853 include_once
'./Services/Radius/classes/class.ilRadiusSettingsGUI.php';
855 $this->ctrl->forwardCommand($radius_settings_gui);
858 case 'ilopenidsettingsgui':
860 $this->tabs_gui->setTabActive(
'auth_openid');
862 include_once
'./Services/OpenId/classes/class.ilOpenIdSettingsGUI.php';
864 $this->ctrl->forwardCommand($os);
867 case 'ilauthloginpageeditorgui':
870 $this->tabs_gui->setTabActive(
'authentication_settings');
871 $this->tabs_gui->setSubTabActive(
"auth_login_editor");
873 include_once
'./Services/Authentication/classes/class.ilAuthLoginPageEditorGUI.php';
875 $this->ctrl->forwardCommand($lpe);
881 $cmd =
"authSettings";
905 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
907 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
910 $tabs_gui->addTarget(
'registration_settings',
911 $this->ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view'));
913 $tabs_gui->addTarget(
"authentication_settings", $this->ctrl->getLinkTarget($this,
"authSettings"),
916 $tabs_gui->addTarget(
"auth_ldap", $this->ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
920 #$tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
923 $tabs_gui->addTarget(
'auth_shib',$this->ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui',
'settings'));
925 $tabs_gui->addTarget(
927 $this->ctrl->getLinkTargetByClass(
'ilcassettingsgui',
'settings')
930 $tabs_gui->addTarget(
"auth_radius", $this->ctrl->getLinkTargetByClass(
'ilradiussettingsgui',
"settings"),
933 $tabs_gui->addTarget(
"auth_soap", $this->ctrl->getLinkTarget($this,
"editSOAP"),
936 $tabs_gui->addTarget(
938 $this->ctrl->getLinkTargetByClass(
'ilopenidsettingsgui',
'settings'),
944 $tabs_gui->addTarget(
"apache_auth_settings", $this->ctrl->getLinkTarget($this,
'apacheAuthSettings'),
948 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
950 $tabs_gui->addTarget(
"perm_settings",
951 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
952 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
961 global $rbacsystem,
$ilUser,$ilAccess;
963 $GLOBALS[
'lng']->loadLanguageModule(
'auth');
968 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
970 $this->tabs_gui->addSubTabTarget(
"auth_settings",
971 $this->ctrl->getLinkTarget($this,
'authSettings'),
974 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
976 $this->tabs_gui->addSubTabTarget(
978 $this->ctrl->getLinkTargetByClass(
'ilauthloginpageeditorgui',
''),
991 $this->tabs_gui->setTabActive(
"apache_auth_settings");
998 $settings =
new ilSetting(
'apache_auth');
999 $settingsMap = $settings->getAll();
1001 $path = ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt';
1002 if (file_exists(
$path) && is_readable(
$path)) {
1003 $settingsMap[
'apache_auth_domains'] = file_get_contents(
$path);
1006 $form->setValuesByArray($settingsMap);
1008 $tpl->setVariable(
'ADM_CONTENT', $form->getHtml());
1015 $form->setValuesByPost();
1019 if ($form->checkInput())
1021 $settings =
new ilSetting(
'apache_auth');
1024 'apache_auth_indicator_name',
'apache_auth_indicator_value',
1025 'apache_enable_auth',
'apache_enable_local',
'apache_local_autocreate',
1026 'apache_enable_ldap',
'apache_auth_username_config_type',
1027 'apache_auth_username_direct_mapping_fieldname',
1028 'apache_default_role',
'apache_auth_target_override_login_page',
1029 'apache_auth_enable_override_login_page',
1030 'apache_auth_authenticate_on_login_page'
1034 foreach($fields as $field)
1035 $settings->set($field, $form->getInput($field));
1037 if ($form->getInput(
'apache_enable_auth'))
1038 $this->ilias->setSetting(
'apache_active',
true);
1040 $this->ilias->setSetting(
'apache_active',
false);
1042 if ($ilSetting->get(
"auth_mode") ==
AUTH_APACHE) {
1048 file_put_contents(ILIAS_DATA_DIR .
'/' . CLIENT_ID .
'/apache_auth_allowed_domains.txt', $allowedDomains);
1051 $this->ctrl->redirect($this,
'apacheAuthSettings');
1061 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1064 $form->setFormAction($this->ctrl->getFormAction($this));
1065 $form->setTitle($this->lng->txt(
'apache_settings'));
1067 $chb_enabled =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_auth'),
'apache_enable_auth');
1068 $form->addItem($chb_enabled);
1070 $chb_local_create_account =
new ilCheckboxInputGUI($this->lng->txt(
'apache_autocreate'),
'apache_local_autocreate');
1071 $chb_enabled->addSubitem($chb_local_create_account);
1074 $roles = $rbacreview->getGlobalRolesArray();
1075 $select =
new ilSelectInputGUI($this->lng->txt(
'apache_default_role'),
'apache_default_role');
1076 $roleOptions = array();
1077 foreach($roles as $role) {
1080 $select->setOptions($roleOptions);
1081 $select->setValue(4);
1083 $chb_local_create_account->addSubitem($select);
1085 $chb_local =
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_local'),
'apache_enable_local');
1086 $form->addItem($chb_local);
1092 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_name'),
'apache_auth_indicator_name');
1094 $form->addItem($txt);
1096 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_value'),
'apache_auth_indicator_value');
1098 $form->addItem($txt);
1101 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_enable_override_login'),
'apache_auth_enable_override_login_page');
1102 $form->addItem($chb);
1104 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_target_override_login'),
'apache_auth_target_override_login_page');
1106 $chb->addSubItem($txt);
1108 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_authenticate_on_login_page'),
'apache_auth_authenticate_on_login_page');
1109 $form->addItem($chb);
1112 $sec->setTitle($this->lng->txt(
'apache_auth_username_config'));
1113 $form->addItem($sec);
1115 $rag =
new ilRadioGroupInputGUI($this->lng->txt(
'apache_auth_username_config_type'),
'apache_auth_username_config_type');
1116 $form->addItem($rag);
1118 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_direct_mapping'), 1);
1119 $rag->addOption($rao);
1121 $txt =
new ilTextInputGUI($this->lng->txt(
'apache_auth_username_direct_mapping_fieldname'),
'apache_auth_username_direct_mapping_fieldname');
1125 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_extended_mapping'), 2);
1127 $rag->addOption($rao);
1129 $rao =
new ilRadioOption($this->lng->txt(
'apache_auth_username_by_function'), 3);
1130 $rag->addOption($rao);
1136 $sec->setTitle($this->lng->txt(
'apache_auth_security'));
1137 $form->addItem($sec);
1139 $txt =
new ilTextAreaInputGUI($this->lng->txt(
'apache_auth_domains'),
'apache_auth_domains');
1140 $txt->
setInfo($this->lng->txt(
'apache_auth_domains_description'));
1142 $form->addItem($txt);
1144 $form->addCommandButton(
'saveApacheSettings',$this->lng->txt(
'save'));
1145 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1151 return join(
"\n", preg_split(
"/[\r\n]+/", $text));