\n";
@@ -215,255 +218,106 @@ jQuery(document).ready(function() {
jQuery('#generalSettingsButton').addClass('ui-tabs-selected');
jQuery('#generalSettingsButton').addClass('ui-state-active');
jQuery('#generalSettingsButton').addClass('userlist-bright');
- jQuery('#saveButton').button({
- icons: {
- primary: 'saveButton'
- }
- });
- jQuery('#cancelButton').button({
- icons: {
- primary: 'cancelButton'
- }
- });
});
" . _("Server settings") . "\n");
-echo ("
");
-// serverURL
-echo ("" . _("Server address") . " * ".
- "".
- " get_ServerURL() . "\">".
- " \n");
-echo "";
-printHelpLink(getHelp('', '201'), '201');
-echo " \n";
-$tabindex++;
+$container = new htmlTable();
+
+$serverSettingsContent = new htmlTable();
+// server URL
+$urlInput = new htmlTableExtendedInputField(_("Server address"), 'serverurl', $conf->get_ServerURL(), '201');
+$urlInput->setRequired(true);
+$serverSettingsContent->addElement($urlInput, true);
// use TLS
-echo "" . _("Activate TLS") . " \n";
-echo "\n";
-echo "";
-$useTLS = $conf->getUseTLS();
-if (isset($useTLS) && ($useTLS == 'yes')) {
- echo "" . _("yes") . " ";
- echo "" . _("no") . " ";
-}
-else {
- echo "" . _("yes") . " ";
- echo "" . _("no") . " ";
-}
-echo " \n";
-echo " \n";
-echo "";
-printHelpLink(getHelp('', '201'), '201');
-echo " \n";
-$tabindex++;
-
-// new line
-echo (" ");
-
+$tlsOptions = array(_("yes") => 'yes', _("no") => 'no');
+$tlsSelect = new htmlTableExtendedSelect('useTLS', $tlsOptions, array($conf->getUseTLS()), _("Activate TLS"), '201');
+$tlsSelect->setHasDescriptiveElements(true);
+$serverSettingsContent->addElement($tlsSelect, true);
// tree suffix
-echo ("".
- _("Tree suffix") . " ".
- " get_Suffix('tree') . "\"> \n");
-echo "";
-printHelpLink(getHelp('', '203'), '203');
-echo " \n";
-$tabindex++;
-
-// new line
-echo (" ");
-
-// LDAP cache timeout
-/*echo ("".
- _("Cache timeout") . " ".
- "\n".$conf->get_cacheTimeout()." \n");
-if ($conf->get_cacheTimeout() != 0) echo("0 \n");
-if ($conf->get_cacheTimeout() != 1) echo("1 \n");
-if ($conf->get_cacheTimeout() != 2) echo("2 \n");
-if ($conf->get_cacheTimeout() != 5) echo("5 \n");
-if ($conf->get_cacheTimeout() != 10) echo("10 \n");
-if ($conf->get_cacheTimeout() != 15) echo("15 \n");
-echo (" \n");
-$tabindex++;
-echo "";
-printHelpLink(getHelp('', '214'), '214');
-echo " \n";*/
-
+$serverSettingsContent->addElement(new htmlTableExtendedInputField(_("Tree suffix"), 'sufftree', $conf->get_Suffix('tree'), '203'), true);
// LDAP search limit
$searchLimitOptions = array(
-array(0, '-'), array(100, 100), array(500, 500),
-array(1000, 1000), array(5000, 5000), array(10000, 10000),
-array(50000, 50000), array(100000, 100000)
-);
-echo ("".
- _("LDAP search limit") . " ".
- "\n");
-for ($i = 0; $i < sizeof($searchLimitOptions); $i++) {
- $selected = "";
- if ($searchLimitOptions[$i][0] == $conf->get_searchLimit()) {
- $selected = "selected";
- }
- echo "" . $searchLimitOptions[$i][1] . " ";
-}
-echo (" \n");
-$tabindex++;
-echo "";
-printHelpLink(getHelp('', '222'), '222');
-echo " \n";
-
+'-' => 0, 100 => 100, 500 => 500,
+1000 => 1000, 5000 => 5000, 10000 => 10000,
+50000 => 50000, 100000 => 100000);
+$limitSelect = new htmlTableExtendedSelect('searchLimit', $searchLimitOptions, array($conf->get_searchLimit()), _("LDAP search limit"), '222');
+$limitSelect->setHasDescriptiveElements(true);
+$serverSettingsContent->addElement($limitSelect, true);
// access level is only visible in Pro version
if (isLAMProVersion()) {
- // new line
- echo (" ");
-
- // access level
- echo ("".
- _("Access level") . " ".
- "\n");
- if ($conf->getAccessLevel() == LAMConfig::ACCESS_ALL) {
- echo("" . _('Write access') . " \n");
- }
- else {
- echo("" . _('Write access') . " \n");
- }
- if ($conf->getAccessLevel() == LAMConfig::ACCESS_PASSWORD_CHANGE) {
- echo("" . _('Change passwords') . " \n");
- }
- else {
- echo("" . _('Change passwords') . " \n");
- }
- if ($conf->getAccessLevel() == LAMConfig::ACCESS_READ_ONLY) {
- echo("" . _('Read only') . " \n");
- }
- else {
- echo("" . _('Read only') . " \n");
- }
- echo (" \n");
- $tabindex++;
- echo "";
- printHelpLink(getHelp('', '215'), '215');
- echo " \n";
+ $accessOptions = array(
+ _('Write access') => LAMConfig::ACCESS_ALL,
+ _('Change passwords') => LAMConfig::ACCESS_PASSWORD_CHANGE,
+ _('Read only') => LAMConfig::ACCESS_READ_ONLY
+ );
+ $accessSelect = new htmlTableExtendedSelect('accessLevel', $accessOptions, array($conf->getAccessLevel()), _("Access level"), '215');
+ $accessSelect->setHasDescriptiveElements(true);
+ $serverSettingsContent->addElement($accessSelect, true);
}
-
-echo ("
");
-echo ("");
-
-echo ("
");
-
-echo ("
" . _("Language settings") . " \n");
-echo ("\n");
+$serverSettings = new htmlFieldset($serverSettingsContent, _("Server settings"), '../../graphics/profiles.png');
+$container->addElement($serverSettings, true);
+$container->addElement(new htmlSpacer(null, '10px'), true);
// language
-echo ("");
-echo ("" . _("Default language") . " \n");
+$languageSettingsContent = new htmlTable();
// read available languages
$languagefile = "../../config/language";
-if(is_file($languagefile))
-{
+if(is_file($languagefile)) {
$file = fopen($languagefile, "r");
- $i = 0;
- while(!feof($file))
- {
+ while(!feof($file)) {
$line = fgets($file, 1024);
if($line == "\n" || $line[0] == "#" || $line == "") continue; // ignore comment and empty lines
- $languages[$i] = chop($line);
- $i++;
+ $line = chop($line);
+ $entry = explode(":", $line);
+ $languages[$entry[2]] = $line;
}
fclose($file);
-// generate language list
-echo ("");
-for ($i = 0; $i < sizeof($languages); $i++) {
- $entry = explode(":", $languages[$i]);
- if ($conf->get_defaultLanguage() != $languages[$i]) echo("" . $entry[2] . " \n");
- else echo("" . $entry[2] . " \n");
+ $languageSelect = new htmlTableExtendedSelect('lang', $languages, array($conf->get_defaultLanguage()), _("Default language"), '209');
+ $languageSelect->setHasDescriptiveElements(true);
+ $languageSettingsContent->addElement($languageSelect, true);
}
-echo (" \n");
-$tabindex++;
+else {
+ $languageSettingsContent->addElement(new htmlStatusMessage('ERROR', "Unable to load available languages. Setting English as default language."));
}
-else
-{
- echo _("Unable to load available languages. Setting English as default language. For further instructions please contact the Admin of this site.");
-}
-echo (" \n");
-echo "";
-printHelpLink(getHelp('', '209'), '209');
-echo " \n";
-
-echo ("
\n");
-echo ("\n");
-
-echo ("
\n");
+$languageSettings = new htmlFieldset($languageSettingsContent, _("Language settings"), '../../graphics/language.png');
+$container->addElement($languageSettings, true);
+$container->addElement(new htmlSpacer(null, '10px'), true);
// lamdaemon settings
-echo ("
" . _("Lamdaemon settings") . " \n");
-echo ("\n");
-
-echo ("".
- _("Server list") . " ".
- " get_scriptServers(false) . "\"> \n");
-$tabindex++;
-echo "";
-printHelpLink(getHelp('', '218'), '218');
-echo " \n";
-echo ("".
- _("Path to external script") . " ".
- " get_scriptPath() . "\"> \n");
-$tabindex++;
-echo "";
-printHelpLink(getHelp('', '210'), '210');
-echo " \n";
-echo "". _("Rights for the home directory") . " \n";
-$owr = "";
-$oww = "";
-$owe = "";
-$grr = "";
-$grw = "";
-$gre = "";
-$otr = "";
-$otw = "";
-$ote = "";
+$lamdaemonSettingsContent = new htmlTable();
+$lamdaemonSettingsContent->addElement(new htmlTableExtendedInputField(_("Server list"), 'scriptservers', $conf->get_scriptServers(), '218'), true);
+$lamdaemonSettingsContent->addElement(new htmlTableExtendedInputField(_("Path to external script"), 'scriptpath', $conf->get_scriptPath(), '210'), true);
+$lamdaemonSettingsContent->addElement(new htmlSpacer(null, '5px'), true);
+$lamdaemonSettingsContent->addElement(new htmlOutputText(_("Rights for the home directory")));
$chmod = $conf->get_scriptRights();
-if (checkChmod("read","owner", $chmod)) $owr = 'checked';
-if (checkChmod("write","owner", $chmod)) $oww = 'checked';
-if (checkChmod("execute","owner", $chmod)) $owe = 'checked';
-if (checkChmod("read","group", $chmod)) $grr = 'checked';
-if (checkChmod("write","group", $chmod)) $grw = 'checked';
-if (checkChmod("execute","group", $chmod)) $gre = 'checked';
-if (checkChmod("read","other", $chmod)) $otr = 'checked';
-if (checkChmod("write","other", $chmod)) $otw = 'checked';
-if (checkChmod("execute","other", $chmod)) $ote = 'checked';
+$rightsTable = new htmlTable();
+$rightsTable->addElement(new htmlOutputText(''));
+$rightsTable->addElement(new htmlOutputText(_("Read")));
+$rightsTable->addElement(new htmlOutputText(_("Write")));
+$rightsTable->addElement(new htmlOutputText(_("Execute")), true);
+$rightsTable->addElement(new htmlOutputText(_("Owner")));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_owr', checkChmod("read","owner", $chmod)));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_oww', checkChmod("write","owner", $chmod)));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_owe', checkChmod("execute","owner", $chmod)), true);
+$rightsTable->addElement(new htmlOutputText(_("Group")));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_grr', checkChmod("read","group", $chmod)));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_grw', checkChmod("write","group", $chmod)));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_gre', checkChmod("execute","group", $chmod)), true);
+$rightsTable->addElement(new htmlOutputText(_("Other")));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_otr', checkChmod("read","other", $chmod)));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_otw', checkChmod("write","other", $chmod)));
+$rightsTable->addElement(new htmlInputCheckbox('chmod_ote', checkChmod("execute","other", $chmod)), true);
+$lamdaemonSettingsContent->addElement($rightsTable);
+$lamdaemonSettingsContent->addElement(new htmlHelpLink('219'));
+$lamdaemonSettings = new htmlFieldset($lamdaemonSettingsContent, _("Lamdaemon settings"), '../../graphics/lamdaemon.png');
+$container->addElement($lamdaemonSettings, true);
+$container->addElement(new htmlSpacer(null, '10px'), true);
-echo "\n";
- echo "";
- $tabindex++;
-echo " ";
-printHelpLink(getHelp('', '219'), '219');
-echo " \n";
-echo ("
\n");
-echo ("\n");
-
-echo ("
\n");
+parseHtml(null, $container, array(), false, $tabindex, 'user');
// LAM Pro settings
if (isLAMProVersion()) {
diff --git a/lam/templates/config/confmodules.php b/lam/templates/config/confmodules.php
index de9d341b..647f2796 100644
--- a/lam/templates/config/confmodules.php
+++ b/lam/templates/config/confmodules.php
@@ -3,7 +3,7 @@
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
- Copyright (C) 2004 - 2010 Roland Gruber
+ Copyright (C) 2004 - 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
@@ -138,12 +138,15 @@ for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMe
echo ("