renamed cache_timeout to cachetimeout for config update
This commit is contained in:
parent
f629cbcbfd
commit
fcb6f1473b
|
@ -133,7 +133,7 @@ class Config {
|
||||||
var $samba3;
|
var $samba3;
|
||||||
|
|
||||||
// LDAP cache timeout
|
// LDAP cache timeout
|
||||||
var $cache_timeout;
|
var $cachetimeout;
|
||||||
|
|
||||||
// name of configuration file
|
// name of configuration file
|
||||||
var $file;
|
var $file;
|
||||||
|
@ -151,7 +151,7 @@ class Config {
|
||||||
// reloads preferences from config file
|
// reloads preferences from config file
|
||||||
function reload() {
|
function reload() {
|
||||||
// list of all settings in config file
|
// 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",
|
"domainsuffix", "minuid", "maxuid", "mingid", "maxgid", "minmachine", "maxmachine",
|
||||||
"userlistattributes", "grouplistattributes", "hostlistattributes", "maxlistentries",
|
"userlistattributes", "grouplistattributes", "hostlistattributes", "maxlistentries",
|
||||||
"defaultlanguage", "scriptpath", "scriptServer", "samba3", "cachetimeout");
|
"defaultlanguage", "scriptpath", "scriptServer", "samba3", "cachetimeout");
|
||||||
|
@ -249,7 +249,7 @@ class Config {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strtolower(substr($line, 0, 14)) == "cachetimeout: ") {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ class Config {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strtolower(substr($file_array[$i], 0, 14)) == "cachetimeout: ") {
|
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;
|
$save_cachetime = True;
|
||||||
continue;
|
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_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_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_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");
|
$file = fopen($conffile, "w");
|
||||||
if ($file) {
|
if ($file) {
|
||||||
for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]);
|
for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]);
|
||||||
|
@ -438,7 +438,7 @@ class Config {
|
||||||
// prints current preferences
|
// prints current preferences
|
||||||
function printconf() {
|
function printconf() {
|
||||||
echo "<b>" . _("Server address") . ": </b>" . $this->ServerURL . "<br>";
|
echo "<b>" . _("Server address") . ": </b>" . $this->ServerURL . "<br>";
|
||||||
echo "<b>" . _("Cache timeout") . ": </b>" . $this->cache_timeout . "<br>";
|
echo "<b>" . _("Cache timeout") . ": </b>" . $this->cachetimeout . "<br>";
|
||||||
echo "<b>" . _("Samba 3.x schema") . ": </b>" . $this->samba3 . "<br>";
|
echo "<b>" . _("Samba 3.x schema") . ": </b>" . $this->samba3 . "<br>";
|
||||||
echo "<b>" . _("UserSuffix") . ": </b>" . $this->Suff_users . "<br>";
|
echo "<b>" . _("UserSuffix") . ": </b>" . $this->Suff_users . "<br>";
|
||||||
echo "<b>" . _("GroupSuffix") . ": </b>" . $this->Suff_groups . "<br>";
|
echo "<b>" . _("GroupSuffix") . ": </b>" . $this->Suff_groups . "<br>";
|
||||||
|
@ -752,18 +752,18 @@ class Config {
|
||||||
|
|
||||||
// returns the LDAP cache timeout in minutes
|
// returns the LDAP cache timeout in minutes
|
||||||
function get_cacheTimeout() {
|
function get_cacheTimeout() {
|
||||||
return $this->cache_timeout;
|
return $this->cachetimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns the LDAP cache timeout in seconds
|
// returns the LDAP cache timeout in seconds
|
||||||
function get_cacheTimeoutSec() {
|
function get_cacheTimeoutSec() {
|
||||||
return $this->cache_timeout * 60;
|
return $this->cachetimeout * 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sets the LDAP cache timeout in minutes
|
// sets the LDAP cache timeout in minutes
|
||||||
function set_cacheTimeout($value) {
|
function set_cacheTimeout($value) {
|
||||||
if (is_numeric($value) && ($value > -1)) {
|
if (is_numeric($value) && ($value > -1)) {
|
||||||
$this->cache_timeout = $value;
|
$this->cachetimeout = $value;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -42,7 +42,7 @@ if ($_POST['back'] || $_POST['submitconf']){
|
||||||
if ($_POST['passwd1']) $_SESSION['passwd1'] = $_POST['passwd1'];
|
if ($_POST['passwd1']) $_SESSION['passwd1'] = $_POST['passwd1'];
|
||||||
if ($_POST['passwd2']) $_SESSION['passwd2'] = $_POST['passwd2'];
|
if ($_POST['passwd2']) $_SESSION['passwd2'] = $_POST['passwd2'];
|
||||||
if ($_POST['serverurl']) $_SESSION['serverurl'] = $_POST['serverurl'];
|
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['admins']) $_SESSION['admins'] = $_POST['admins'];
|
||||||
if ($_POST['suffusers']) $_SESSION['suffusers'] = $_POST['suffusers'];
|
if ($_POST['suffusers']) $_SESSION['suffusers'] = $_POST['suffusers'];
|
||||||
if ($_POST['suffgroups']) $_SESSION['suffgroups'] = $_POST['suffgroups'];
|
if ($_POST['suffgroups']) $_SESSION['suffgroups'] = $_POST['suffgroups'];
|
||||||
|
@ -148,7 +148,7 @@ echo ("<tr><td colspan=3> </td></tr>");
|
||||||
// LDAP cache timeout
|
// LDAP cache timeout
|
||||||
echo ("<tr><td align=\"right\"><b>".
|
echo ("<tr><td align=\"right\"><b>".
|
||||||
_("Cache timeout") . " *: </b></td>".
|
_("Cache timeout") . " *: </b></td>".
|
||||||
"<td><select name=\"cache_timeout\">\n<option selected>".$conf->get_cacheTimeout()."</option>\n");
|
"<td><select name=\"cachetimeout\">\n<option selected>".$conf->get_cacheTimeout()."</option>\n");
|
||||||
if ($conf->get_cacheTimeout() != 0) echo("<option>0</option>\n");
|
if ($conf->get_cacheTimeout() != 0) echo("<option>0</option>\n");
|
||||||
if ($conf->get_cacheTimeout() != 1) echo("<option>1</option>\n");
|
if ($conf->get_cacheTimeout() != 1) echo("<option>1</option>\n");
|
||||||
if ($conf->get_cacheTimeout() != 2) echo("<option>2</option>\n");
|
if ($conf->get_cacheTimeout() != 2) echo("<option>2</option>\n");
|
||||||
|
|
|
@ -38,7 +38,7 @@ if ($_SESSION['passwd']) $passwd = $_SESSION['passwd'];
|
||||||
if ($_SESSION['passwd1']) $passwd1 = $_SESSION['passwd1'];
|
if ($_SESSION['passwd1']) $passwd1 = $_SESSION['passwd1'];
|
||||||
if ($_SESSION['passwd2']) $passwd2 = $_SESSION['passwd2'];
|
if ($_SESSION['passwd2']) $passwd2 = $_SESSION['passwd2'];
|
||||||
if ($_SESSION['serverurl']) $serverurl = $_SESSION['serverurl'];
|
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['admins']) $admins = $_SESSION['admins'];
|
||||||
if ($_SESSION['suffusers']) $suffusers = $_SESSION['suffusers'];
|
if ($_SESSION['suffusers']) $suffusers = $_SESSION['suffusers'];
|
||||||
if ($_SESSION['suffgroups']) $suffgroups = $_SESSION['suffgroups'];
|
if ($_SESSION['suffgroups']) $suffgroups = $_SESSION['suffgroups'];
|
||||||
|
@ -82,7 +82,7 @@ if (!$serverurl) {
|
||||||
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if (!isset($cache_timeout) || !(is_numeric($cache_timeout)) || !($cache_timeout > -1)) {
|
if (!isset($cachetimeout) || !(is_numeric($cachetimeout)) || !($cachetimeout > -1)) {
|
||||||
echo ("<font color=\"red\"><b>" . _("Cache timeout is empty!") . "</b></font>");
|
echo ("<font color=\"red\"><b>" . _("Cache timeout is empty!") . "</b></font>");
|
||||||
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
|
||||||
exit;
|
exit;
|
||||||
|
@ -189,7 +189,7 @@ if ($scriptserver && !is_string($scriptserver)) {
|
||||||
|
|
||||||
// set new preferences
|
// set new preferences
|
||||||
$conf->set_ServerURL($serverurl);
|
$conf->set_ServerURL($serverurl);
|
||||||
$conf->set_cacheTimeout($cache_timeout);
|
$conf->set_cacheTimeout($cachetimeout);
|
||||||
$conf->set_Adminstring($admins);
|
$conf->set_Adminstring($admins);
|
||||||
$conf->set_UserSuffix($suffusers);
|
$conf->set_UserSuffix($suffusers);
|
||||||
$conf->set_GroupSuffix($suffgroups);
|
$conf->set_GroupSuffix($suffgroups);
|
||||||
|
@ -235,7 +235,7 @@ unset($_SESSION['passwd']);
|
||||||
unset($_SESSION['passwd1']);
|
unset($_SESSION['passwd1']);
|
||||||
unset($_SESSION['passwd2']);
|
unset($_SESSION['passwd2']);
|
||||||
unset($_SESSION['serverurl']);
|
unset($_SESSION['serverurl']);
|
||||||
unset($_SESSION['cache_timeout']);
|
unset($_SESSION['cachetimeout']);
|
||||||
unset($_SESSION['admins']);
|
unset($_SESSION['admins']);
|
||||||
unset($_SESSION['suffusers']);
|
unset($_SESSION['suffusers']);
|
||||||
unset($_SESSION['suffgroups']);
|
unset($_SESSION['suffgroups']);
|
||||||
|
|
|
@ -32,7 +32,7 @@ echo ("<br><br><big><b> Starting Test...</b></big><br><br>");
|
||||||
// now all prferences are loaded
|
// now all prferences are loaded
|
||||||
echo ("Loading preferences...");
|
echo ("Loading preferences...");
|
||||||
$ServerURL = $conf->get_ServerURL();
|
$ServerURL = $conf->get_ServerURL();
|
||||||
$cache_timeout = $conf->get_cacheTimeout();
|
$cachetimeout = $conf->get_cacheTimeout();
|
||||||
$Passwd = $conf->get_Passwd();
|
$Passwd = $conf->get_Passwd();
|
||||||
$Adminstring = $conf->get_Adminstring();
|
$Adminstring = $conf->get_Adminstring();
|
||||||
$Suff_users = $conf->get_UserSuffix();
|
$Suff_users = $conf->get_UserSuffix();
|
||||||
|
@ -109,7 +109,7 @@ echo ("done<br>");
|
||||||
// restore old values
|
// restore old values
|
||||||
echo ("Restoring old preferences...");
|
echo ("Restoring old preferences...");
|
||||||
$conf2->set_ServerURL($ServerURL);
|
$conf2->set_ServerURL($ServerURL);
|
||||||
$conf2->set_cacheTimeout($cache_timeout);
|
$conf2->set_cacheTimeout($cachetimeout);
|
||||||
$conf2->set_Passwd($Passwd);
|
$conf2->set_Passwd($Passwd);
|
||||||
$conf2->set_Adminstring($Adminstring);
|
$conf2->set_Adminstring($Adminstring);
|
||||||
$conf2->set_UserSuffix($Suff_users);
|
$conf2->set_UserSuffix($Suff_users);
|
||||||
|
|
Loading…
Reference in New Issue