36 require_once
"./classes/class.ilObjectGUI.php";
47 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
49 $this->lng->loadLanguageModule(
'registration');
51 define(
'LDAP_DEFAULT_PORT',389);
52 define(
'RADIUS_DEFAULT_PORT',1812);
59 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
62 $this->tabs_gui->setTabActive(
'registration_settings');
65 $this->ctrl->setCmdClass(
'ilregistrationsettingsgui');
66 $this->ctrl->forwardCommand($registration_gui);
79 if (!$rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
81 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
84 $this->tabs_gui->setTabActive(
'authentication_settings');
86 $this->tabs_gui->setSubTabActive(
"auth_settings");
90 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
91 $this->tpl->setVariable(
"TXT_AUTH_TITLE", $this->lng->txt(
"auth_select"));
93 $this->tpl->setVariable(
"TXT_AUTH_MODE", $this->lng->txt(
"auth_mode"));
94 $this->tpl->setVariable(
"TXT_AUTH_DEFAULT", $this->lng->txt(
"default"));
95 $this->tpl->setVariable(
"TXT_AUTH_ACTIVE", $this->lng->txt(
"active"));
96 $this->tpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->lng->txt(
"num_users"));
98 $this->tpl->setVariable(
"TXT_LOCAL", $this->lng->txt(
"auth_local"));
99 $this->tpl->setVariable(
"TXT_LDAP", $this->lng->txt(
"auth_ldap"));
100 $this->tpl->setVariable(
"TXT_SHIB", $this->lng->txt(
"auth_shib"));
102 $this->tpl->setVariable(
"TXT_CAS", $this->lng->txt(
"auth_cas"));
104 $this->tpl->setVariable(
"TXT_RADIUS", $this->lng->txt(
"auth_radius"));
105 $this->tpl->setVariable(
"TXT_SCRIPT", $this->lng->txt(
"auth_script"));
110 foreach($auth_modes as $mode => $mode_name)
113 if ($ilSetting->get(
'auth_mode') == $mode)
115 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
116 ((
int) $auth_cnt[$mode_name] + $auth_cnt[
"default"]).
" (".$this->lng->txt(
"auth_per_default").
117 ": ".$auth_cnt[
"default"].
")");
121 $this->tpl->setVariable(
"NUM_".strtoupper($mode_name),
122 (
int) $auth_cnt[$mode_name]);
126 $this->tpl->setVariable(
"TXT_CONFIGURE", $this->lng->txt(
"auth_configure"));
127 $this->tpl->setVariable(
"TXT_AUTH_REMARK", $this->lng->txt(
"auth_remark_non_local_auth"));
128 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
129 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
130 $this->tpl->setVariable(
"CMD_SUBMIT",
"setAuthMode");
133 $checked =
"checked=\"checked\"";
134 $disabled =
"disabled=\"disabled\"";
135 $style_disabled =
"_disabled";
138 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$this->lng->txt(
"enabled").
"\" title=\"".$this->lng->txt(
"enabled").
"\" border=\"0\" vspace=\"0\"/>";
139 $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\"/>";
141 $this->tpl->setVariable(
"AUTH_LOCAL_ACTIVE", $icon_ok);
143 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
145 #$this->tpl->setVariable("AUTH_LDAP_ACTIVE", $this->ilias->getSetting('ldap_active') ? $icon_ok : $icon_not_ok);
146 $this->tpl->setVariable(
"AUTH_RADIUS_ACTIVE", $this->ilias->getSetting(
'radius_active') ? $icon_ok : $icon_not_ok);
147 $this->tpl->setVariable(
"AUTH_SHIB_ACTIVE", $this->ilias->getSetting(
'shib_active') ? $icon_ok : $icon_not_ok);
148 $this->tpl->setVariable(
"AUTH_SCRIPT_ACTIVE", $this->ilias->getSetting(
'script_active') ? $icon_ok : $icon_not_ok);
149 $this->tpl->setVariable(
"AUTH_CAS_ACTIVE", $this->ilias->getSetting(
'cas_active') ? $icon_ok : $icon_not_ok);
152 switch ($this->ilias->getSetting(
'auth_mode'))
155 $this->tpl->setVariable(
"CHK_LOCAL", $checked);
159 $this->tpl->setVariable(
"CHK_LDAP", $checked);
163 $this->tpl->setVariable(
"CHK_SHIB", $checked);
167 $this->tpl->setVariable(
"CHK_RADIUS", $checked);
171 $this->tpl->setVariable(
"CHK_CAS", $checked);
175 $this->tpl->setVariable(
"CHK_SCRIPT", $checked);
182 $this->tpl->setVariable(
'TABLE_AUTH_DETERMINATION',$this->form->getHTML());
186 $this->tpl->setVariable(
"FORMACTION_ROLES",
187 $this->ctrl->getFormAction($this));
188 $this->tpl->setVariable(
"TXT_AUTH_ROLES", $this->lng->txt(
"auth_active_roles"));
189 $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
"obj_role"));
190 $this->tpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->lng->txt(
"auth_role_auth_mode"));
191 $this->tpl->setVariable(
"CMD_SUBMIT_ROLES",
"updateAuthRoles");
193 include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
197 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
200 foreach ($reg_roles as $role)
202 foreach ($active_auth_modes as $auth_name => $auth_key)
207 if ($auth_name ==
"default" || $auth_name ==
"cas"
208 || $auth_name ==
"shibboleth" || $auth_name ==
'ldap')
213 $this->tpl->setCurrentBlock(
"auth_mode_selection");
215 if ($auth_name ==
'default')
221 $name = $this->lng->txt(
'auth_'.$auth_name);
224 $this->tpl->setVariable(
"AUTH_MODE_NAME", $name);
226 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
228 if ($role[
'auth_mode'] == $auth_name)
230 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
233 $this->tpl->parseCurrentBlock();
236 $this->tpl->setCurrentBlock(
"roles");
237 $this->tpl->setVariable(
"ROLE", $role[
'title']);
238 $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
239 $this->tpl->parseCurrentBlock();
254 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
256 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
258 if (is_array($_POST[
"loginMessage"]))
260 $this->loginSettings =
new ilSetting(
"login_settings");
262 foreach ($_POST[
"loginMessage"] as $key => $val)
264 $this->loginSettings->set(
"login_message_".$key, $val);
268 if($_POST[
'default_auth_mode'])
270 $ilSetting->set(
'default_auth_mode',(
int) $_POST[
'default_auth_mode']);
288 if (!$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId()))
290 $this->ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
293 $this->tabs_gui->setTabActive(
"authentication_settings");
295 $this->tabs_gui->setSubTabActive(
"login_information");
297 $lng->loadLanguageModule(
"meta");
300 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
302 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.auth_login_messages.html");
304 $form->setFormAction($this->ctrl->getFormAction($this));
305 $form->setTitle($this->lng->txt(
'login_information'));
306 #$form->setInfo($this->lng->txt('login_information_desc'));
308 $form->addCommandButton(
'saveLoginInfo',$this->lng->txt(
'save'));
309 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
311 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
312 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
316 $select =
new ilSelectInputGUI($this->lng->txt(
'default_auth_mode'),
'default_auth_mode');
318 $select->setInfo($this->lng->txt(
'default_auth_mode_info'));
319 $options[
AUTH_LOCAL] = $this->lng->txt(
'auth_local');
322 $options[
AUTH_LDAP] = $this->lng->txt(
'auth_ldap');
324 if($rad_settings->isActive())
326 $options [
AUTH_RADIUS] = $this->lng->txt(
'auth_radius');
328 $select->setOptions($options);
329 $form->addItem($select);
332 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
333 $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
"login_information"));
334 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"login_information_desc"));
335 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
337 if (!is_object($this->loginSettings))
339 $this->loginSettings =
new ilSetting(
"login_settings");
342 $login_settings = $this->loginSettings->getAll();
343 $languages = $lng->getInstalledLanguages();
344 $def_language = $lng->getDefaultLanguage();
346 foreach ($this->
setDefLangFirst($def_language, $languages) as $lang_key)
349 if ($lang_key == $def_language)
351 $add =
" (".$lng->txt(
"default").
")";
355 'loginMessage['.$lang_key.
']');
356 $textarea->setRows(10);
357 $textarea->setValue($login_settings[
"login_message_".$lang_key]);
358 $textarea->setUseRte(
true);
359 $form->addItem($textarea);
361 unset($login_settings[
"login_message_".$lang_key]);
364 foreach ($login_settings as $key => $message)
366 $lang_key = substr($key, strrpos($key,
"_") + 1, strlen($key) - strrpos($key,
"_"));
369 'loginMessage['.$lang_key.
']');
370 $textarea->setRows(10);
371 $textarea->setValue($message);
372 $textarea->setUseRte(
true);
374 if(!in_array($lang_key,$languages))
376 $textarea->setAlert($lng->txt(
"not_installed"));
378 $form->addItem($textarea);
380 $this->tpl->setVariable(
'LOGIN_INFO',$form->getHTML());
396 if (is_array($a_languages) && $a_def_language !=
"")
398 $languages = array();
399 $languages[] = $a_def_language;
401 foreach ($a_languages as $val)
403 if (!in_array($val, $languages))
420 $this->ctrl->redirect($this,
"authSettings");
427 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
429 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
432 if (empty($_POST[
"auth_mode"]))
434 $this->ilias->raiseError($this->lng->txt(
"auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
437 if ($_POST[
"auth_mode"] == AUTH_DEFAULT)
440 $this->ctrl->redirect($this,
'authSettings');
443 switch ($_POST[
"auth_mode"])
457 if ($this->object->checkAuthSHIB() !==
true)
465 if ($this->object->checkAuthRADIUS() !==
true)
468 $this->ctrl->redirect($this,
'editRADIUS');
473 if ($this->object->checkAuthScript() !==
true)
481 $this->ilias->setSetting(
"auth_mode",$_POST[
"auth_mode"]);
484 $this->ctrl->redirect($this,
'authSettings');
496 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
498 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
501 $this->tabs_gui->setTabActive(
'auth_ldap');
505 if (
$_SESSION[
"error_post_vars"][
"ldap"][
"active"] ==
"1")
507 $this->tpl->setVariable(
"CHK_LDAP_ACTIVE",
"checked=\"checked\"");
510 if (
$_SESSION[
"error_post_vars"][
"ldap"][
"tls"] ==
"1")
512 $this->tpl->setVariable(
"LDAP_TLS_CHK",
"checked=\"checked\"");
515 if (
$_SESSION[
"error_post_vars"][
"ldap"][
"version"] ==
"3")
517 $this->tpl->setVariable(
"LDAP_VERSION3_CHK",
"checked=\"checked\"");
521 $this->tpl->setVariable(
"LDAP_VERSION2_CHK",
"checked=\"checked\"");
524 $this->tpl->setVariable(
"LDAP_SERVER",
$_SESSION[
"error_post_vars"][
"ldap"][
"server"]);
525 $this->tpl->setVariable(
"LDAP_BASEDN",
$_SESSION[
"error_post_vars"][
"ldap"][
"basedn"]);
526 $this->tpl->setVariable(
"LDAP_SEARCH_BASE",
$_SESSION[
"error_post_vars"][
"ldap"][
"search_base"]);
527 $this->tpl->setVariable(
"LDAP_PORT",
$_SESSION[
"error_post_vars"][
"ldap"][
"port"]);
528 $this->tpl->setVariable(
"LDAP_LOGIN_KEY",
$_SESSION[
"error_post_vars"][
"ldap"][
"login_key"]);
529 $this->tpl->setVariable(
"LDAP_OBJECTCLASS",
$_SESSION[
"error_post_vars"][
"ldap"][
"objectclass"]);
534 $settings = $this->ilias->getAllSettings();
536 if ($settings[
"ldap_active"] ==
"1")
538 $this->tpl->setVariable(
"CHK_LDAP_ACTIVE",
"checked=\"checked\"");
541 if ($settings[
"ldap_tls"] ==
"1")
543 $this->tpl->setVariable(
"LDAP_TLS_CHK",
"checked=\"checked\"");
546 $this->tpl->setVariable(
"LDAP_SERVER", $settings[
"ldap_server"]);
547 $this->tpl->setVariable(
"LDAP_BASEDN", $settings[
"ldap_basedn"]);
548 $this->tpl->setVariable(
"LDAP_SEARCH_BASE", $settings[
"ldap_search_base"]);
550 if (empty($settings[
"ldap_port"]))
552 $this->tpl->setVariable(
"LDAP_PORT", LDAP_DEFAULT_PORT);
556 $this->tpl->setVariable(
"LDAP_PORT", $settings[
"ldap_port"]);
559 if (empty($settings[
"ldap_login_key"]))
561 $this->tpl->setVariable(
"LDAP_LOGIN_KEY",
"uid");
565 $this->tpl->setVariable(
"LDAP_LOGIN_KEY", $settings[
"ldap_login_key"]);
568 if (empty($settings[
"ldap_objectclass"]))
570 $this->tpl->setVariable(
"LDAP_OBJECTCLASS",
"posixAccount");
574 $this->tpl->setVariable(
"LDAP_OBJECTCLASS", $settings[
"ldap_objectclass"]);
577 if (empty($settings[
"ldap_version"]) or $settings[
"ldap_version"] ==
"2")
579 $this->tpl->setVariable(
"LDAP_VERSION2_CHK",
"checked=\"checked\"");
583 $this->tpl->setVariable(
"LDAP_VERSION3_CHK",
"checked=\"checked\"");
589 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
590 $this->tpl->setVariable(
"COLSPAN", 3);
591 $this->tpl->setVariable(
"TXT_LDAP_TITLE", $this->lng->txt(
"ldap_configure"));
592 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
593 $this->tpl->setVariable(
"TXT_LDAP_ACTIVE", $this->lng->txt(
"auth_ldap_enable"));
594 $this->tpl->setVariable(
"TXT_LDAP_TLS", $this->lng->txt(
"ldap_tls"));
595 $this->tpl->setVariable(
"TXT_LDAP_SERVER", $this->lng->txt(
"ldap_server"));
596 $this->tpl->setVariable(
"TXT_LDAP_BASEDN", $this->lng->txt(
"ldap_basedn"));
597 $this->tpl->setVariable(
"TXT_LDAP_SEARCH_BASE", $this->lng->txt(
"ldap_search_base"));
598 $this->tpl->setVariable(
"TXT_LDAP_PORT", $this->lng->txt(
"ldap_port"));
599 $this->tpl->setVariable(
"TXT_LDAP_TLS", $this->lng->txt(
"ldap_tls"));
601 $this->tpl->setVariable(
"TXT_LDAP_VERSION", $this->lng->txt(
"ldap_version"));
602 $this->tpl->setVariable(
"TXT_LDAP_VERSION2", $this->lng->txt(
"ldap_v2"));
603 $this->tpl->setVariable(
"TXT_LDAP_VERSION3", $this->lng->txt(
"ldap_v3"));
605 $this->tpl->setVariable(
"TXT_LDAP_LOGIN_KEY", $this->lng->txt(
"ldap_login_key"));
606 $this->tpl->setVariable(
"TXT_LDAP_OBJECTCLASS", $this->lng->txt(
"ldap_objectclass"));
608 $this->tpl->setVariable(
"TXT_LDAP_PASSWD", $this->lng->txt(
"ldap_passwd"));
610 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
611 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
612 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
613 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveLDAP");
627 if (!$_POST[
"ldap"][
"server"] or !$_POST[
"ldap"][
"basedn"] or !$_POST[
"ldap"][
"port"] or !$_POST[
"ldap"][
"login_key"] or !$_POST[
"ldap"][
"objectclass"])
629 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
633 if (!$_POST[
"ldap"][
"passwd"])
635 $this->ilias->raiseError($this->lng->txt(
"err_enter_current_passwd"),$this->ilias->error_obj->MESSAGE);
639 if ((preg_match(
"/^[0-9]{0,5}$/",$_POST[
"ldap"][
"port"])) ==
false)
641 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
645 if ($_POST[
"ldap"][
"tls"] !=
"1")
647 $_POST[
"ldap"][
"tls"] =
"0";
653 $ldap_host = $_POST[
"ldap"][
"server"];
654 $ldap_port = $_POST[
"ldap"][
"port"];
655 $ldap_pass = $_POST[
"ldap"][
"passwd"];
657 $ldap_userattr = $_POST[
"ldap"][
"login_key"];
658 $ldap_useroc = $_POST[
"ldap"][
"objectclass"];
660 $ldap_dn = $ldap_userattr.
"=".$this->ilias->account->getLogin().
",";
663 if ($_POST[
"ldap"][
"search_base"])
665 $ldap_searchbase .= $_POST[
"ldap"][
"search_base"].
",";
668 $ldap_searchbase .= $_POST[
"ldap"][
"basedn"];
670 $ldap_dn .= $ldap_searchbase;
673 $ldap_conn = ldap_connect($ldap_host,$ldap_port);
675 @ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, $_POST[
"ldap"][
"version"]);
678 if (($ldap_bind = ldap_bind($ldap_conn)) ==
false)
680 $this->ilias->raiseError($this->lng->txt(
"err_ldap_connect_failed"),$this->ilias->error_obj->MESSAGE);
684 $filter = sprintf(
'(&(objectClass=%s)(%s=%s))', $ldap_useroc, $ldap_userattr, $ilUser->getLogin());
687 $func_params = array($ldap_conn, $ldap_searchbase, $filter, array($ldap_userattr));
690 if (($result_id = @call_user_func_array(
'ldap_search', $func_params)) ==
false)
692 $this->ilias->raiseError($this->lng->txt(
"err_ldap_search_failed"),$this->ilias->error_obj->MESSAGE);
695 if (ldap_count_entries($ldap_conn, $result_id) != 1)
697 $this->ilias->raiseError($this->lng->txt(
"err_ldap_user_not_found"),$this->ilias->error_obj->MESSAGE);
701 $entry_id = ldap_first_entry($ldap_conn, $result_id);
702 $user_dn = ldap_get_dn($ldap_conn, $entry_id);
704 ldap_free_result($result_id);
707 if (@ldap_bind($ldap_conn, $user_dn, $ldap_pass) ==
false)
709 $this->ilias->raiseError($this->lng->txt(
"err_ldap_auth_failed"),$this->ilias->error_obj->MESSAGE);
713 @ldap_unbind($ldap_conn);
716 $this->ilias->setSetting(
"ldap_tls", $_POST[
"ldap"][
"tls"]);
717 $this->ilias->setSetting(
"ldap_server", $_POST[
"ldap"][
"server"]);
718 $this->ilias->setSetting(
"ldap_basedn", $_POST[
"ldap"][
"basedn"]);
719 $this->ilias->setSetting(
"ldap_search_base", $_POST[
"ldap"][
"search_base"]);
720 $this->ilias->setSetting(
"ldap_port", $_POST[
"ldap"][
"port"]);
721 $this->ilias->setSetting(
"ldap_version", $_POST[
"ldap"][
"version"]);
722 $this->ilias->setSetting(
"ldap_login_key", $_POST[
"ldap"][
"login_key"]);
723 $this->ilias->setSetting(
"ldap_objectclass", $_POST[
"ldap"][
"objectclass"]);
724 $this->ilias->setSetting(
"ldap_active", $_POST[
"ldap"][
"active"]);
727 $this->ctrl->redirect($this,
'editLDAP');;
737 global $rbacsystem, $rbacreview;
739 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
741 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
744 $this->tabs_gui->setTabActive(
'auth_shib');
747 $settings = $this->ilias->getAllSettings();
750 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
751 $selectElement =
'<select name="shib[user_default_role]">';
753 if (!isset($settings[
"shib_user_default_role"]))
755 $settings[
"shib_user_default_role"] = 4;
758 foreach ($role_list as $role)
760 $selectElement .=
'<option value="'.$role[
'obj_id'].
'"';
761 if ($settings[
"shib_user_default_role"] == $role[
'obj_id'])
762 $selectElement .=
'selected="selected"';
764 $selectElement .=
'>'.$role[
'title'].
'</option>';
766 $selectElement .=
'</select>';
770 $shib_settings = array(
791 foreach ($shib_settings as $setting)
793 $field = ereg_replace(
'shib_',
'',$setting);
794 $this->tpl->setVariable(strtoupper($setting), $settings[$setting]);
795 $this->tpl->setVariable(
'SHIB_UPDATE_'.strtoupper($field), $settings[
"shib_update_".$field]);
797 if ($settings[
"shib_update_".$field])
799 $this->tpl->setVariable(
'chk_shib_update_'.strtolower($field),
'checked="checked"');
805 if (!isset($settings[
"shib_login_button"]) || $settings[
"shib_login_button"] ==
''){
806 $this->tpl->setVariable(
"SHIB_LOGIN_BUTTON",
"templates/default/images/shib_login_button.gif");
809 if (isset($settings[
"shib_active"]) && $settings[
"shib_active"])
811 $this->tpl->setVariable(
"chk_shib_active",
'checked="checked"');
813 if ($settings[
'shib_auth_allow_local'] ==
'1')
815 $this->tpl->setVariable(
'CHK_SHIB_AUTH_ALLOW_LOCAL',
'checked="checked"');
819 !isset($settings[
"shib_hos_type"])
820 || $settings[
"shib_hos_type"] ==
''
821 || $settings[
"shib_hos_type"] !=
'external_wayf'
824 $this->tpl->setVariable(
"CHK_SHIB_LOGIN_INTERNAL_WAYF",
'checked="checked"');
825 $this->tpl->setVariable(
"CHK_SHIB_LOGIN_EXTERNAL_WAYF",
'');
827 $this->tpl->setVariable(
"CHK_SHIB_LOGIN_INTERNAL_WAYF",
'');
828 $this->tpl->setVariable(
"CHK_SHIB_LOGIN_EXTERNAL_WAYF",
'checked="checked"');
831 if (!isset($settings[
"shib_idp_list"]) || $settings[
"shib_idp_list"] ==
'')
833 $this->tpl->setVariable(
"SHIB_IDP_LIST",
"urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai");
835 $this->tpl->setVariable(
"SHIB_IDP_LIST", stripslashes($settings[
"shib_idp_list"]));
838 $this->tpl->setVariable(
"SHIB_USER_DEFAULT_ROLE", $selectElement);
839 $this->tpl->setVariable(
"SHIB_LOGIN_BUTTON", $settings[
"shib_login_button"]);
840 $this->tpl->setVariable(
"SHIB_LOGIN_INSTRUCTIONS", stripslashes($settings[
"shib_login_instructions"]));
841 $this->tpl->setVariable(
"SHIB_FEDERATION_NAME", stripslashes($settings[
"shib_federation_name"]));
842 $this->tpl->setVariable(
"SHIB_DATA_CONV", $settings[
"shib_data_conv"]);
844 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
845 $this->tpl->setVariable(
"COLSPAN", 3);
846 $this->tpl->setVariable(
"TXT_SHIB_INSTRUCTIONS",
847 $this->lng->txt(
"auth_shib_instructions"));
848 $this->tpl->setVariable(
"LINK_SHIB_INSTRUCTIONS",
849 "./Services/AuthShibboleth/README.SHIBBOLETH.txt");
850 $this->tpl->setVariable(
"TXT_SHIB", $this->lng->txt(
"shib"));
851 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
852 $this->tpl->setVariable(
"TXT_SHIB_UPDATE", $this->lng->txt(
"shib_update"));
853 $this->tpl->setVariable(
"TXT_SHIB_ACTIVE", $this->lng->txt(
"shib_active"));
854 $this->tpl->setVariable(
"TXT_SHIB_USER_DEFAULT_ROLE", $this->lng->txt(
"shib_user_default_role"));
855 $this->tpl->setVariable(
"TXT_SHIB_LOGIN_BUTTON", $this->lng->txt(
"shib_login_button"));
856 $this->tpl->setVariable(
"TXT_SHIB_LOGIN_TYPE", $this->lng->txt(
"shib_login_type"));
857 $this->tpl->setVariable(
"TXT_SHIB_LOGIN_INTERNAL_WAYF", $this->lng->txt(
"shib_login_internal_wayf"));
858 $this->tpl->setVariable(
"TXT_SHIB_LOGIN_EXTERNAL_WAYF", $this->lng->txt(
"shib_login_external_wayf"));
859 $this->tpl->setVariable(
"TXT_SHIB_IDP_LIST", $this->lng->txt(
"shib_idp_list"));
860 $this->tpl->setVariable(
"TXT_SHIB_FEDERATION_NAME", $this->lng->txt(
"shib_federation_name"));
861 $this->tpl->setVariable(
"TXT_SHIB_LOGIN_INSTRUCTIONS", $this->lng->txt(
"auth_login_instructions"));
862 $this->tpl->setVariable(
"TXT_SHIB_DATA_CONV", $this->lng->txt(
"shib_data_conv"));
863 $this->tpl->setVariable(
"TXT_SHIB_AUTH_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
864 foreach ($shib_settings as $setting)
866 $this->tpl->setVariable(
"TXT_".strtoupper($setting), $this->lng->txt($setting));
869 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
870 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
871 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
872 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveSHIB");
887 !$_POST[
"shib"][
"login"]
888 or !$_POST[
"shib"][
"hos_type"]
889 or !$_POST[
"shib"][
"firstname"]
890 or !$_POST[
"shib"][
"lastname"]
891 or !$_POST[
"shib"][
"email"]
892 or !$_POST[
"shib"][
"user_default_role"]
893 or !$_POST[
"shib"][
"federation_name"]
896 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
901 $_POST[
"shib"][
"data_conv"]
902 and $_POST[
"shib"][
"data_conv"] !=
''
903 and !is_readable($_POST[
"shib"][
"data_conv"]) )
905 $this->ilias->raiseError($this->lng->txt(
"shib_data_conv_warning"),$this->ilias->error_obj->MESSAGE);
909 $shib_settings = array(
928 foreach ($shib_settings as $setting)
930 $field = ereg_replace(
'shib_',
'',$setting);
931 if ($_POST[
"shib"][
"update_".$field] !=
"1")
932 $_POST[
"shib"][
"update_".$field] =
"0";
933 $this->ilias->setSetting($setting, trim($_POST[
"shib"][$field]));
934 $this->ilias->setSetting(
"shib_update_".$field, $_POST[
"shib"][
"update_".$field]);
937 if ($_POST[
"shib"][
"active"] !=
"1")
939 $this->ilias->setSetting(
"shib_active",
"0");
943 $this->ilias->setSetting(
"shib_active",
"1");
946 $this->ilias->setSetting(
"shib_user_default_role", $_POST[
"shib"][
"user_default_role"]);
947 $this->ilias->setSetting(
"shib_hos_type", $_POST[
"shib"][
"hos_type"]);
948 $this->ilias->setSetting(
"shib_federation_name", $_POST[
"shib"][
"federation_name"]);
949 $this->ilias->setSetting(
"shib_idp_list", $_POST[
"shib"][
"idp_list"]);
950 $this->ilias->setSetting(
"shib_login_instructions", $_POST[
"shib"][
"login_instructions"]);
951 $this->ilias->setSetting(
"shib_login_button", $_POST[
"shib"][
"login_button"]);
952 $this->ilias->setSetting(
"shib_data_conv", $_POST[
"shib"][
"data_conv"]);
953 $this->ilias->setSetting(
"shib_auth_allow_local", ($_POST[
'shib'][
'auth_allow_local']==
'1') ?
'1' :
'0');
957 $this->ctrl->redirect($this,
'editSHIB');
969 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
971 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
974 $this->tabs_gui->setTabActive(
'auth_cas');
980 $settings = $ilSetting->getAll();
985 if (
$_SESSION[
"error_post_vars"][
"cas"][
"active"] ==
"1")
987 $this->tpl->setVariable(
"CHK_CAS_ACTIVE",
"checked=\"checked\"");
989 if (
$_SESSION[
"error_post_vars"][
"cas"][
"create_users"] ==
"1")
991 $this->tpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
993 if (
$_SESSION[
"error_post_vars"][
"cas"][
"allow_local"] ==
"1")
995 $this->tpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
998 $this->tpl->setVariable(
"CAS_SERVER",
$_SESSION[
"error_post_vars"][
"cas"][
"server"]);
999 $this->tpl->setVariable(
"CAS_PORT",
$_SESSION[
"error_post_vars"][
"cas"][
"port"]);
1000 $this->tpl->setVariable(
"CAS_URI",
$_SESSION[
"error_post_vars"][
"cas"][
"uri"]);
1001 $this->tpl->setVariable(
"CAS_LOGIN_INSTRUCTIONS",
$_SESSION[
"error_post_vars"][
"cas"][
"login_instructions"]);
1002 $current_default_role =
$_SESSION[
"error_post_vars"][
"cas"][
"user_default_role"];
1006 if ($settings[
"cas_active"] ==
"1")
1008 $this->tpl->setVariable(
"CHK_CAS_ACTIVE",
"checked=\"checked\"");
1010 if ($settings[
"cas_create_users"] ==
"1")
1012 $this->tpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
1014 if ($settings[
"cas_allow_local"] ==
"1")
1016 $this->tpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
1019 $this->tpl->setVariable(
"CAS_SERVER", $settings[
"cas_server"]);
1020 $this->tpl->setVariable(
"CAS_PORT", $settings[
"cas_port"]);
1021 $this->tpl->setVariable(
"CAS_URI", $settings[
"cas_uri"]);
1022 $this->tpl->setVariable(
"CAS_LOGIN_INSTRUCTIONS", $settings[
"cas_login_instructions"]);
1023 $current_default_role = $settings[
"cas_user_default_role"];
1027 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
1028 if (!$current_default_role)
1030 $current_default_role = 4;
1033 foreach ($role_list as $role)
1035 $roles[$role[
'obj_id']] = $role[
'title'];
1038 "cas[user_default_role]", $roles,
false,
true);
1040 $this->tpl->setVariable(
"CAS_USER_DEFAULT_ROLE", $selectElement);
1041 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1042 $this->tpl->setVariable(
"COLSPAN", 3);
1043 $this->tpl->setVariable(
"TXT_CAS_TITLE", $this->lng->txt(
"auth_cas_auth"));
1044 $this->tpl->setVariable(
"TXT_CAS_DESC", $this->lng->txt(
"auth_cas_auth_desc"));
1045 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
1046 $this->tpl->setVariable(
"TXT_CAS_ACTIVE", $this->lng->txt(
"active"));
1047 $this->tpl->setVariable(
"TXT_CAS_SERVER", $this->lng->txt(
"server"));
1048 $this->tpl->setVariable(
"TXT_CAS_SERVER_DESC", $this->lng->txt(
"auth_cas_server_desc"));
1049 $this->tpl->setVariable(
"TXT_CAS_PORT", $this->lng->txt(
"port"));
1050 $this->tpl->setVariable(
"TXT_CAS_PORT_DESC", $this->lng->txt(
"auth_cas_port_desc"));
1051 $this->tpl->setVariable(
"TXT_CAS_URI", $this->lng->txt(
"uri"));
1052 $this->tpl->setVariable(
"TXT_CAS_URI_DESC", $this->lng->txt(
"auth_cas_uri_desc"));
1053 $this->tpl->setVariable(
"TXT_CAS_LOGIN_INSTRUCTIONS", $this->lng->txt(
"auth_login_instructions"));
1054 $this->tpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
1055 $this->tpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_cas_create_users_desc"));
1056 $this->tpl->setVariable(
"TXT_CAS_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
1057 $this->tpl->setVariable(
"TXT_CAS_USER_DEFAULT_ROLE_DESC",
1058 $this->lng->txt(
"auth_cas_user_default_role_desc"));
1059 $this->tpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
1060 $this->tpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_cas_allow_local_desc"));
1061 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
1062 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1063 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
1064 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveCAS");
1077 if (!$_POST[
"cas"][
"server"] or !$_POST[
"cas"][
"port"])
1079 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
1083 if ((preg_match(
"/^[0-9]{0,5}$/",$_POST[
"cas"][
"port"])) ==
false)
1085 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
1088 $ilSetting->set(
"cas_server", $_POST[
"cas"][
"server"]);
1089 $ilSetting->set(
"cas_port", $_POST[
"cas"][
"port"]);
1090 $ilSetting->set(
"cas_uri", $_POST[
"cas"][
"uri"]);
1091 $ilSetting->set(
"cas_login_instructions", $_POST[
"cas"][
"login_instructions"]);
1092 $ilSetting->set(
"cas_active", $_POST[
"cas"][
"active"]);
1093 $ilSetting->set(
"cas_create_users", $_POST[
"cas"][
"create_users"]);
1094 $ilSetting->set(
"cas_allow_local", $_POST[
"cas"][
"allow_local"]);
1095 $ilSetting->set(
"cas_active", $_POST[
"cas"][
"active"]);
1096 $ilSetting->set(
"cas_user_default_role", $_POST[
"cas"][
"user_default_role"]);
1099 $this->ctrl->redirect($this,
'editCAS');
1111 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
1113 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1116 $this->tabs_gui->setTabActive(
'auth_soap');
1119 $stpl =
new ilTemplate(
"tpl.auth_soap.html",
true,
true,
"");
1124 $settings = $ilSetting->getAll();
1129 if (
$_SESSION[
"error_post_vars"][
"soap"][
"active"] ==
"1")
1131 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
1133 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_https"] ==
"1")
1135 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
1137 if (
$_SESSION[
"error_post_vars"][
"soap"][
"create_users"] ==
"1")
1139 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
1141 if (
$_SESSION[
"error_post_vars"][
"soap"][
"allow_local"] ==
"1")
1143 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
1145 if (
$_SESSION[
"error_post_vars"][
"soap"][
"account_mail"] ==
"1")
1147 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
1149 if (
$_SESSION[
"error_post_vars"][
"soap"][
"use_dotnet"] ==
"1")
1151 $stpl->setVariable(
"CHK_USEDOTNET",
"checked=\"checked\"");
1154 $stpl->setVariable(
"SOAP_SERVER",
$_SESSION[
"error_post_vars"][
"soap"][
"server"]);
1155 $stpl->setVariable(
"SOAP_PORT",
$_SESSION[
"error_post_vars"][
"soap"][
"port"]);
1156 $stpl->setVariable(
"SOAP_URI",
$_SESSION[
"error_post_vars"][
"soap"][
"uri"]);
1157 $stpl->setVariable(
"SOAP_NAMESPACE",
$_SESSION[
"error_post_vars"][
"soap"][
"namespace"]);
1158 $current_default_role =
$_SESSION[
"error_post_vars"][
"soap"][
"user_default_role"];
1162 if ($settings[
"soap_auth_active"] ==
"1")
1164 $stpl->setVariable(
"CHK_SOAP_ACTIVE",
"checked=\"checked\"");
1166 if ($settings[
"soap_auth_use_https"] ==
"1")
1168 $stpl->setVariable(
"CHK_USE_HTTPS",
"checked=\"checked\"");
1170 if ($settings[
"soap_auth_create_users"] ==
"1")
1172 $stpl->setVariable(
"CHK_CREATE_USERS",
"checked=\"checked\"");
1174 if ($settings[
"soap_auth_allow_local"] ==
"1")
1176 $stpl->setVariable(
"CHK_ALLOW_LOCAL",
"checked=\"checked\"");
1178 if ($settings[
"soap_auth_account_mail"] ==
"1")
1180 $stpl->setVariable(
"CHK_ACCOUNT_MAIL",
"checked=\"checked\"");
1182 if ($settings[
"soap_auth_use_dotnet"] ==
"1")
1184 $stpl->setVariable(
"CHK_USE_DOTNET",
"checked=\"checked\"");
1187 $stpl->setVariable(
"SOAP_SERVER", $settings[
"soap_auth_server"]);
1188 $stpl->setVariable(
"SOAP_PORT", $settings[
"soap_auth_port"]);
1189 $stpl->setVariable(
"SOAP_URI", $settings[
"soap_auth_uri"]);
1190 $stpl->setVariable(
"SOAP_NAMESPACE", $settings[
"soap_auth_namespace"]);
1191 $current_default_role = $settings[
"soap_auth_user_default_role"];
1195 $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
1196 if (!$current_default_role)
1198 $current_default_role = 4;
1201 foreach ($role_list as $role)
1203 $roles[$role[
'obj_id']] = $role[
'title'];
1206 "soap[user_default_role]", $roles,
false,
true);
1208 $stpl->setVariable(
"SOAP_USER_DEFAULT_ROLE", $selectElement);
1209 $stpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1210 $stpl->setVariable(
"COLSPAN", 3);
1211 $stpl->setVariable(
"TXT_SOAP_TITLE", $this->lng->txt(
"auth_soap_auth"));
1212 $stpl->setVariable(
"TXT_SOAP_DESC", $this->lng->txt(
"auth_soap_auth_desc"));
1213 $stpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
1214 $stpl->setVariable(
"TXT_SOAP_ACTIVE", $this->lng->txt(
"active"));
1215 $stpl->setVariable(
"TXT_SOAP_SERVER", $this->lng->txt(
"server"));
1216 $stpl->setVariable(
"TXT_SOAP_SERVER_DESC", $this->lng->txt(
"auth_soap_server_desc"));
1217 $stpl->setVariable(
"TXT_SOAP_PORT", $this->lng->txt(
"port"));
1218 $stpl->setVariable(
"TXT_SOAP_PORT_DESC", $this->lng->txt(
"auth_soap_port_desc"));
1219 $stpl->setVariable(
"TXT_SOAP_URI", $this->lng->txt(
"uri"));
1220 $stpl->setVariable(
"TXT_SOAP_URI_DESC", $this->lng->txt(
"auth_soap_uri_desc"));
1221 $stpl->setVariable(
"TXT_SOAP_NAMESPACE", $this->lng->txt(
"auth_soap_namespace"));
1222 $stpl->setVariable(
"TXT_SOAP_NAMESPACE_DESC", $this->lng->txt(
"auth_soap_namespace_desc"));
1223 $stpl->setVariable(
"TXT_USE_DOTNET", $this->lng->txt(
"auth_soap_use_dotnet"));
1224 $stpl->setVariable(
"TXT_USE_HTTPS", $this->lng->txt(
"auth_soap_use_https"));
1225 $stpl->setVariable(
"TXT_CREATE_USERS", $this->lng->txt(
"auth_create_users"));
1226 $stpl->setVariable(
"TXT_CREATE_USERS_DESC", $this->lng->txt(
"auth_soap_create_users_desc"));
1227 $stpl->setVariable(
"TXT_ACCOUNT_MAIL", $this->lng->txt(
"user_send_new_account_mail"));
1228 $stpl->setVariable(
"TXT_ACCOUNT_MAIL_DESC", $this->lng->txt(
"auth_new_account_mail_desc"));
1229 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE", $this->lng->txt(
"auth_user_default_role"));
1230 $stpl->setVariable(
"TXT_SOAP_USER_DEFAULT_ROLE_DESC",
1231 $this->lng->txt(
"auth_soap_user_default_role_desc"));
1232 $stpl->setVariable(
"TXT_ALLOW_LOCAL", $this->lng->txt(
"auth_allow_local"));
1233 $stpl->setVariable(
"TXT_ALLOW_LOCAL_DESC", $this->lng->txt(
"auth_soap_allow_local_desc"));
1234 $stpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
1235 $stpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1236 $stpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
1237 $stpl->setVariable(
"CMD_SUBMIT",
"saveSOAP");
1240 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1242 $form->setFormAction($ilCtrl->getFormAction($this));
1243 $form->setTitle(
"Test Request");
1245 $form->addItem($text_prop);
1247 $form->addItem($text_prop2);
1249 $form->addItem($cb);
1251 $form->addCommandButton(
"testSoapAuthConnection",
1254 if ($ilCtrl->getCmd() ==
"testSoapAuthConnection")
1256 include_once(
"./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
1257 $ret =
"<br />".ilSOAPAuth::testConnection(
1260 (
boolean) $_POST[
"new_user"]
1264 $stpl->setVariable(
"TEST_FORM", $form->getHtml().$ret);
1265 $this->tpl->setContent($stpl->get());
1283 if (!$_POST[
"soap"][
"server"])
1285 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
1289 if ($_POST[
"soap"][
"server"] !=
"" && (preg_match(
"/^[0-9]{0,5}$/",$_POST[
"soap"][
"port"])) ==
false)
1291 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
1294 $ilSetting->set(
"soap_auth_server", $_POST[
"soap"][
"server"]);
1295 $ilSetting->set(
"soap_auth_port", $_POST[
"soap"][
"port"]);
1296 $ilSetting->set(
"soap_auth_active", $_POST[
"soap"][
"active"]);
1297 $ilSetting->set(
"soap_auth_uri", $_POST[
"soap"][
"uri"]);
1298 $ilSetting->set(
"soap_auth_namespace", $_POST[
"soap"][
"namespace"]);
1299 $ilSetting->set(
"soap_auth_create_users", $_POST[
"soap"][
"create_users"]);
1300 $ilSetting->set(
"soap_auth_allow_local", $_POST[
"soap"][
"allow_local"]);
1301 $ilSetting->set(
"soap_auth_account_mail", $_POST[
"soap"][
"account_mail"]);
1302 $ilSetting->set(
"soap_auth_use_https", $_POST[
"soap"][
"use_https"]);
1303 $ilSetting->set(
"soap_auth_use_dotnet", $_POST[
"soap"][
"use_dotnet"]);
1304 $ilSetting->set(
"soap_auth_user_default_role", $_POST[
"soap"][
"user_default_role"]);
1307 $this->ctrl->redirect($this,
'editSOAP');
1319 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
1321 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1326 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME",
$_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
1331 $settings = $this->ilias->getAllSettings();
1333 $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", $settings[
"auth_script_name"]);
1336 $this->tabs_gui->setTabActive(
'auth_script');
1340 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1341 $this->tpl->setVariable(
"COLSPAN", 3);
1342 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->lng->txt(
"auth_script_configure"));
1343 $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
1344 $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->lng->txt(
"auth_script_name"));
1346 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
1347 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1348 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
1349 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveScript");
1360 if (!$_POST[
"auth_script"][
"name"])
1362 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
1375 $this->ilias->setSetting(
"auth_script_name", $_POST[
"auth_script"][
"name"]);
1376 $this->ilias->setSetting(
"auth_mode",
AUTH_SCRIPT);
1379 $this->ctrl->redirect($this,
'editScript');
1391 switch ($this->ilias->getSetting(
"auth_mode"))
1394 return $this->lng->txt(
"auth_local");
1398 return $this->lng->txt(
"auth_ldap");
1402 return $this->lng->txt(
"auth_shib");
1406 return $this->lng->txt(
"auth_radius");
1410 return $this->lng->txt(
"auth_script");
1414 return $this->lng->txt(
"unknown");
1423 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
1425 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1428 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
1432 $this->ctrl->redirect($this,
'authSettings');
1442 if(is_object($this->form))
1448 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
1450 if($det->getCountActiveAuthModes() <= 1)
1455 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1457 $this->form->setFormAction($this->ctrl->getFormAction($this));
1458 $this->form->setTableWidth(
'100%');
1459 $this->form->setTitle($this->lng->txt(
'auth_auth_mode_determination'));
1460 $this->form->addCommandButton(
'updateAuthModeDetermination',$this->lng->txt(
'save'));
1461 $this->form->addCommandButton(
'authSettings',$this->lng->txt(
'cancel'));
1464 $kind->
setInfo($this->lng->txt(
'auth_mode_determination_info'));
1465 $kind->setValue($det->getKind());
1466 $kind->setRequired(
true);
1468 $option_user =
new ilRadioOption($this->lng->txt(
'auth_by_user'),0);
1469 $kind->addOption($option_user);
1471 $option_determination =
new ilRadioOption($this->lng->txt(
'auth_automatic'),1);
1473 include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
1475 $auth_sequenced = $det->getAuthModeSequence();
1477 foreach($auth_sequenced as $auth_mode)
1482 $text = $this->lng->txt(
'auth_ldap');
1485 $text = $this->lng->txt(
'auth_radius');
1488 $text = $this->lng->txt(
'auth_local');
1494 $pos->setValue($counter++);
1496 $pos->setMaxLength(1);
1497 $option_determination->addSubItem($pos);
1499 $kind->addOption($option_determination);
1500 $this->form->addItem($kind);
1512 include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
1515 $det->setKind((
int) $_POST[
'kind']);
1517 $pos = $_POST[
'position'] ? $_POST[
'position'] : array();
1518 asort($pos,SORT_NUMERIC);
1521 foreach($pos as $auth_mode => $dummy)
1523 $position[$counter++] = $auth_mode;
1525 $det->setAuthModeSequence($position ? $position : array());
1537 $next_class = $this->ctrl->getNextClass($this);
1538 $cmd = $this->ctrl->getCmd();
1542 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
1544 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
1549 case 'ilregistrationsettingsgui':
1551 include_once
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
1554 $this->tabs_gui->setTabActive(
'registration_settings');
1556 $this->ctrl->forwardCommand($registration_gui);
1559 case 'ilpermissiongui':
1562 $this->tabs_gui->setTabActive(
'perm_settings');
1564 include_once(
"./classes/class.ilPermissionGUI.php");
1566 $ret =& $this->ctrl->forwardCommand($perm_gui);
1569 case 'illdapsettingsgui':
1572 $this->tabs_gui->setTabActive(
'auth_ldap');
1574 include_once
'./Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
1576 $this->ctrl->forwardCommand($ldap_settings_gui);
1579 case 'ilradiussettingsgui':
1581 $this->tabs_gui->setTabActive(
'auth_radius');
1582 include_once
'./Services/Radius/classes/class.ilRadiusSettingsGUI.php';
1584 $this->ctrl->forwardCommand($radius_settings_gui);
1591 $cmd =
"authSettings";
1615 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
1617 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1620 $tabs_gui->addTarget(
'registration_settings',
1621 $this->ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui',
'view'));
1623 $tabs_gui->addTarget(
"authentication_settings", $this->ctrl->getLinkTarget($this,
"authSettings"),
1626 $tabs_gui->addTarget(
"auth_ldap", $this->ctrl->getLinkTargetByClass(
'illdapsettingsgui',
'serverList'),
1630 #$tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
1633 $tabs_gui->addTarget(
"auth_shib", $this->ctrl->getLinkTarget($this,
"editSHIB"),
1636 $tabs_gui->addTarget(
"auth_cas", $this->ctrl->getLinkTarget($this,
"editCAS"),
1639 $tabs_gui->addTarget(
"auth_radius", $this->ctrl->getLinkTargetByClass(
'ilradiussettingsgui',
"settings"),
1642 $tabs_gui->addTarget(
"auth_soap", $this->ctrl->getLinkTarget($this,
"editSOAP"),
1647 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1649 $tabs_gui->addTarget(
"perm_settings",
1650 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1651 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1660 global $rbacsystem,$ilUser,$ilAccess;
1664 case 'authSettings':
1665 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1667 $this->tabs_gui->addSubTabTarget(
"auth_settings",
1668 $this->ctrl->getLinkTarget($this,
'authSettings'),
1672 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
1674 $this->tabs_gui->addSubTabTarget(
"login_information",
1675 $this->ctrl->getLinkTarget($this,
'loginInfo'),