From ad60e9fd1aa6c203ff87b207bef100f8152430d4 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 23 Apr 2003 07:33:18 +0000 Subject: [PATCH] updated options --- lam/tests/conf-test.php | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/lam/tests/conf-test.php b/lam/tests/conf-test.php index d3f51a62..b4eff876 100644 --- a/lam/tests/conf-test.php +++ b/lam/tests/conf-test.php @@ -20,7 +20,7 @@ $Id$ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA This test reads all preferences from lam.conf. Then it writes new values and verifies - if they were written. At last the old values are restored. + if they were written. At last the old values are restored. */ include ("../config/config.php"); @@ -30,9 +30,7 @@ $conf->printconf(); echo ("

Starting Test...

"); // now all prferences are loaded echo ("Loading preferences..."); -$SSL = $conf->get_SSL(); -$Host = $conf->get_Host(); -$Port = $conf->get_Port(); +$ServerURL = $conf->get_ServerURL(); $Admins = $conf->get_Admins(); $Passwd = $conf->get_Passwd(); $Adminstring = $conf->get_Adminstring(); @@ -45,18 +43,13 @@ $MinGID = $conf->get_minGID(); $MaxGID = $conf->get_maxGID(); $MinMachine = $conf->get_minMachine(); $MaxMachine = $conf->get_maxMachine(); -$DefaultShell = $conf->get_defaultShell(); -$ShellList = $conf->get_shellList(); $userlistAttributes = $conf->get_userlistAttributes(); $grouplistAttributes = $conf->get_grouplistAttributes(); $hostlistAttributes = $conf->get_hostlistAttributes(); echo ("done
"); // next we modify them and save lam.conf echo ("Changing preferences..."); -if ($conf->get_SSL == "True") $conf->set_SSL("False"); -else $conf->set_SSL("True"); -$conf->set_Host("ldap://test.org"); -$conf->set_Port("11223344"); +$conf->set_ServerURL("ldap://123.345.678.123:777"); $conf->set_Admins(array("uid=test,o=test,dc=org","uid=root,o=test2,c=de")); $conf->set_Passwd("123456abcde"); $conf->set_Adminstring("uid=test,o=test,dc=org;uid=root,o=test2,c=de"); @@ -69,8 +62,6 @@ $conf->set_minGID("253"); $conf->set_maxGID("1234"); $conf->set_minMachine("3"); $conf->set_maxMachine("47"); -$conf->set_defaultShell("/usr/bin/test"); -$conf->set_shellList("/usr/bin/test;/usr/bin/false"); $conf->set_userlistAttributes("#uid;#cn"); $conf->set_grouplistAttributes("#gidNumber;#cn;#memberUID"); $conf->set_hostlistAttributes("#cn;#uid;#description"); @@ -79,9 +70,7 @@ echo ("done
"); // at last all preferences are read from lam.conf and compared echo ("Loading and comparing..."); $conf = new Config(); -if ($conf->get_SSL() == $SSL) echo ("
Saving SSL failed!
"); -if ($conf->get_Host() != "ldap://test.org") echo ("
Saving host failed!
"); -if ($conf->get_Port() != "11223344") echo ("
Saving port failed!
"); +if ($conf->get_ServerURL() != "ldap://123.345.678.123:777") echo ("
Saving ServerURL failed!
"); $adm_arr = $conf->get_Admins(); if ($adm_arr[0] != "uid=test,o=test,dc=org") echo ("
Saving admins failed!" . $adm_arr[0] . "
"); if ($adm_arr[1] != "uid=root,o=test2,c=de") echo ("
Saving admins failed!
"); @@ -96,17 +85,13 @@ if ($conf->get_minGID() != "253") echo ("
Saving minG if ($conf->get_maxGID() != "1234") echo ("
Saving maxGID failed!
"); if ($conf->get_minMachine() != "3") echo ("
Saving maxMachine failed!
"); if ($conf->get_maxMachine() != "47") echo ("
Saving minMachine failed!
"); -if ($conf->get_defaultShell() != "/usr/bin/test") echo ("
Saving default shell failed!
"); -if ($conf->get_shellList() != "/usr/bin/test;/usr/bin/false") echo ("
Saving shellList failed!
"); if ($conf->get_userlistAttributes() != "#uid;#cn") echo ("
Saving userlistAttributes failed!
"); if ($conf->get_grouplistAttributes() != "#gidNumber;#cn;#memberUID") echo ("
Saving grouplistAttributes failed!
"); if ($conf->get_hostlistAttributes() != "#cn;#uid;#description") echo ("
Saving hostlistAttributes failed!
"); echo ("done
"); // restore old values echo ("Restoring old preferences..."); -$conf->set_SSL($SSL); -$conf->set_Host($Host); -$conf->set_Port($Port); +$conf->set_ServerURL($ServerURL); $conf->set_Admins($Admins); $conf->set_Passwd($Passwd); $conf->set_Adminstring($Adminstring); @@ -119,8 +104,6 @@ $conf->set_minGID($MinGID); $conf->set_maxGID($MaxGID); $conf->set_minMachine($MinMachine); $conf->set_maxMachine($MaxMachine); -$conf->set_defaultShell($DefaultShell); -$conf->set_shellList($ShellList); $conf->set_userlistAttributes($userlistAttributes); $conf->set_grouplistAttributes($grouplistAttributes); $conf->set_hostlistAttributes($hostlistAttributes); @@ -131,4 +114,4 @@ echo ("
Test is complete."); echo ("

Current Config

"); $conf->printconf(); -?> +?>