diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index f4323f47..2f1bfc50 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -317,11 +317,8 @@ $container->addElement($lamdaemonSettings, true); $container->addElement(new htmlSpacer(null, '10px'), true); -parseHtml(null, $container, array(), false, $tabindex, 'user'); - // LAM Pro settings if (isLAMProVersion()) { - $pwdMailContent = new htmlTable(); $pwdMailFrom = new htmlTableExtendedInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550'); @@ -334,80 +331,49 @@ if (isLAMProVersion()) { $pwdMailContent->addElement($pwdMailBody, true); $pwdMailFieldset = new htmlFieldset($pwdMailContent, _("Password mail settings"), '../../graphics/mailBig.png'); - parseHtml(null, $pwdMailFieldset, array(), true, $tabindex, 'config'); - - echo ("
\n"); + $container->addElement($pwdMailFieldset, true); + $container->addElement(new htmlSpacer(null, '10px'), true); } // security setings -echo ("
\"security.png\" " . _("Security settings") . "
\n"); -echo ("\n"); +$securitySettingsContent = new htmlTable(); // login method -echo ("". - "\n"); -$tabindex++; -echo "\n"; +$loginOptions = array( + _('Fixed list') => LAMConfig::LOGIN_LIST, + _('LDAP search') => LAMConfig::LOGIN_SEARCH +); +$loginSelect = new htmlTableExtendedSelect('loginMethod', $loginOptions, array($conf->getLoginMethod()), _("Login method"), '220'); +$loginSelect->setHasDescriptiveElements(true); +$loginSelect->setOnchangeEvent('configLoginMethodChanged()'); +$securitySettingsContent->addElement($loginSelect, true); // admin list $adminText = implode("\n", explode(";", $conf->get_Adminstring())); -echo "". - "\n"; -echo "\n"; -$tabindex++; -// login search suffix -echo "". - "\n"; -echo "\n"; -$tabindex++; +$adminTextInput = new htmlTableExtendedInputTextarea('admins', $adminText, '50', '3', _("List of valid users"), '207'); +$adminTextInput->setRequired(true); +$securitySettingsContent->addElement($adminTextInput, true); +// search suffix +$searchSuffixInput = new htmlTableExtendedInputField(_("LDAP suffix"), 'loginSearchSuffix', $conf->getLoginSearchSuffix(), '221'); +$searchSuffixInput->setRequired(true); +$securitySettingsContent->addElement($searchSuffixInput, true); // login search filter -echo "". - "\n"; -echo "\n"; -$tabindex++; - -echo ("\n"); - +$searchFilterInput = new htmlTableExtendedInputField(_("LDAP filter"), 'loginSearchFilter', $conf->getLoginSearchFilter(), '221'); +$searchFilterInput->setRequired(true); +$securitySettingsContent->addElement($searchFilterInput, true); +$securitySettingsContent->addElement(new htmlSpacer(null, '10px'), true); // new password -echo ("". - "\n"); -$tabindex++; -echo "\n"; -// reenter password -echo ("". - "\n"); -$tabindex++; -echo ("
". - _("Login method") . " "; -printHelpLink(getHelp('', '220'), '220'); -echo "
\n"; -echo _("List of valid users") . " * "; -printHelpLink(getHelp('', '207'), '207'); -echo "
\n"; -echo _("LDAP suffix") . " * getLoginSearchSuffix() . "\" size=50>"; -printHelpLink(getHelp('', '221'), '221'); -echo "
\n"; -echo _("LDAP filter") . " * getLoginSearchFilter() . "\" size=50>"; -printHelpLink(getHelp('', '221'), '221'); -echo "
 
". - _("New password") . " "; -printHelpLink(getHelp('', '212'), '212'); -echo "
". - _("Reenter password") . "
\n"); -echo ("
\n"); +$password1 = new htmlTableExtendedInputField(_("New password"), 'passwd1', null, '212'); +$password1->setIsPassword(true); +$password2 = new htmlTableExtendedInputField(_("Reenter password"), 'passwd2'); +$password2->setIsPassword(true); +$securitySettingsContent->addElement($password1, true); +$securitySettingsContent->addElement($password2, true); +$securitySettings = new htmlFieldset($securitySettingsContent, _("Security settings"), '../../graphics/security.png'); +$container->addElement($securitySettings, true); +$container->addElement(new htmlSpacer(null, '10px'), true); -echo ("

* = ". _("required") . "

"); +$container->addElement(new htmlOutputText('*=' . _("required")), true); + +parseHtml(null, $container, array(), false, $tabindex, 'user'); echo ("\n"); echo ("\n"); diff --git a/lam/templates/config/moduleSettings.php b/lam/templates/config/moduleSettings.php index 8891ede0..d956d56e 100644 --- a/lam/templates/config/moduleSettings.php +++ b/lam/templates/config/moduleSettings.php @@ -213,7 +213,7 @@ $modules = array_keys($options); $_SESSION['conf_types'] = array(); for ($i = 0; $i < sizeof($modules); $i++) { if (sizeof($options[$modules[$i]]) < 1) continue; - echo "
\n"; + echo "
\n"; $icon = ''; $module = new $modules[$i]('none'); $iconImage = $module->getIcon(); @@ -221,7 +221,7 @@ for ($i = 0; $i < sizeof($modules); $i++) { $icon = '' . $iconImage . ' '; } echo "$icon" . getModuleAlias($modules[$i], "none") . "
\n"; - $configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, true, $tabindex, 'config'); + $configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, true, $tabindex, 'user'); $_SESSION['conf_types'] = array_merge($configTypes, $_SESSION['conf_types']); echo "
\n"; echo "
"; diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index 97a326e2..09ac4ef1 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2003 - 2010 Roland Gruber + Copyright (C) 2003 - 2011 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -120,14 +120,14 @@ function loginProfileChanged(element) { function configLoginMethodChanged() { selectLoginMethod = document.getElementsByName('loginMethod')[0]; if ( selectLoginMethod.options[selectLoginMethod.selectedIndex].value == 'list' ) { - document.getElementById('trAdminList').style.display = ''; - document.getElementById('trLoginSearchSuffix').style.display = 'none'; - document.getElementById('trLoginSearchFilter').style.display = 'none'; + jQuery('textarea[name=admins]').parent().parent().show(); + jQuery('input[name=loginSearchSuffix]').parent().parent().hide(); + jQuery('input[name=loginSearchFilter]').parent().parent().hide(); } else { - document.getElementById('trAdminList').style.display = 'none'; - document.getElementById('trLoginSearchSuffix').style.display = ''; - document.getElementById('trLoginSearchFilter').style.display = ''; + jQuery('textarea[name=admins]').parent().parent().hide(); + jQuery('input[name=loginSearchSuffix]').parent().parent().show(); + jQuery('input[name=loginSearchFilter]').parent().parent().show(); } }