more meta HTML

This commit is contained in:
Roland Gruber 2011-01-02 13:57:46 +00:00
parent 8dd56f91b7
commit f28f3c4d45
3 changed files with 43 additions and 77 deletions

View File

@ -317,11 +317,8 @@ $container->addElement($lamdaemonSettings, true);
$container->addElement(new htmlSpacer(null, '10px'), true); $container->addElement(new htmlSpacer(null, '10px'), true);
parseHtml(null, $container, array(), false, $tabindex, 'user');
// LAM Pro settings // LAM Pro settings
if (isLAMProVersion()) { if (isLAMProVersion()) {
$pwdMailContent = new htmlTable(); $pwdMailContent = new htmlTable();
$pwdMailFrom = new htmlTableExtendedInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550'); $pwdMailFrom = new htmlTableExtendedInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550');
@ -334,80 +331,49 @@ if (isLAMProVersion()) {
$pwdMailContent->addElement($pwdMailBody, true); $pwdMailContent->addElement($pwdMailBody, true);
$pwdMailFieldset = new htmlFieldset($pwdMailContent, _("Password mail settings"), '../../graphics/mailBig.png'); $pwdMailFieldset = new htmlFieldset($pwdMailContent, _("Password mail settings"), '../../graphics/mailBig.png');
parseHtml(null, $pwdMailFieldset, array(), true, $tabindex, 'config'); $container->addElement($pwdMailFieldset, true);
$container->addElement(new htmlSpacer(null, '10px'), true);
echo ("<br>\n");
} }
// security setings // security setings
echo ("<fieldset><legend><img align=\"middle\" src=\"../../graphics/security.png\" alt=\"security.png\"> " . _("Security settings") . "</legend><br>\n"); $securitySettingsContent = new htmlTable();
echo ("<table border=0>\n");
// login method // login method
echo ("<tr><td align=\"right\">". $loginOptions = array(
_("Login method") . " </td>". _('Fixed list') => LAMConfig::LOGIN_LIST,
"<td><select tabindex=\"$tabindex\" name=\"loginMethod\" onchange=\"configLoginMethodChanged()\">\n"); _('LDAP search') => LAMConfig::LOGIN_SEARCH
if ($conf->getLoginMethod() == LAMConfig::LOGIN_LIST) { );
echo("<option selected value=" . LAMConfig::LOGIN_LIST . ">" . _('Fixed list') . "</option>\n"); $loginSelect = new htmlTableExtendedSelect('loginMethod', $loginOptions, array($conf->getLoginMethod()), _("Login method"), '220');
} $loginSelect->setHasDescriptiveElements(true);
else { $loginSelect->setOnchangeEvent('configLoginMethodChanged()');
echo("<option value=" . LAMConfig::LOGIN_LIST . ">" . _('Fixed list') . "</option>\n"); $securitySettingsContent->addElement($loginSelect, true);
}
if ($conf->getLoginMethod() == LAMConfig::LOGIN_SEARCH) {
echo("<option selected value=" . LAMConfig::LOGIN_SEARCH . ">" . _('LDAP search') . "</option>\n");
}
else {
echo("<option value=" . LAMConfig::LOGIN_SEARCH . ">" . _('LDAP search') . "</option>\n");
}
echo ("</select></td>\n");
$tabindex++;
echo "<td>";
printHelpLink(getHelp('', '220'), '220');
echo "</td></tr>\n";
// admin list // admin list
$adminText = implode("\n", explode(";", $conf->get_Adminstring())); $adminText = implode("\n", explode(";", $conf->get_Adminstring()));
echo "<tr id=\"trAdminList\"><td align=\"right\">\n"; $adminTextInput = new htmlTableExtendedInputTextarea('admins', $adminText, '50', '3', _("List of valid users"), '207');
echo _("List of valid users") . " * </td>". $adminTextInput->setRequired(true);
"<td><textarea tabindex=\"$tabindex\" name=\"admins\" cols=75 rows=3>" . $adminText . "</textarea></td>\n"; $securitySettingsContent->addElement($adminTextInput, true);
echo "<td>"; // search suffix
printHelpLink(getHelp('', '207'), '207'); $searchSuffixInput = new htmlTableExtendedInputField(_("LDAP suffix"), 'loginSearchSuffix', $conf->getLoginSearchSuffix(), '221');
echo "</td></tr>\n"; $searchSuffixInput->setRequired(true);
$tabindex++; $securitySettingsContent->addElement($searchSuffixInput, true);
// login search suffix
echo "<tr id=\"trLoginSearchSuffix\"><td align=\"right\">\n";
echo _("LDAP suffix") . " * </td>".
"<td><input type=\"text\" tabindex=\"$tabindex\" name=\"loginSearchSuffix\" value=\"" . $conf->getLoginSearchSuffix() . "\" size=50></td>\n";
echo "<td>";
printHelpLink(getHelp('', '221'), '221');
echo "</td></tr>\n";
$tabindex++;
// login search filter // login search filter
echo "<tr id=\"trLoginSearchFilter\"><td align=\"right\">\n"; $searchFilterInput = new htmlTableExtendedInputField(_("LDAP filter"), 'loginSearchFilter', $conf->getLoginSearchFilter(), '221');
echo _("LDAP filter") . " * </td>". $searchFilterInput->setRequired(true);
"<td><input type=\"text\" tabindex=\"$tabindex\" name=\"loginSearchFilter\" value=\"" . $conf->getLoginSearchFilter() . "\" size=50></td>\n"; $securitySettingsContent->addElement($searchFilterInput, true);
echo "<td>"; $securitySettingsContent->addElement(new htmlSpacer(null, '10px'), true);
printHelpLink(getHelp('', '221'), '221');
echo "</td></tr>\n";
$tabindex++;
echo ("<tr><td colspan=3>&nbsp;</td></tr>\n");
// new password // new password
echo ("<tr><td align=\"right\"><font color=\"red\">". $password1 = new htmlTableExtendedInputField(_("New password"), 'passwd1', null, '212');
_("New password") . " </font></td>". $password1->setIsPassword(true);
"<td align=\"left\"><input tabindex=\"$tabindex\" type=\"password\" name=\"passwd1\"></td>\n"); $password2 = new htmlTableExtendedInputField(_("Reenter password"), 'passwd2');
$tabindex++; $password2->setIsPassword(true);
echo "<td rowspan=2>"; $securitySettingsContent->addElement($password1, true);
printHelpLink(getHelp('', '212'), '212'); $securitySettingsContent->addElement($password2, true);
echo "</td></tr>\n"; $securitySettings = new htmlFieldset($securitySettingsContent, _("Security settings"), '../../graphics/security.png');
// reenter password $container->addElement($securitySettings, true);
echo ("<tr><td align=\"right\"><font color=\"red\">". $container->addElement(new htmlSpacer(null, '10px'), true);
_("Reenter password") . " </font></td>".
"<td align=\"left\"><input tabindex=\"$tabindex\" type=\"password\" name=\"passwd2\"></td></tr>\n");
$tabindex++;
echo ("</table>\n");
echo ("</fieldset>\n");
echo ("<p>* = ". _("required") . "</p>"); $container->addElement(new htmlOutputText('*=' . _("required")), true);
parseHtml(null, $container, array(), false, $tabindex, 'user');
echo ("</div></div></form>\n"); echo ("</div></div></form>\n");
echo ("</body>\n"); echo ("</body>\n");

