17require_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
   25    public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output = 
true)
 
   28        parent::__construct($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);
 
   53        if (!
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
 
   54            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
   57        $this->tabs_gui->setTabActive(
'authentication_settings');
 
   59        $this->tabs_gui->setSubTabActive(
"auth_settings");
 
   61        $this->tpl->addBlockFile(
 
   64            "tpl.auth_general.html",
 
   65            "Services/Authentication" 
   68        $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
   69        $this->tpl->setVariable(
"TXT_AUTH_TITLE", $this->lng->txt(
"auth_select"));
 
   71        $this->tpl->setVariable(
"TXT_AUTH_MODE", $this->lng->txt(
"auth_mode"));
 
   72        $this->tpl->setVariable(
"TXT_AUTH_DEFAULT", $this->lng->txt(
"default"));
 
   73        $this->tpl->setVariable(
"TXT_AUTH_ACTIVE", $this->lng->txt(
"active"));
 
   74        $this->tpl->setVariable(
"TXT_AUTH_NUM_USERS", $this->lng->txt(
"num_users"));
 
   76        $this->tpl->setVariable(
"TXT_LOCAL", $this->lng->txt(
"auth_local"));
 
   77        $this->tpl->setVariable(
"TXT_LDAP", $this->lng->txt(
"auth_ldap"));
 
   78        $this->tpl->setVariable(
"TXT_SHIB", $this->lng->txt(
"auth_shib"));
 
   80        $this->tpl->setVariable(
"TXT_CAS", $this->lng->txt(
"auth_cas"));
 
   82        $this->tpl->setVariable(
"TXT_RADIUS", $this->lng->txt(
"auth_radius"));
 
   83        $this->tpl->setVariable(
"TXT_SCRIPT", $this->lng->txt(
"auth_script"));
 
   85        $this->tpl->setVariable(
"TXT_APACHE", $this->lng->txt(
"auth_apache"));
 
   90        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
   92        $icon_ok = 
"<img src=\"" . 
ilUtil::getImagePath(
"icon_ok.svg") . 
"\" alt=\"" . $this->lng->txt(
"enabled") . 
"\" title=\"" . $this->lng->txt(
"enabled") . 
"\" border=\"0\" vspace=\"0\"/>";
 
   93        $icon_not_ok = 
"<img src=\"" . 
ilUtil::getImagePath(
"icon_not_ok.svg") . 
"\" alt=\"" . $this->lng->txt(
"disabled") . 
"\" title=\"" . $this->lng->txt(
"disabled") . 
"\" border=\"0\" vspace=\"0\"/>";
 
   96        foreach ($auth_modes as $mode => $mode_name) {
 
  101            $this->tpl->setCurrentBlock(
'auth_mode');
 
  105                $this->tpl->setVariable(
"AUTH_NAME", 
$server->getName());
 
  106                $this->tpl->setVariable(
'AUTH_ACTIVE', 
$server->isActive() ? $icon_ok : $icon_not_ok);
 
  109                $this->tpl->setVariable(
'AUTH_NAME', 
$idp->getEntityId());
 
  110                $this->tpl->setVariable(
'AUTH_ACTIVE', 
$idp->isActive() ? $icon_ok : $icon_not_ok);
 
  112                $this->tpl->setVariable(
"AUTH_NAME", $this->lng->txt(
"auth_" . $mode_name));
 
  113                $this->tpl->setVariable(
'AUTH_ACTIVE', $this->
ilias->getSetting($mode_name . 
'_active') || $mode == 
AUTH_LOCAL ? $icon_ok : $icon_not_ok);
 
  117                $this->tpl->setVariable(
"AUTH_CHECKED", 
"checked=\"checked\"");
 
  119                $this->tpl->setVariable(
 
  121                    ((
int) $auth_cnt[$mode_name] + $auth_cnt[
"default"]) . 
" (" . $this->lng->txt(
"auth_per_default") .
 
  122                                        ": " . $auth_cnt[
"default"] . 
")" 
  125                $this->tpl->setVariable(
 
  127                    (
int) $auth_cnt[$mode_name]
 
  130            $this->tpl->setVariable(
"AUTH_ID", $mode_name);
 
  131            $this->tpl->setVariable(
"AUTH_VAL", $mode);
 
  132            $this->tpl->parseCurrentBlock();
 
  135        $this->tpl->setVariable(
"TXT_CONFIGURE", $this->lng->txt(
"auth_configure"));
 
  136        $this->tpl->setVariable(
"TXT_AUTH_REMARK", $this->lng->txt(
"auth_remark_non_local_auth"));
 
  137        $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
 
  138        $this->tpl->setVariable(
"CMD_SUBMIT", 
"setAuthMode");
 
  142            $this->tpl->setVariable(
'TABLE_AUTH_DETERMINATION', $this->form->getHTML());
 
  146        $this->tpl->setVariable(
 
  148            $this->ctrl->getFormAction($this)
 
  150        $this->tpl->setVariable(
"TXT_AUTH_ROLES", $this->lng->txt(
"auth_active_roles"));
 
  151        $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
"obj_role"));
 
  152        $this->tpl->setVariable(
"TXT_ROLE_AUTH_MODE", $this->lng->txt(
"auth_role_auth_mode"));
 
  153        $this->tpl->setVariable(
"CMD_SUBMIT_ROLES", 
"updateAuthRoles");
 
  155        include_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
 
  159        include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
 
  162        foreach ($reg_roles as $role) {
 
  163            foreach ($active_auth_modes as $auth_name => $auth_key) {
 
  167                if ($auth_name == 
"default" || $auth_name == 
"cas" 
  168                    || $auth_name == 
'saml' 
  169                    || $auth_name == 
"shibboleth" || $auth_name == 
'ldap' 
  170                    || $auth_name == 
'apache' || $auth_name == 
"ecs" 
  171                    || $auth_name == 
"openid") {
 
  175                $this->tpl->setCurrentBlock(
"auth_mode_selection");
 
  177                if ($auth_name == 
'default') {
 
  186                    $name = $this->lng->txt(
'auth_' . $auth_name);
 
  189                $this->tpl->setVariable(
"AUTH_MODE_NAME", 
$name);
 
  191                $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
 
  193                if ($role[
'auth_mode'] == $auth_name) {
 
  194                    $this->tpl->setVariable(
"SELECTED_AUTH_MODE", 
"selected=\"selected\"");
 
  197                $this->tpl->parseCurrentBlock();
 
  200            $this->tpl->setCurrentBlock(
"roles");
 
  201            $this->tpl->setVariable(
"ROLE", $role[
'title']);
 
  202            $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
 
  203            $this->tpl->parseCurrentBlock();
 
  218        if (!
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
 
  219            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
  222        $this->tabs_gui->setTabActive(
"authentication_settings");
 
  224        $this->tabs_gui->setSubTabActive(
"auth_login_editor");
 
  226        $lng->loadLanguageModule(
"meta");
 
  228        $this->tpl->addBlockFile(
 
  231            "tpl.auth_login_messages.html",
 
  232            "Services/Authentication" 
  234        $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  235        $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
"login_information"));
 
  236        $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->lng->txt(
"login_information_desc"));
 
  237        $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
 
  238        $this->initLoginForm();
 
  239        $this->tpl->setVariable(
'LOGIN_INFO', $this->form->getHTML());
 
  245        $this->ctrl->redirect($this, 
"authSettings");
 
  252        if (!
$rbacsystem->checkAccess(
"write", $this->object->getRefId())) {
 
  253            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
  256        if (empty(
$_POST[
"auth_mode"])) {
 
  257            $this->
ilias->raiseError($this->lng->txt(
"auth_err_no_mode_selected"), $this->ilias->error_obj->MESSAGE);
 
  260        if (
$_POST[
"auth_mode"] == AUTH_DEFAULT) {
 
  261            ilUtil::sendInfo($this->lng->txt(
"auth_mode") . 
": " . $this->getAuthModeTitle() . 
" " . $this->lng->txt(
"auth_mode_not_changed"), 
true);
 
  262            $this->ctrl->redirect($this, 
'authSettings');
 
  265        switch (
$_POST[
"auth_mode"]) {
 
  282                if ($this->object->checkAuthSHIB() !== 
true) {
 
  289                if ($this->object->checkAuthRADIUS() !== 
true) {
 
  291                    $this->ctrl->redirect($this, 
'editRADIUS');
 
  296                if ($this->object->checkAuthScript() !== 
true) {
 
  303        $this->
ilias->setSetting(
"auth_mode", 
$_POST[
"auth_mode"]);
 
  305        ilUtil::sendSuccess($this->lng->txt(
"auth_default_mode_changed_to") . 
" " . $this->getAuthModeTitle(), 
true);
 
  306        $this->ctrl->redirect($this, 
'authSettings');
 
  318        if (!
$rbacsystem->checkAccess(
"read", $this->object->getRefId())) {
 
  319            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
  322        $this->tabs_gui->setTabActive(
'auth_soap');
 
  325        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.auth_soap.html', 
'Services/Authentication');
 
  328        $role_list = 
$rbacreview->getRolesByFilter(2, $this->object->getId());
 
  331        foreach ($role_list as $role) {
 
  332            $roles[$role[
'obj_id']] = $role[
'title'];
 
  336        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  339        $soap_config->setTitle($this->lng->txt(
"auth_soap_auth"));
 
  340        $soap_config->setDescription($this->lng->txt(
"auth_soap_auth_desc"));
 
  341        $soap_config->setFormAction($this->ctrl->getFormAction($this, 
"editSOAP"));
 
  342        $soap_config->addCommandButton(
"saveSOAP", $this->lng->txt(
"save"));
 
  343        $soap_config->addCommandButton(
"editSOAP", $this->lng->txt(
"cancel"));
 
  347        $active->setTitle($this->lng->txt(
"active"));
 
  348        $active->setPostVar(
"soap[active]");
 
  352        $server->setTitle($this->lng->txt(
"server"));
 
  353        $server->setInfo($this->lng->txt(
"auth_soap_server_desc"));
 
  354        $server->setPostVar(
"soap[server]");
 
  361        $port->setTitle($this->lng->txt(
"port"));
 
  362        $port->setInfo($this->lng->txt(
"auth_soap_port_desc"));
 
  363        $port->setPostVar(
"soap[port]");
 
  365        $port->setMaxLength(5);
 
  369        $https->setTitle($this->lng->txt(
"auth_soap_use_https"));
 
  370        $https->setPostVar(
"soap[use_https]");
 
  374        $uri->setTitle($this->lng->txt(
"uri"));
 
  375        $uri->setInfo($this->lng->txt(
"auth_soap_uri_desc"));
 
  376        $uri->setPostVar(
"soap[uri]");
 
  378        $uri->setMaxLength(256);
 
  382        $namespace->setTitle($this->lng->txt(
"auth_soap_namespace"));
 
  383        $namespace->setInfo($this->lng->txt(
"auth_soap_namespace_desc"));
 
  390        $dotnet->setTitle($this->lng->txt(
"auth_soap_use_dotnet"));
 
  391        $dotnet->setPostVar(
"soap[use_dotnet]");
 
  395        $createuser->setTitle($this->lng->txt(
"auth_create_users"));
 
  396        $createuser->setInfo($this->lng->txt(
"auth_soap_create_users_desc"));
 
  397        $createuser->setPostVar(
"soap[create_users]");
 
  401        $sendmail->setTitle($this->lng->txt(
"user_send_new_account_mail"));
 
  402        $sendmail->setInfo($this->lng->txt(
"auth_new_account_mail_desc"));
 
  403        $sendmail->setPostVar(
"soap[account_mail]");
 
  407        $defaultrole->setTitle($this->lng->txt(
"auth_user_default_role"));
 
  408        $defaultrole->setInfo($this->lng->txt(
"auth_soap_user_default_role_desc"));
 
  409        $defaultrole->setPostVar(
"soap[user_default_role]");
 
  410        $defaultrole->setOptions($roles);
 
  414        $allowlocal->setTitle($this->lng->txt(
"auth_allow_local"));
 
  415        $allowlocal->setInfo($this->lng->txt(
"auth_soap_allow_local_desc"));
 
  416        $allowlocal->setPostVar(
"soap[allow_local]");
 
  423            $active             ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"active"]);
 
  425            $port               ->setValue(
$_SESSION[
"error_post_vars"][
"soap"][
"port"]);
 
  426            $https              ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"use_https"]);
 
  427            $uri                ->setValue(
$_SESSION[
"error_post_vars"][
"soap"][
"uri"]);
 
  429            $dotnet             ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"use_dotnet"]);
 
  430            $createuser ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"create_users"]);
 
  431            $allowlocal ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"allow_local"]);
 
  432            $defaultrole->setValue(
$_SESSION[
"error_post_vars"][
"soap"][
"user_default_role"]);
 
  433            $sendmail   ->setChecked(
$_SESSION[
"error_post_vars"][
"soap"][
"account_mail"]);
 
  435            $active             ->setChecked(
$settings[
"soap_auth_active"]);
 
  437            $port               ->setValue(
$settings[
"soap_auth_port"]);
 
  439            $uri                ->setValue(
$settings[
"soap_auth_uri"]);
 
  441            $dotnet             ->setChecked(
$settings[
"soap_auth_use_dotnet"]);
 
  442            $createuser ->setChecked(
$settings[
"soap_auth_create_users"]);
 
  443            $allowlocal ->setChecked(
$settings[
"soap_auth_allow_local"]);
 
  444            $defaultrole->setValue(
$settings[
"soap_auth_user_default_role"]);
 
  445            $sendmail   ->setChecked(
$settings[
"soap_auth_account_mail"]);
 
  448        if (!$defaultrole->getValue()) {
 
  449            $defaultrole->setValue(4);
 
  453        $soap_config->addItem($active);
 
  454        $soap_config->addItem(
$server);
 
  455        $soap_config->addItem($port);
 
  456        $soap_config->addItem(
$https);
 
  457        $soap_config->addItem($uri);
 
  459        $soap_config->addItem($dotnet);
 
  460        $soap_config->addItem($createuser);
 
  461        $soap_config->addItem($sendmail);
 
  462        $soap_config->addItem($defaultrole);
 
  463        $soap_config->addItem($allowlocal);
 
  465        $this->tpl->setVariable(
"CONFIG_FORM", $soap_config->getHTML());
 
  470        $form->setTitle(
"Test Request");
 
  472        $form->addItem($text_prop);
 
  474        $form->addItem($text_prop2);
 
  478        $form->addCommandButton(
 
  479            "testSoapAuthConnection",
 
  483        if (
$ilCtrl->getCmd() == 
"testSoapAuthConnection") {
 
  484            include_once(
"./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
 
  488                (
boolean) 
$_POST[
"new_user"]
 
  491        $this->tpl->setVariable(
"TEST_FORM", 
$form->getHTML() . 
$ret);
 
  508        if (!
$rbacsystem->checkAccess(
"write", $this->object->getRefId())) {
 
  509            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
  513        if (!
$_POST[
"soap"][
"server"]) {
 
  514            $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"), $this->ilias->error_obj->MESSAGE);
 
  518        if (
$_POST[
"soap"][
"server"] != 
"" && (preg_match(
"/^[0-9]{0,5}$/", 
$_POST[
"soap"][
"port"])) == 
false) {
 
  519            $this->
ilias->raiseError($this->lng->txt(
"err_invalid_port"), $this->ilias->error_obj->MESSAGE);
 
  532        $ilSetting->set(
"soap_auth_user_default_role", 
$_POST[
"soap"][
"user_default_role"]);
 
  535        $this->ctrl->redirect($this, 
'editSOAP');
 
  547        if (!
$rbacsystem->checkAccess(
"write", $this->object->getRefId())) {
 
  548            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
  552            $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", 
$_SESSION[
"error_post_vars"][
"auth_script"][
"name"]);
 
  557            $this->tpl->setVariable(
"AUTH_SCRIPT_NAME", 
$settings[
"auth_script_name"]);
 
  560        $this->tabs_gui->setTabActive(
'auth_script');
 
  562        $this->tpl->addBlockFile(
 
  565            "tpl.auth_script.html",
 
  566            "Services/Authentication" 
  569        $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  570        $this->tpl->setVariable(
"COLSPAN", 3);
 
  571        $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_TITLE", $this->lng->txt(
"auth_script_configure"));
 
  572        $this->tpl->setVariable(
"TXT_OPTIONS", $this->lng->txt(
"options"));
 
  573        $this->tpl->setVariable(
"TXT_AUTH_SCRIPT_NAME", $this->lng->txt(
"auth_script_name"));
 
  575        $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
 
  576        $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  577        $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
 
  578        $this->tpl->setVariable(
"CMD_SUBMIT", 
"saveScript");
 
  589        if (!
$_POST[
"auth_script"][
"name"]) {
 
  590            $this->
ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"), $this->ilias->error_obj->MESSAGE);
 
  603        $this->
ilias->setSetting(
"auth_script_name", 
$_POST[
"auth_script"][
"name"]);
 
  606        ilUtil::sendSuccess($this->lng->txt(
"auth_mode_changed_to") . 
" " . $this->getAuthModeTitle(), 
true);
 
  607        $this->ctrl->redirect($this, 
'editScript');
 
  619        switch ($this->
ilias->getSetting(
"auth_mode")) {
 
  621                return $this->lng->txt(
"auth_local");
 
  625                return $this->lng->txt(
"auth_ldap");
 
  629                return $this->lng->txt(
"auth_shib");
 
  633                return $this->lng->txt(
"auth_saml");
 
  637                return $this->lng->txt(
"auth_radius");
 
  641                return $this->lng->txt(
"auth_script");
 
  645                return $this->lng->txt(
"auth_apache");
 
  649                return $this->lng->txt(
"unknown");
 
  658        if (!
$rbacsystem->checkAccess(
"write", $this->object->getRefId())) {
 
  659            $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
 
  662        include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
 
  666        $this->ctrl->redirect($this, 
'authSettings');
 
  676        if (is_object($this->form)) {
 
  681        include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
 
  683        if ($det->getCountActiveAuthModes() <= 1) {
 
  687        include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
  689        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  690        $this->form->setTableWidth(
'100%');
 
  691        $this->form->setTitle($this->lng->txt(
'auth_auth_settings'));
 
  692        $this->form->addCommandButton(
'updateAuthModeDetermination', $this->lng->txt(
'save'));
 
  694        require_once 
'Services/Captcha/classes/class.ilCaptchaUtil.php';
 
  695        $cap = 
new ilCheckboxInputGUI($this->lng->txt(
'adm_captcha_anonymous_short'), 
'activate_captcha_anonym');
 
  696        $cap->setInfo($this->lng->txt(
'adm_captcha_anonymous_auth'));
 
  699            $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
 
  701        $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
 
  702        $this->form->addItem($cap);
 
  705        $header->setTitle($this->lng->txt(
'auth_auth_mode_determination'));
 
  709        $kind->setInfo($this->lng->txt(
'auth_mode_determination_info'));
 
  710        $kind->setValue($det->getKind());
 
  711        $kind->setRequired(
true);
 
  713        $option_user = 
new ilRadioOption($this->lng->txt(
'auth_by_user'), 0);
 
  714        $kind->addOption($option_user);
 
  716        $option_determination = 
new ilRadioOption($this->lng->txt(
'auth_automatic'), 1);
 
  718        include_once(
'Services/Authentication/classes/class.ilAuthUtils.php');
 
  720        $auth_sequenced = $det->getAuthModeSequence();
 
  722        foreach ($auth_sequenced as $auth_mode) {
 
  723            switch ($auth_mode) {
 
  732                    $text = $this->lng->txt(
'auth_radius');
 
  735                    $text = $this->lng->txt(
'auth_local');
 
  738                    $text = $this->lng->txt(
'auth_soap');
 
  741                    $text = $this->lng->txt(
'auth_apache');
 
  746                        $option = $pl->getMultipleAuthModeOptions($auth_mode);
 
  747                        $text = $option[$auth_mode][
'txt'];
 
  756            $pos->setMaxLength(1);
 
  757            $option_determination->addSubItem($pos);
 
  759        $kind->addOption($option_determination);
 
  760        $this->form->addItem($kind);
 
  772        include_once(
'Services/Authentication/classes/class.ilAuthModeDetermination.php');
 
  775        $det->setKind((
int) 
$_POST[
'kind']);
 
  777        $pos = 
$_POST[
'position'] ? 
$_POST[
'position'] : array();
 
  778        asort($pos, SORT_NUMERIC);
 
  781        foreach ($pos as $auth_mode => $dummy) {
 
  784        $det->setAuthModeSequence($position ? $position : array());
 
  787        require_once 
'Services/Captcha/classes/class.ilCaptchaUtil.php';
 
  788        ilCaptchaUtil::setActiveForLogin((
bool) 
$_POST[
'activate_captcha_anonym']);
 
  804        $next_class = $this->ctrl->getNextClass($this);
 
  805        $cmd = $this->ctrl->getCmd();
 
  809        if (!$ilAccess->checkAccess(
'read', 
'', $this->object->getRefId())) {
 
  810            $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), 
$ilErr->WARNING);
 
  813        switch ($next_class) {
 
  814            case 'ilsamlsettingsgui':
 
  815                $this->tabs_gui->setTabActive(
'auth_saml');
 
  817                require_once 
'./Services/Saml/classes/class.ilSamlSettingsGUI.php';
 
  819                $this->ctrl->forwardCommand($os);
 
  822            case 'ilregistrationsettingsgui':
 
  824                include_once 
'./Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
 
  827                $this->tabs_gui->setTabActive(
'registration_settings');
 
  829                $this->ctrl->forwardCommand($registration_gui);
 
  832            case 'ilpermissiongui':
 
  835                $this->tabs_gui->setTabActive(
'perm_settings');
 
  837                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  839                $ret =&$this->ctrl->forwardCommand($perm_gui);
 
  842            case 'illdapsettingsgui':
 
  845                $this->tabs_gui->setTabActive(
'auth_ldap');
 
  847                include_once 
'./Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
 
  849                $this->ctrl->forwardCommand($ldap_settings_gui);
 
  852            case 'ilauthshibbolethsettingsgui':
 
  854                $this->tabs_gui->setTabActive(
'auth_shib');
 
  855                include_once(
'./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
 
  857                $this->ctrl->forwardCommand($shib_settings_gui);
 
  860            case 'ilcassettingsgui':
 
  862                $this->tabs_gui->setTabActive(
'auth_cas');
 
  863                include_once 
'./Services/CAS/classes/class.ilCASSettingsGUI.php';
 
  865                $this->ctrl->forwardCommand($cas_settings);
 
  868            case 'ilradiussettingsgui':
 
  870                $this->tabs_gui->setTabActive(
'auth_radius');
 
  871                include_once 
'./Services/Radius/classes/class.ilRadiusSettingsGUI.php';
 
  873                $this->ctrl->forwardCommand($radius_settings_gui);
 
  877            case 'ilauthloginpageeditorgui':
 
  880                $this->tabs_gui->setTabActive(
'authentication_settings');
 
  881                $this->tabs_gui->setSubTabActive(
"auth_login_editor");
 
  883                include_once 
'./Services/Authentication/classes/class.ilAuthLoginPageEditorGUI.php';
 
  885                $this->ctrl->forwardCommand($lpe);
 
  890                    $cmd = 
"authSettings";
 
  914        $this->ctrl->setParameter($this, 
"ref_id", $this->object->getRefId());
 
  916        if (
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
 
  917            $this->tabs_gui->addTarget(
 
  918                "authentication_settings",
 
  919                $this->ctrl->getLinkTarget($this, 
"authSettings"),
 
  925            $this->tabs_gui->addTarget(
 
  926                'registration_settings',
 
  927                $this->ctrl->getLinkTargetByClass(
'ilregistrationsettingsgui', 
'view')
 
  930            $this->tabs_gui->addTarget(
 
  932                $this->ctrl->getLinkTargetByClass(
'illdapsettingsgui', 
'serverList'),
 
  939            #$this->tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
 
  942            $this->tabs_gui->addTarget(
'auth_shib', $this->ctrl->getLinkTargetByClass(
'ilauthshibbolethsettingsgui', 
'settings'));
 
  944            $this->tabs_gui->addTarget(
 
  946                $this->ctrl->getLinkTargetByClass(
'ilcassettingsgui', 
'settings')
 
  949            $this->tabs_gui->addTarget(
 
  951                $this->ctrl->getLinkTargetByClass(
'ilradiussettingsgui', 
"settings"),
 
  957            $this->tabs_gui->addTarget(
 
  959                $this->ctrl->getLinkTarget($this, 
"editSOAP"),
 
  965            $this->tabs_gui->addTarget(
 
  966                "apache_auth_settings",
 
  967                $this->ctrl->getLinkTarget($this, 
'apacheAuthSettings'),
 
  973            require_once 
'Services/Saml/classes/class.ilSamlSettingsGUI.php';
 
  974            $this->tabs_gui->addTarget(
 
  983        if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
 
  984            $this->tabs_gui->addTarget(
 
  986                $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"),
 
  987                array(
"perm",
"info",
"owner"),
 
 1000        $GLOBALS[
'lng']->loadLanguageModule(
'auth');
 
 1003            case 'authSettings':
 
 1004                if ($ilAccess->checkAccess(
'write', 
'', $this->object->getRefId())) {
 
 1005                    $this->tabs_gui->addSubTabTarget(
 
 1007                        $this->ctrl->getLinkTarget($this, 
'authSettings'),
 
 1011                if ($ilAccess->checkAccess(
'write', 
'', $this->object->getRefId())) {
 
 1012                    $this->tabs_gui->addSubTabTarget(
 
 1013                        'auth_login_editor',
 
 1014                        $this->ctrl->getLinkTargetByClass(
'ilauthloginpageeditorgui', 
''),
 
 1027        $this->tabs_gui->setTabActive(
"apache_auth_settings");
 
 1035            $path = ILIAS_DATA_DIR . 
'/' . CLIENT_ID . 
'/apache_auth_allowed_domains.txt';
 
 1036            if (file_exists(
$path) && is_readable(
$path)) {
 
 1037                $settingsMap[
'apache_auth_domains'] = file_get_contents(
$path);
 
 1040            $form->setValuesByArray($settingsMap);
 
 1042        $tpl->setVariable(
'ADM_CONTENT', 
$form->getHtml());
 
 1049        $form->setValuesByPost();
 
 1053        if (
$form->checkInput()) {
 
 1056                'apache_auth_indicator_name', 
'apache_auth_indicator_value',
 
 1057                'apache_enable_auth', 
'apache_enable_local', 
'apache_local_autocreate',
 
 1058                'apache_enable_ldap', 
'apache_auth_username_config_type',
 
 1059                'apache_auth_username_direct_mapping_fieldname',
 
 1060                'apache_default_role', 
'apache_auth_target_override_login_page',
 
 1061                'apache_auth_enable_override_login_page',
 
 1062                'apache_auth_authenticate_on_login_page',
 
 1067            foreach ($fields as $field) {
 
 1071            if (
$form->getInput(
'apache_enable_auth')) {
 
 1072                $this->
ilias->setSetting(
'apache_active', 
true);
 
 1074                $this->
ilias->setSetting(
'apache_active', 
false);
 
 1082            file_put_contents(ILIAS_DATA_DIR . 
'/' . CLIENT_ID . 
'/apache_auth_allowed_domains.txt', $allowedDomains);
 
 1085            $this->ctrl->redirect($this, 
'apacheAuthSettings');
 
 1093        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1096        $form->setFormAction($this->ctrl->getFormAction($this));
 
 1097        $form->setTitle($this->lng->txt(
'apache_settings'));
 
 1099        $chb_enabled = 
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_auth'), 
'apache_enable_auth');
 
 1100        $form->addItem($chb_enabled);
 
 1102        $chb_local_create_account = 
new ilCheckboxInputGUI($this->lng->txt(
'apache_autocreate'), 
'apache_local_autocreate');
 
 1103        $chb_enabled->addSubitem($chb_local_create_account);
 
 1107        $select = 
new ilSelectInputGUI($this->lng->txt(
'apache_default_role'), 
'apache_default_role');
 
 1108        $roleOptions = array();
 
 1109        foreach ($roles as $role) {
 
 1112        $select->setOptions($roleOptions);
 
 1113        $select->setValue(4);
 
 1115        $chb_local_create_account->addSubitem($select);
 
 1117        $chb_local = 
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_local'), 
'apache_enable_local');
 
 1118        $form->addItem($chb_local);
 
 1120        $chb_ldap = 
new ilCheckboxInputGUI($this->lng->txt(
'apache_enable_ldap'), 
'apache_enable_ldap');
 
 1121        $chb_ldap->setInfo($this->lng->txt(
'apache_ldap_hint_ldap_must_be_configured'));
 
 1123        $GLOBALS[
'lng']->loadLanguageModule(
'auth');
 
 1124        include_once 
'./Services/LDAP/classes/class.ilLDAPServer.php';
 
 1126        if (count($servers)) {
 
 1127            $ldap_server_select = 
new ilSelectInputGUI($this->lng->txt(
'auth_ldap_server_ds'), 
'apache_ldap_sid');
 
 1128            $options[0] = $this->lng->txt(
'select_one');
 
 1129            foreach ($servers as $server_id) {
 
 1131                $options[$server_id] = $ldap_server->getName();
 
 1133            $ldap_server_select->setOptions(
$options);
 
 1134            $ldap_server_select->setRequired(
true);
 
 1137            $ldap_server_select->setValue($ds);
 
 1139            $chb_ldap->addSubItem($ldap_server_select);
 
 1141        $form->addItem($chb_ldap);
 
 1143        $txt = 
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_name'), 
'apache_auth_indicator_name');
 
 1144        $txt->setRequired(
true);
 
 1147        $txt = 
new ilTextInputGUI($this->lng->txt(
'apache_auth_indicator_value'), 
'apache_auth_indicator_value');
 
 1148        $txt->setRequired(
true);
 
 1152        $chb = 
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_enable_override_login'), 
'apache_auth_enable_override_login_page');
 
 1153        $form->addItem($chb);
 
 1155        $txt = 
new ilTextInputGUI($this->lng->txt(
'apache_auth_target_override_login'), 
'apache_auth_target_override_login_page');
 
 1156        $txt->setRequired(
true);
 
 1157        $chb->addSubItem(
$txt);
 
 1159        $chb = 
new ilCheckboxInputGUI($this->lng->txt(
'apache_auth_authenticate_on_login_page'), 
'apache_auth_authenticate_on_login_page');
 
 1160        $form->addItem($chb);
 
 1163        $sec->setTitle($this->lng->txt(
'apache_auth_username_config'));
 
 1164        $form->addItem($sec);
 
 1166        $rag = 
new ilRadioGroupInputGUI($this->lng->txt(
'apache_auth_username_config_type'), 
'apache_auth_username_config_type');
 
 1167        $form->addItem($rag);
 
 1169        $rao = 
new ilRadioOption($this->lng->txt(
'apache_auth_username_direct_mapping'), 1);
 
 1170        $rag->addOption($rao);
 
 1172        $txt = 
new ilTextInputGUI($this->lng->txt(
'apache_auth_username_direct_mapping_fieldname'), 
'apache_auth_username_direct_mapping_fieldname');
 
 1174        $rao->addSubItem(
$txt);
 
 1176        $rao = 
new ilRadioOption($this->lng->txt(
'apache_auth_username_extended_mapping'), 2);
 
 1177        $rao->setDisabled(
true);
 
 1178        $rag->addOption($rao);
 
 1180        $rao = 
new ilRadioOption($this->lng->txt(
'apache_auth_username_by_function'), 3);
 
 1181        $rag->addOption($rao);
 
 1187        $sec->setTitle($this->lng->txt(
'apache_auth_security'));
 
 1188        $form->addItem($sec);
 
 1191        $txt->setInfo($this->lng->txt(
'apache_auth_domains_description'));
 
 1195        $form->addCommandButton(
'saveApacheSettings', $this->lng->txt(
'save'));
 
 1196        $form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
 1203        return join(
"\n", preg_split(
"/[\r\n]+/", 
$text));
 
 1212        switch ($a_form_id) {
 
 1214                require_once 
'Services/Captcha/classes/class.ilCaptchaUtil.php';
 
 1219                return array(
'authentication_settings' => array(
'authSettings', $fields));
 
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
Login page editor settings GUI ILIAS page editor or richtext editor.
static _getInstance()
Get instance.
Class ilAuthShibbolethSettingsGUI.
static _getActiveAuthModes()
static getAuthPlugins()
Get active enabled auth plugins.
static _getAllAuthModes()
static _getAuthModeName($a_auth_key)
static checkFreetype()
Check whether captcha support is active.
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
static getDataSource($a_auth_mode)
static getInstanceByServerId($a_server_id)
Get instance by server id.
static isAuthModeLDAP($a_auth_mode)
Check if user auth mode is LDAP.
static getServerIds()
Get all server ids @global ilDB $ilDB.
Class ilObjAuthSettingsGUI.
validateApacheAuthAllowedDomains($text)
getAdminTabs()
administration tabs show only permissions and trash folder
setSubTabs($a_tab)
set sub tabs
addToExternalSettingsForm($a_form_id)
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor @access public.
saveScriptObject()
validates all input data, save them to database if correct and active chosen auth mode
getApacheAuthSettingsForm()
updateAuthModeDeterminationObject()
update auth mode determination
loginInfoObject()
displays login information of all installed languages
executeCommand()
Execute command.
apacheAuthSettingsObject($form=false)
getAuthModeTitle()
get the title of auth mode
saveApacheSettingsObject()
editSOAPObject()
Configure soap settings.
cancelObject()
cancel action and go back to previous page @access public
authSettingsObject()
display settings menu
viewObject()
list childs of current object
testSoapAuthConnectionObject()
initAuthModeDetermination()
init auth mode determinitation form
saveSOAPObject()
validates all input data, save them to database if correct and active chosen auth mode
getTabs()
get tabs @access public
editScriptObject()
Configure Custom settings.
static _lookupRegisterAllowed()
get all roles that are activated in user registration
static _updateAuthMode($a_roles)
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
static _lookupTitle($a_id)
lookup object title
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
Class ilRegistrationSettingsGUI.
static testConnection($a_ext_uid, $a_soap_pw, $a_new_user)
Constructor @access public.
static getInstanceByIdpId($a_idp_id)
static getIdpIdByAuthMode($a_auth_mode)
static isAuthModeSaml($a_auth_mode)
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if($err=$client->getError()) $namespace
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
redirection script todo: (a better solution should control the processing via a xml file)
if(isset($_POST['submit'])) $form