diff --git a/lam/help/help.inc b/lam/help/help.inc
index a9905bb1..83c48b49 100644
--- a/lam/help/help.inc
+++ b/lam/help/help.inc
@@ -100,6 +100,8 @@ $helpArray = array (
"
".
_("LAM will not work if version is wrong!").
""),
+ "214" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Cache timeout"),
+ "Text" => _("This is the time in minutes which LAM caches its LDAP searches. Shorter times will stress LDAP more but decrease the possibility that changes are not identified.")),
// 300 - 399
// Roland Gruber
// profile editor
diff --git a/lam/lib/config.inc b/lam/lib/config.inc
index 9f03e35b..7665f170 100644
--- a/lam/lib/config.inc
+++ b/lam/lib/config.inc
@@ -87,9 +87,6 @@ class Config {
// suffix for domains (Samba 3)
var $Suff_domains;
- // suffix for user/group mappings (Samba 3)
- //var $Suff_map;
-
// minimum/maximum numbers for UID, GID and UID of Samba Hosts
var $MinUID;
var $MaxUID;
@@ -117,6 +114,9 @@ class Config {
// if "yes" use the new LDAP schema for Samba 3.x
var $samba3;
+ // LDAP cache timeout
+ var $cache_timeout;
+
// name of configuration file
var $file;
@@ -169,10 +169,6 @@ class Config {
$this->Suff_domains = chop(substr($line, 14, strlen($line)-14));
continue;
}
-/* if (substr($line, 0, 11) == "mapsuffix: ") {
- $this->Suff_map = chop(substr($line, 11, strlen($line)-11));
- continue;
- }*/
if (substr($line, 0, 8) == "minUID: ") {
$this->MinUID = chop(substr($line, 8, strlen($line)-8));
continue;
@@ -229,6 +225,10 @@ class Config {
$this->samba3 = chop(substr($line, 8, strlen($line)-8));
continue;
}
+ if (substr($line, 0, 14) == "cacheTimeout: ") {
+ $this->cache_timeout = chop(substr($line, 14, strlen($line)-14));
+ continue;
+ }
}
fclose($file);
}
@@ -237,214 +237,212 @@ class Config {
}
}
- // saves preferences to config file
- function save() {
- $conffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/" . $this->file . ".conf";
- if (is_file($conffile) == True) {
- // booleans to check if value was already saved
- $save_serverURL = $save_passwd = $save_admins = $save_suffusr = $save_suffgrp = $save_suffhst =
- $save_minUID = $save_maxUID = $save_minGID = $save_maxGID = $save_minMach = $save_maxMach =
- $save_usrlstatrr = $save_grplstatrr = $save_hstlstatrr = $save_maxlstent = $save_deflang =
- $save_scriptPath = $save_scriptServer = $save_samba3 = $save_suffdom =
- $save_suffmap = False;
- $file = fopen($conffile, "r");
- $file_array = array();
- // read config file
- while (!feof($file)) {
- array_push($file_array, fgets($file, 1024));
- }
- fclose($file);
- // generate new configuration file
- for ($i = 0; $i < sizeof($file_array); $i++) {
- if (($file_array[$i] == "\n")||($file_array[$i][0] == "#")) continue; // ignore comments
- // search for keywords
- if (substr($file_array[$i], 0, 11) == "serverURL: ") {
- $file_array[$i] = "serverURL: " . $this->ServerURL . "\n";
- $save_serverURL = True;
- continue;
- }
- if (substr($file_array[$i], 0, 8) == "passwd: ") {
- $file_array[$i] = "passwd: " . $this->Passwd . "\n";
- $save_passwd = True;
- continue;
- }
- if (substr($file_array[$i], 0, 8) == "admins: ") {
- $file_array[$i] = "admins: " . $this->Adminstring . "\n";
- $save_admins = True;
- continue;
- }
- if (substr($file_array[$i], 0, 12) == "usersuffix: ") {
- $file_array[$i] = "usersuffix: " . $this->Suff_users . "\n";
- $save_suffusr = True;
- continue;
- }
- if (substr($file_array[$i], 0, 13) == "groupsuffix: ") {
- $file_array[$i] = "groupsuffix: " . $this->Suff_groups . "\n";
- $save_suffgrp = True;
- continue;
- }
- if (substr($file_array[$i], 0, 12) == "hostsuffix: ") {
- $file_array[$i] = "hostsuffix: " . $this->Suff_hosts . "\n";
- $save_suffhst = True;
- continue;
- }
- if (substr($file_array[$i], 0, 14) == "domainsuffix: ") {
- $file_array[$i] = "domainsuffix: " . $this->Suff_domains . "\n";
- $save_suffdom = True;
- continue;
- }
-/* if (substr($file_array[$i], 0, 11) == "mapsuffix: ") {
- $file_array[$i] = "mapsuffix: " . $this->Suff_map . "\n";
- $save_suffmap = True;
- continue;
- }*/
- if (substr($file_array[$i], 0, 8) == "minUID: ") {
- $file_array[$i] = "minUID: " . $this->MinUID . "\n";
- $save_minUID = True;
- continue;
- }
- if (substr($file_array[$i], 0, 8) == "maxUID: ") {
- $file_array[$i] = "maxUID: " . $this->MaxUID . "\n";
- $save_maxUID = True;
- continue;
- }
- if (substr($file_array[$i], 0, 8) == "minGID: ") {
- $file_array[$i] = "minGID: " . $this->MinGID . "\n";
- $save_minGID = True;
- continue;
- }
- if (substr($file_array[$i], 0, 8) == "maxGID: ") {
- $file_array[$i] = "maxGID: " . $this->MaxGID . "\n";
- $save_maxGID = True;
- continue;
- }
- if (substr($file_array[$i], 0, 12) == "minMachine: ") {
- $file_array[$i] = "minMachine: " . $this->MinMachine . "\n";
- $save_minMach = True;
- continue;
- }
- if (substr($file_array[$i], 0, 12) == "maxMachine: ") {
- $file_array[$i] = "maxMachine: " . $this->MaxMachine . "\n";
- $save_maxMach = True;
- continue;
- }
- if (substr($file_array[$i], 0, 20) == "userlistAttributes: ") {
- $file_array[$i] = "userlistAttributes: " . $this->userlistAttributes . "\n";
- $save_usrlstattr = True;
- continue;
- }
- if (substr($file_array[$i], 0, 21) == "grouplistAttributes: ") {
- $file_array[$i] = "grouplistAttributes: " . $this->grouplistAttributes . "\n";
- $save_grplstattr = True;
- continue;
- }
- if (substr($file_array[$i], 0, 20) == "hostlistAttributes: ") {
- $file_array[$i] = "hostlistAttributes: " . $this->hostlistAttributes . "\n";
- $save_hstlstattr = True;
- continue;
- }
- if (substr($file_array[$i], 0, 16) == "maxlistentries: ") {
- $file_array[$i] = "maxlistentries: " . $this->maxlistentries . "\n";
- $save_maxlstent = True;
- continue;
- }
- if (substr($file_array[$i], 0, 17) == "defaultLanguage: ") {
- $file_array[$i] = "defaultLanguage: " . $this->defaultLanguage . "\n";
- $save_deflang = True;
- continue;
- }
- if (substr($file_array[$i], 0, 12) == "scriptPath: ") {
- $file_array[$i] = "scriptPath: " . $this->scriptPath . "\n";
- $save_scriptPath = True;
- continue;
- }
- if (substr($file_array[$i], 0, 14) == "scriptServer: ") {
- $file_array[$i] = "scriptServer: " . $this->scriptServer . "\n";
- $save_scriptServer = True;
- continue;
- }
- if (substr($file_array[$i], 0, 8) == "samba3: ") {
- $file_array[$i] = "samba3: " . $this->samba3 . "\n";
- $save_samba3 = True;
- continue;
+ // saves preferences to config file
+ function save() {
+ $conffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/" . $this->file . ".conf";
+ if (is_file($conffile) == True) {
+ // booleans to check if value was already saved
+ $save_serverURL = $save_passwd = $save_admins = $save_suffusr = $save_suffgrp = $save_suffhst =
+ $save_minUID = $save_maxUID = $save_minGID = $save_maxGID = $save_minMach = $save_maxMach =
+ $save_usrlstatrr = $save_grplstatrr = $save_hstlstatrr = $save_maxlstent = $save_deflang =
+ $save_scriptPath = $save_scriptServer = $save_samba3 = $save_suffdom = $save_cachetime = False;
+ $file = fopen($conffile, "r");
+ $file_array = array();
+ // read config file
+ while (!feof($file)) {
+ array_push($file_array, fgets($file, 1024));
+ }
+ fclose($file);
+ // generate new configuration file
+ for ($i = 0; $i < sizeof($file_array); $i++) {
+ if (($file_array[$i] == "\n")||($file_array[$i][0] == "#")) continue; // ignore comments
+ // search for keywords
+ if (substr($file_array[$i], 0, 11) == "serverURL: ") {
+ $file_array[$i] = "serverURL: " . $this->ServerURL . "\n";
+ $save_serverURL = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 8) == "passwd: ") {
+ $file_array[$i] = "passwd: " . $this->Passwd . "\n";
+ $save_passwd = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 8) == "admins: ") {
+ $file_array[$i] = "admins: " . $this->Adminstring . "\n";
+ $save_admins = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 12) == "usersuffix: ") {
+ $file_array[$i] = "usersuffix: " . $this->Suff_users . "\n";
+ $save_suffusr = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 13) == "groupsuffix: ") {
+ $file_array[$i] = "groupsuffix: " . $this->Suff_groups . "\n";
+ $save_suffgrp = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 12) == "hostsuffix: ") {
+ $file_array[$i] = "hostsuffix: " . $this->Suff_hosts . "\n";
+ $save_suffhst = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 14) == "domainsuffix: ") {
+ $file_array[$i] = "domainsuffix: " . $this->Suff_domains . "\n";
+ $save_suffdom = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 8) == "minUID: ") {
+ $file_array[$i] = "minUID: " . $this->MinUID . "\n";
+ $save_minUID = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 8) == "maxUID: ") {
+ $file_array[$i] = "maxUID: " . $this->MaxUID . "\n";
+ $save_maxUID = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 8) == "minGID: ") {
+ $file_array[$i] = "minGID: " . $this->MinGID . "\n";
+ $save_minGID = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 8) == "maxGID: ") {
+ $file_array[$i] = "maxGID: " . $this->MaxGID . "\n";
+ $save_maxGID = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 12) == "minMachine: ") {
+ $file_array[$i] = "minMachine: " . $this->MinMachine . "\n";
+ $save_minMach = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 12) == "maxMachine: ") {
+ $file_array[$i] = "maxMachine: " . $this->MaxMachine . "\n";
+ $save_maxMach = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 20) == "userlistAttributes: ") {
+ $file_array[$i] = "userlistAttributes: " . $this->userlistAttributes . "\n";
+ $save_usrlstattr = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 21) == "grouplistAttributes: ") {
+ $file_array[$i] = "grouplistAttributes: " . $this->grouplistAttributes . "\n";
+ $save_grplstattr = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 20) == "hostlistAttributes: ") {
+ $file_array[$i] = "hostlistAttributes: " . $this->hostlistAttributes . "\n";
+ $save_hstlstattr = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 16) == "maxlistentries: ") {
+ $file_array[$i] = "maxlistentries: " . $this->maxlistentries . "\n";
+ $save_maxlstent = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 17) == "defaultLanguage: ") {
+ $file_array[$i] = "defaultLanguage: " . $this->defaultLanguage . "\n";
+ $save_deflang = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 12) == "scriptPath: ") {
+ $file_array[$i] = "scriptPath: " . $this->scriptPath . "\n";
+ $save_scriptPath = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 14) == "scriptServer: ") {
+ $file_array[$i] = "scriptServer: " . $this->scriptServer . "\n";
+ $save_scriptServer = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 8) == "samba3: ") {
+ $file_array[$i] = "samba3: " . $this->samba3 . "\n";
+ $save_samba3 = True;
+ continue;
+ }
+ if (substr($file_array[$i], 0, 14) == "cacheTimeout: ") {
+ $file_array[$i] = "cacheTimeout: " . $this->cache_timeout . "\n";
+ $save_cachetime = True;
+ continue;
+ }
+ }
+ // check if we have to add new entries (e.g. if user upgraded LAM and has an old config file)
+ if (!$save_serverURL == True) array_push($file_array, "\n\n# server address (e.g. ldap://localhost:389 or ldaps://localhost:636)\n" . "serverURL: " . $this->ServerURL . "\n");
+ if (!$save_passwd == True) array_push($file_array, "\n\n# password to change these preferences via webfrontend\n" . "passwd: " . $this->Passwd . "\n");
+ if (!$save_admins == True) array_push($file_array, "\n\n# list of users who are allowed to use LDAP Account Manager\n" .
+ "# names have to be seperated by semicolons\n" .
+ "# e.g. admins: cn=admin,dc=yourdomain,dc=org;cn=root,dc=yourdomain,dc=org\n" . "admins: " . $this->Adminstring . "\n");
+ if (!$save_suffusr == True) array_push($file_array, "\n\n# suffix of users\n" .
+ "# e.g. ou=People,dc=yourdomain,dc=org\n" . "usersuffix: " . $this->Suff_users . "\n");
+ if (!$save_suffgrp == True) array_push($file_array, "\n\n# suffix of groups\n" .
+ "# e.g. ou=Groups,dc=yourdomain,dc=org\n" . "groupsuffix: " . $this->Suff_groups . "\n");
+ if (!$save_suffhst == True) array_push($file_array, "\n\n# suffix of Samba hosts\n" .
+ "# e.g. ou=machines,dc=yourdomain,dc=org\n" . "hostsuffix: " . $this->Suff_hosts . "\n");
+ if (!$save_suffdom == True) array_push($file_array, "\n\n# suffix of Samba 3 domains\n" .
+ "# e.g. ou=domains,dc=yourdomain,dc=org\n" . "domainsuffix: " . $this->Suff_domains . "\n");
+ if (!$save_minUID == True) array_push($file_array, "\n\n# minimum UID number\n" . "minUID: " . $this->MinUID . "\n");
+ if (!$save_maxUID == True) array_push($file_array, "\n\n# maximum UID number\n" . "maxUID: " . $this->MaxUID . "\n");
+ if (!$save_minGID == True) array_push($file_array, "\n\n# minimum GID number\n" . "minGID: " . $this->MinGID . "\n");
+ if (!$save_maxGID == True) array_push($file_array, "\n\n# maximum GID number\n" . "maxGID: " . $this->MaxGID . "\n");
+ if (!$save_minMach == True) array_push($file_array, "\n\n# minimum UID number for Samba hosts\n" . "minMachine: " . $this->MinMachine . "\n");
+ if (!$save_maxMach == True) array_push($file_array, "\n\n# maximum UID number for Samba hosts\n" . "maxMachine: " . $this->MaxMachine . "\n");
+ if (!$save_usrlstattr == True) array_push($file_array, "\n\n# list of attributes to show in user list\n# entries can either be predefined values (e.g. '#cn' or '#uid')" .
+ "\n# or individual ones (e.g. 'uid:User ID' or 'host:Host Name')\n# values have to be seperated by semicolons\n" . "userlistAttributes: " . $this->userlistAttributes . "\n");
+ if (!$save_grplstattr == True) array_push($file_array, "\n\n# list of attributes to show in group list\n# entries can either be predefined values (e.g. '#cn' or '#gidNumber')" .
+ "\n# or individual ones (e.g. 'cn:Group Name')\n# values have to be seperated by semicolons\n" . "grouplistAttributes: " . $this->grouplistAttributes . "\n");
+ if (!$save_hstlstattr == True) array_push($file_array, "\n\n# list of attributes to show in host list\n# entries can either be predefined values (e.g. '#cn' or '#uid')" .
+ "\n# or individual ones (e.g. 'cn:Host Name')\n# values have to be seperated by semicolons\n" . "hostlistAttributes: " . $this->hostlistAttributes . "\n");
+ if (!$save_maxlstent == True) array_push($file_array, "\n\n# maximum number of rows to show in user/group/host lists\n" . "maxlistentries: " . $this->maxlistentries . "\n");
+ if (!$save_deflang == True) array_push($file_array, "\n\n# default language (a line from config/language)\n" . "defaultLanguage: " . $this->defaultLanguage . "\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_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");
+ $file = fopen($conffile, "w");
+ if ($file) {
+ for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]);
+ fclose($file);
+ }
+ else {
+ StatusMessage("ERROR", "", _("Cannot open config file!") . " (" . $conffile . ")");
+ exit;
+ }
}
}
- // check if we have to add new entries (e.g. if user upgraded LAM and has an old config file)
- if (!$save_serverURL == True) array_push($file_array, "\n\n# server address (e.g. ldap://localhost:389 or ldaps://localhost:636)\n" . "serverURL: " . $this->ServerURL . "\n");
- if (!$save_passwd == True) array_push($file_array, "\n\n# password to change these preferences via webfrontend\n" . "passwd: " . $this->Passwd . "\n");
- if (!$save_admins == True) array_push($file_array, "\n\n# list of users who are allowed to use LDAP Account Manager\n" .
- "# names have to be seperated by semicolons\n" .
- "# e.g. admins: cn=admin,dc=yourdomain,dc=org;cn=root,dc=yourdomain,dc=org\n" . "admins: " . $this->Adminstring . "\n");
- if (!$save_suffusr == True) array_push($file_array, "\n\n# suffix of users\n" .
- "# e.g. ou=People,dc=yourdomain,dc=org\n" . "usersuffix: " . $this->Suff_users . "\n");
- if (!$save_suffgrp == True) array_push($file_array, "\n\n# suffix of groups\n" .
- "# e.g. ou=Groups,dc=yourdomain,dc=org\n" . "groupsuffix: " . $this->Suff_groups . "\n");
- if (!$save_suffhst == True) array_push($file_array, "\n\n# suffix of Samba hosts\n" .
- "# e.g. ou=machines,dc=yourdomain,dc=org\n" . "hostsuffix: " . $this->Suff_hosts . "\n");
- if (!$save_suffdom == True) array_push($file_array, "\n\n# suffix of Samba 3 domains\n" .
- "# e.g. ou=domains,dc=yourdomain,dc=org\n" . "domainsuffix: " . $this->Suff_domains . "\n");
-// if (!$save_suffmap == True) array_push($file_array, "\n\n# suffix of Samba 3 user/group mappings\n" .
-// "# e.g. ou=mappings,dc=yourdomain,dc=org\n" . "mapsuffix: " . $this->Suff_map . "\n");
- if (!$save_minUID == True) array_push($file_array, "\n\n# minimum UID number\n" . "minUID: " . $this->MinUID . "\n");
- if (!$save_maxUID == True) array_push($file_array, "\n\n# maximum UID number\n" . "maxUID: " . $this->MaxUID . "\n");
- if (!$save_minGID == True) array_push($file_array, "\n\n# minimum GID number\n" . "minGID: " . $this->MinGID . "\n");
- if (!$save_maxGID == True) array_push($file_array, "\n\n# maximum GID number\n" . "maxGID: " . $this->MaxGID . "\n");
- if (!$save_minMach == True) array_push($file_array, "\n\n# minimum UID number for Samba hosts\n" . "minMachine: " . $this->MinMachine . "\n");
- if (!$save_maxMach == True) array_push($file_array, "\n\n# maximum UID number for Samba hosts\n" . "maxMachine: " . $this->MaxMachine . "\n");
- if (!$save_usrlstattr == True) array_push($file_array, "\n\n# list of attributes to show in user list\n# entries can either be predefined values (e.g. '#cn' or '#uid')" .
- "\n# or individual ones (e.g. 'uid:User ID' or 'host:Host Name')\n# values have to be seperated by semicolons\n" . "userlistAttributes: " . $this->userlistAttributes . "\n");
- if (!$save_grplstattr == True) array_push($file_array, "\n\n# list of attributes to show in group list\n# entries can either be predefined values (e.g. '#cn' or '#gidNumber')" .
- "\n# or individual ones (e.g. 'cn:Group Name')\n# values have to be seperated by semicolons\n" . "grouplistAttributes: " . $this->grouplistAttributes . "\n");
- if (!$save_hstlstattr == True) array_push($file_array, "\n\n# list of attributes to show in host list\n# entries can either be predefined values (e.g. '#cn' or '#uid')" .
- "\n# or individual ones (e.g. 'cn:Host Name')\n# values have to be seperated by semicolons\n" . "hostlistAttributes: " . $this->hostlistAttributes . "\n");
- if (!$save_maxlstent == True) array_push($file_array, "\n\n# maximum number of rows to show in user/group/host lists\n" . "maxlistentries: " . $this->maxlistentries . "\n");
- if (!$save_deflang == True) array_push($file_array, "\n\n# default language (a line from config/language)\n" . "defaultLanguage: " . $this->defaultLanguage . "\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_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");
- $file = fopen($conffile, "w");
- if ($file) {
- for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]);
- fclose($file);
- }
- else {
- StatusMessage("ERROR", "", _("Cannot open config file!") . " (" . $conffile . ")");
- exit;
- }
- }
-}
- // prints current preferences
- function printconf() {
- echo "" . _("Server address") . ": " . $this->ServerURL . "
";
- echo "" . _("Samba 3.x schema") . ": " . $this->samba3 . "
";
- echo "" . _("UserSuffix") . ": " . $this->Suff_users . "
";
- echo "" . _("GroupSuffix") . ": " . $this->Suff_groups . "
";
- echo "" . _("HostSuffix") . ": " . $this->Suff_hosts . "
";
- echo "" . _("DomainSuffix") . ": " . $this->Suff_domains . "
";
-// echo "" . _("MappingSuffix") . ": " . $this->Suff_map . "
";
- echo "" . _("Minimum UID number") . ": " . $this->MinUID . "
";
- echo "" . _("Maximum UID number") . ": " . $this->MaxUID . "
";
- echo "" . _("Minimum GID number") . ": " . $this->MinGID . "
";
- echo "" . _("Maximum GID number") . ": " . $this->MaxGID . "
";
- echo "" . _("Minimum Machine number") . ": " . $this->MinMachine . "
";
- echo "" . _("Maximum Machine number") . ": " . $this->MaxMachine . "
";
- echo "" . _("Attributes in User List") . ": " . $this->userlistAttributes . "
";
- echo "" . _("Attributes in Group List") . ": " . $this->grouplistAttributes . "
";
- echo "" . _("Attributes in Host List") . ": " . $this->hostlistAttributes . "
";
- echo "" . _("Maximum list entries") . ": " . $this->maxlistentries . "
";
- echo "" . _("Default language") . ": " . $this->defaultLanguage . "
";
- echo "" . _("Path to external script") . ": " . $this->scriptPath . "
";
- echo "" . _("Server of external script") . ": " . $this->scriptServer . "
";
- echo "" . _("List of valid users") . ": " . $this->Adminstring;
- }
+ // prints current preferences
+ function printconf() {
+ echo "" . _("Server address") . ": " . $this->ServerURL . "
";
+ echo "" . _("Cache timeout") . ": " . $this->cache_timeout . "
";
+ echo "" . _("Samba 3.x schema") . ": " . $this->samba3 . "
";
+ echo "" . _("UserSuffix") . ": " . $this->Suff_users . "
";
+ echo "" . _("GroupSuffix") . ": " . $this->Suff_groups . "
";
+ echo "" . _("HostSuffix") . ": " . $this->Suff_hosts . "
";
+ echo "" . _("DomainSuffix") . ": " . $this->Suff_domains . "
";
+ echo "" . _("Minimum UID number") . ": " . $this->MinUID . "
";
+ echo "" . _("Maximum UID number") . ": " . $this->MaxUID . "
";
+ echo "" . _("Minimum GID number") . ": " . $this->MinGID . "
";
+ echo "" . _("Maximum GID number") . ": " . $this->MaxGID . "
";
+ echo "" . _("Minimum Machine number") . ": " . $this->MinMachine . "
";
+ echo "" . _("Maximum Machine number") . ": " . $this->MaxMachine . "
";
+ echo "" . _("Attributes in User List") . ": " . $this->userlistAttributes . "
";
+ echo "" . _("Attributes in Group List") . ": " . $this->grouplistAttributes . "
";
+ echo "" . _("Attributes in Host List") . ": " . $this->hostlistAttributes . "
";
+ echo "" . _("Maximum list entries") . ": " . $this->maxlistentries . "
";
+ echo "" . _("Default language") . ": " . $this->defaultLanguage . "
";
+ echo "" . _("Path to external script") . ": " . $this->scriptPath . "
";
+ echo "" . _("Server of external script") . ": " . $this->scriptServer . "
";
+ echo "" . _("List of valid users") . ": " . $this->Adminstring;
+ }
- // functions to read/write preferences
+ // functions to read/write preferences
- // returns the server address as string
- function get_ServerURL() {
- return $this->ServerURL;
- }
+ // returns the server address as string
+ function get_ServerURL() {
+ return $this->ServerURL;
+ }
// sets the server address
function set_ServerURL($value) {
@@ -559,21 +557,6 @@ class Config {
return true;
}
- // returns the LDAP suffix where mappings are saved
-/* function get_MapSuffix() {
- return $this->Suff_map;
- }*/
-
- // sets the LDAP suffix where mappings are saved
-/* function set_MapSuffix($value) {
- if (!$value) $this->Suff_map = ""; // optional parameter
- elseif (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
- $this->Suff_map = $value;
- }
- else return false;
- return true;
- }*/
-
// returns the minimum UID to use when creating new users
function get_minUID() {
return $this->MinUID;
@@ -754,6 +737,19 @@ class Config {
return true;
}
+ // returns the LDAP cache timeout in minutes
+ function get_cacheTimeout() {
+ return $this->cache_timeout;
+ }
+
+ // sets the LDAP cache timeout in minutes
+ function set_cacheTimeout($value) {
+ if (is_numeric($value) && ($value > -1)) {
+ $this->cache_timeout = $value;
+ }
+ else return false;
+ return true;
+ }
}
diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php
index 475454a2..9499a040 100644
--- a/lam/templates/config/confmain.php
+++ b/lam/templates/config/confmain.php
@@ -42,17 +42,17 @@ 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 ($_POST['admins']) $_SESSION['admins'] = $_POST['admins'];
if ($_POST['suffusers']) $_SESSION['suffusers'] = $_POST['suffusers'];
if ($_POST['suffgroups']) $_SESSION['suffgroups'] = $_POST['suffgroups'];
if ($_POST['suffhosts']) $_SESSION['suffhosts'] = $_POST['suffhosts'];
if ($_POST['suffdomains']) $_SESSION['suffdomains'] = $_POST['suffdomains'];
-// if ($_POST['suffmap']) $suffmap = $_POST['suffmap'];
- if ($_POST['minUID']) $_SESSION['minUID'] = $_POST['minUID'];
+ if (isset($_POST['minUID'])) $_SESSION['minUID'] = $_POST['minUID'];
if ($_POST['maxUID']) $_SESSION['maxUID'] = $_POST['maxUID'];
- if ($_POST['minGID']) $_SESSION['minGID'] = $_POST['minGID'];
+ if (isset($_POST['minGID'])) $_SESSION['minGID'] = $_POST['minGID'];
if ($_POST['maxGID']) $_SESSION['maxGID'] = $_POST['maxGID'];
- if ($_POST['minMach']) $_SESSION['minMach'] = $_POST['minMach'];
+ if (isset($_POST['minMach'])) $_SESSION['minMach'] = $_POST['minMach'];
if ($_POST['maxMach']) $_SESSION['maxMach'] = $_POST['maxMach'];
if ($_POST['usrlstattr']) $_SESSION['usrlstattr'] = $_POST['usrlstattr'];
if ($_POST['grplstattr']) $_SESSION['grplstattr'] = $_POST['grplstattr'];
@@ -141,11 +141,18 @@ echo ("