View File

@ -213,7 +213,7 @@ $modules = array_keys($options);
$_SESSION['conf_types'] = array(); $_SESSION['conf_types'] = array();
for ($i = 0; $i < sizeof($modules); $i++) { for ($i = 0; $i < sizeof($modules); $i++) {
if (sizeof($options[$modules[$i]]) < 1) continue; if (sizeof($options[$modules[$i]]) < 1) continue;
echo "<fieldset>\n"; echo "<fieldset class=\"ui-corner-all useredit\">\n";
$icon = ''; $icon = '';
$module = new $modules[$i]('none'); $module = new $modules[$i]('none');
$iconImage = $module->getIcon(); $iconImage = $module->getIcon();
@ -221,7 +221,7 @@ for ($i = 0; $i < sizeof($modules); $i++) {
$icon = '<img align="middle" src="../../graphics/' . $iconImage . '" alt="' . $iconImage . '"> '; $icon = '<img align="middle" src="../../graphics/' . $iconImage . '" alt="' . $iconImage . '"> ';
} }
echo "<legend>$icon<b>" . getModuleAlias($modules[$i], "none") . "</b></legend><br>\n"; echo "<legend>$icon<b>" . getModuleAlias($modules[$i], "none") . "</b></legend><br>\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']); $_SESSION['conf_types'] = array_merge($configTypes, $_SESSION['conf_types']);
echo "</fieldset>\n"; echo "</fieldset>\n";
echo "<br>"; echo "<br>";

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) 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 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 it under the terms of the GNU General Public License as published by
@ -120,14 +120,14 @@ function loginProfileChanged(element) {
function configLoginMethodChanged() { function configLoginMethodChanged() {
selectLoginMethod = document.getElementsByName('loginMethod')[0]; selectLoginMethod = document.getElementsByName('loginMethod')[0];
if ( selectLoginMethod.options[selectLoginMethod.selectedIndex].value == 'list' ) { if ( selectLoginMethod.options[selectLoginMethod.selectedIndex].value == 'list' ) {
document.getElementById('trAdminList').style.display = ''; jQuery('textarea[name=admins]').parent().parent().show();
document.getElementById('trLoginSearchSuffix').style.display = 'none'; jQuery('input[name=loginSearchSuffix]').parent().parent().hide();
document.getElementById('trLoginSearchFilter').style.display = 'none'; jQuery('input[name=loginSearchFilter]').parent().parent().hide();
} }
else { else {
document.getElementById('trAdminList').style.display = 'none'; jQuery('textarea[name=admins]').parent().parent().hide();
document.getElementById('trLoginSearchSuffix').style.display = ''; jQuery('input[name=loginSearchSuffix]').parent().parent().show();
document.getElementById('trLoginSearchFilter').style.display = ''; jQuery('input[name=loginSearchFilter]').parent().parent().show();
} }
} }