From 28329f0dc52dcb94db345e808bfd0ea2cd4fd621 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 4 Jan 2007 20:05:12 +0000 Subject: [PATCH] use textarea for admin list --- lam/help/help.inc | 2 +- lam/templates/config/confmain.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lam/help/help.inc b/lam/help/help.inc index 6d6fece5..6d43cf01 100644 --- a/lam/help/help.inc +++ b/lam/help/help.inc @@ -85,7 +85,7 @@ $helpArray = array ( _("Example") . ": #homeDirectory;#uid;#uidNumber;#gidNumber;mail:Mail address

" . "
" . _("Predefined values") . ":


" . $entry206Example), "207" => array ("ext" => "FALSE", "Headline" => _("Configuration wizard") . " - " . _("Valid users"), - "Text" => _("This is a list of valid DN entries of all users that are allowed to login to LDAP Account Manager. The user names have to be separated by semicolons.") . + "Text" => _("This is a list of valid DN entries of all users that are allowed to login to LDAP Account Manager. Please enter one DN per line.") . "

" . _("Example") . ": cn=admin,dc=yourdomain,dc=org;cn=manager,dc=yourdomain,dc=org"), diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index ed3f7430..3d3b8bd7 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -344,9 +344,10 @@ echo ("

\n"); echo ("
" . _("Security settings") . "\n"); echo ("\n"); // admin list +$adminText = implode("\n", explode(";", $conf->get_Adminstring())); echo ("". - "\n"); + "\n"); echo "
". _("List of valid users") . " *: get_Adminstring() . "\">"; echo ""; echo "\"""; @@ -427,7 +428,14 @@ function saveSettings() { if (!$conf->set_cacheTimeout($_POST['cachetimeout'])) { $errors[] = array("ERROR", _("Cache timeout is invalid!")); } - if (!$conf->set_Adminstring($_POST['admins'])) { + $adminText = $_POST['admins']; + $adminText = explode("\n", $adminText); + $adminTextNew = array(); + for ($i = 0; $i < sizeof($adminText); $i++) { + if (trim($adminText[$i]) == "") continue; + $adminTextNew[] = trim($adminText[$i]); + } + if (!$conf->set_Adminstring(implode(";", $adminTextNew))) { $errors[] = array("ERROR", _("List of admin users is empty or invalid!")); } if (!$conf->set_Suffix("tree", $_POST['sufftree'])) {