diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 2edaed53..a8b8d21b 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -133,7 +133,7 @@ class Config { var $samba3; // LDAP cache timeout - var $cache_timeout; + var $cachetimeout; // name of configuration file var $file; @@ -151,7 +151,7 @@ class Config { // reloads preferences from config file function reload() { // list of all settings in config file - $settings = array("ServerURL", "Passwd", "Admins", "usersuffix", "groupsuffix", "hostsuffix", + $settings = array("ServerURL", "Passwd", "Adminstring", "usersuffix", "groupsuffix", "hostsuffix", "domainsuffix", "minuid", "maxuid", "mingid", "maxgid", "minmachine", "maxmachine", "userlistattributes", "grouplistattributes", "hostlistattributes", "maxlistentries", "defaultlanguage", "scriptpath", "scriptServer", "samba3", "cachetimeout"); @@ -249,7 +249,7 @@ class Config { continue; } if (strtolower(substr($line, 0, 14)) == "cachetimeout: ") { - $this->cache_timeout = chop(substr($line, 14, strlen($line)-14)); + $this->cachetimeout = chop(substr($line, 14, strlen($line)-14)); continue; } } @@ -386,7 +386,7 @@ class Config { continue; } if (strtolower(substr($file_array[$i], 0, 14)) == "cachetimeout: ") { - $file_array[$i] = "cacheTimeout: " . $this->cache_timeout . "\n"; + $file_array[$i] = "cacheTimeout: " . $this->cachetimeout . "\n"; $save_cachetime = True; continue; } @@ -422,7 +422,7 @@ class Config { if (!$save_scriptPath == True) array_push($file_array, "\n\n# Path to external Script\n" . "scriptPath: " . $this->scriptPath . "\n"); if (!$save_scriptServer == True) array_push($file_array, "\n\n# Server of external Script\n" . "scriptServer: " . $this->scriptServer . "\n"); if (!$save_samba3 == True) array_push($file_array, "\n\n# Set to \"yes\" only if you use the new Samba 3.x schema.\n" . "samba3: " . $this->samba3 . "\n"); - if (!$save_cachetime == True) array_push($file_array, "\n\n# Number of minutes LAM caches LDAP searches.\n" . "cacheTimeout: " . $this->cache_timeout . "\n"); + if (!$save_cachetime == True) array_push($file_array, "\n\n# Number of minutes LAM caches LDAP searches.\n" . "cacheTimeout: " . $this->cachetimeout . "\n"); $file = fopen($conffile, "w"); if ($file) { for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]); @@ -438,7 +438,7 @@ class Config { // prints current preferences function printconf() { echo "" . _("Server address") . ": " . $this->ServerURL . "
"; - echo "" . _("Cache timeout") . ": " . $this->cache_timeout . "
"; + echo "" . _("Cache timeout") . ": " . $this->cachetimeout . "
"; echo "" . _("Samba 3.x schema") . ": " . $this->samba3 . "
"; echo "" . _("UserSuffix") . ": " . $this->Suff_users . "
"; echo "" . _("GroupSuffix") . ": " . $this->Suff_groups . "
"; @@ -752,18 +752,18 @@ class Config { // returns the LDAP cache timeout in minutes function get_cacheTimeout() { - return $this->cache_timeout; + return $this->cachetimeout; } // returns the LDAP cache timeout in seconds function get_cacheTimeoutSec() { - return $this->cache_timeout * 60; + return $this->cachetimeout * 60; } // sets the LDAP cache timeout in minutes function set_cacheTimeout($value) { if (is_numeric($value) && ($value > -1)) { - $this->cache_timeout = $value; + $this->cachetimeout = $value; } else return false; return true; diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index aad6fd59..d1d55696 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -42,7 +42,7 @@ if ($_POST['back'] || $_POST['submitconf']){ if ($_POST['passwd1']) $_SESSION['passwd1'] = $_POST['passwd1']; if ($_POST['passwd2']) $_SESSION['passwd2'] = $_POST['passwd2']; if ($_POST['serverurl']) $_SESSION['serverurl'] = $_POST['serverurl']; - if (isset($_POST['cache_timeout'])) $_SESSION['cache_timeout'] = $_POST['cache_timeout']; + if (isset($_POST['cachetimeout'])) $_SESSION['cachetimeout'] = $_POST['cachetimeout']; if ($_POST['admins']) $_SESSION['admins'] = $_POST['admins']; if ($_POST['suffusers']) $_SESSION['suffusers'] = $_POST['suffusers']; if ($_POST['suffgroups']) $_SESSION['suffgroups'] = $_POST['suffgroups']; @@ -148,7 +148,7 @@ echo (" "); // LDAP cache timeout echo ("". _("Cache timeout") . " *: ". - "\n\n"); if ($conf->get_cacheTimeout() != 0) echo("\n"); if ($conf->get_cacheTimeout() != 1) echo("\n"); if ($conf->get_cacheTimeout() != 2) echo("\n"); diff --git a/lam/templates/config/confsave.php b/lam/templates/config/confsave.php index 2a9d6e2c..37a2704f 100644 --- a/lam/templates/config/confsave.php +++ b/lam/templates/config/confsave.php @@ -38,7 +38,7 @@ if ($_SESSION['passwd']) $passwd = $_SESSION['passwd']; if ($_SESSION['passwd1']) $passwd1 = $_SESSION['passwd1']; if ($_SESSION['passwd2']) $passwd2 = $_SESSION['passwd2']; if ($_SESSION['serverurl']) $serverurl = $_SESSION['serverurl']; -if (isset($_SESSION['cache_timeout'])) $cache_timeout = $_SESSION['cache_timeout']; +if (isset($_SESSION['cachetimeout'])) $cachetimeout = $_SESSION['cachetimeout']; if ($_SESSION['admins']) $admins = $_SESSION['admins']; if ($_SESSION['suffusers']) $suffusers = $_SESSION['suffusers']; if ($_SESSION['suffgroups']) $suffgroups = $_SESSION['suffgroups']; @@ -82,7 +82,7 @@ if (!$serverurl) { echo ("\n


" . _("Back to preferences...") . ""); exit; } -if (!isset($cache_timeout) || !(is_numeric($cache_timeout)) || !($cache_timeout > -1)) { +if (!isset($cachetimeout) || !(is_numeric($cachetimeout)) || !($cachetimeout > -1)) { echo ("" . _("Cache timeout is empty!") . ""); echo ("\n


" . _("Back to preferences...") . ""); exit; @@ -189,7 +189,7 @@ if ($scriptserver && !is_string($scriptserver)) { // set new preferences $conf->set_ServerURL($serverurl); -$conf->set_cacheTimeout($cache_timeout); +$conf->set_cacheTimeout($cachetimeout); $conf->set_Adminstring($admins); $conf->set_UserSuffix($suffusers); $conf->set_GroupSuffix($suffgroups); @@ -235,7 +235,7 @@ unset($_SESSION['passwd']); unset($_SESSION['passwd1']); unset($_SESSION['passwd2']); unset($_SESSION['serverurl']); -unset($_SESSION['cache_timeout']); +unset($_SESSION['cachetimeout']); unset($_SESSION['admins']); unset($_SESSION['suffusers']); unset($_SESSION['suffgroups']); diff --git a/lam/tests/conf-test.php b/lam/tests/conf-test.php index 20c82c8e..fc3d327f 100644 --- a/lam/tests/conf-test.php +++ b/lam/tests/conf-test.php @@ -32,7 +32,7 @@ echo ("

Starting Test...

"); // now all prferences are loaded echo ("Loading preferences..."); $ServerURL = $conf->get_ServerURL(); -$cache_timeout = $conf->get_cacheTimeout(); +$cachetimeout = $conf->get_cacheTimeout(); $Passwd = $conf->get_Passwd(); $Adminstring = $conf->get_Adminstring(); $Suff_users = $conf->get_UserSuffix(); @@ -109,7 +109,7 @@ echo ("done
"); // restore old values echo ("Restoring old preferences..."); $conf2->set_ServerURL($ServerURL); -$conf2->set_cacheTimeout($cache_timeout); +$conf2->set_cacheTimeout($cachetimeout); $conf2->set_Passwd($Passwd); $conf2->set_Adminstring($Adminstring); $conf2->set_UserSuffix($Suff_users);