tried to add a new config variable called maxlistentries

This commit is contained in:
dechutes 2003-05-06 23:52:00 +00:00
parent 43eba6395f
commit a1bbdeea27
2 changed files with 444 additions and 413 deletions

View File

@ -73,6 +73,7 @@ class Config {
var $userlistAttributes; var $userlistAttributes;
var $grouplistAttributes; var $grouplistAttributes;
var $hostlistAttributes; var $hostlistAttributes;
var $maxlistentries;
// constructor, loads preferences from ../config/lam.conf // constructor, loads preferences from ../config/lam.conf
function Config() { function Config() {
@ -312,7 +313,7 @@ class Config {
echo _("<b>hostlistAttributes: </b>") . $this->hostlistAttributes; echo _("<b>hostlistAttributes: </b>") . $this->hostlistAttributes;
} }
// functions to read/write preferences // functions to read/write preferences
// returns the server address as string // returns the server address as string
function get_ServerURL() { function get_ServerURL() {
@ -502,6 +503,29 @@ class Config {
else echo _("Config->set_hostlistAttributes failed!"); else echo _("Config->set_hostlistAttributes failed!");
} }
/**
*
*
*
* @return maxlistentries
*/
function get_MaxListEntries() {
return $this->maxlistentries;
}
/**
* @brief sets the maximum of entries to display on one page of the lists
*
* @param value maximum count of entries on one page
*
* @return
*/
function set_MaxListEntries ($value) {
if (is_numeric($value)) $this->maxlistentries = $value;
else echo _("Config->set_MaxListEntries failed!");
}
} }
?> ?>

View File

@ -49,6 +49,7 @@ if ($_POST['maxMach']) $maxMach = $_POST['maxMach'];
if ($_POST['usrlstattr']) $usrlstattr = $_POST['usrlstattr']; if ($_POST['usrlstattr']) $usrlstattr = $_POST['usrlstattr'];
if ($_POST['grplstattr']) $grplstattr = $_POST['grplstattr']; if ($_POST['grplstattr']) $grplstattr = $_POST['grplstattr'];
if ($_POST['hstlstattr']) $hstlstattr = $_POST['hstlstattr']; if ($_POST['hstlstattr']) $hstlstattr = $_POST['hstlstattr'];
if ($_POST['maxlistentries']) $maxlistentries = $_POST['maxlistentries'];
// check if password is correct // check if password is correct
// if not: load login page // if not: load login page
@ -130,6 +131,11 @@ if (chop($hstlstattr) == "") {
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 (chop($maxlistentries) == "") {
echo _("<font color=\"red\"><b>" . _("Max list entries is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit;
}
// set new preferences // set new preferences
$conf->set_ServerURL($serverurl); $conf->set_ServerURL($serverurl);
@ -146,6 +152,7 @@ $conf->set_maxMachine($maxMach);
$conf->set_userlistAttributes($usrlstattr); $conf->set_userlistAttributes($usrlstattr);
$conf->set_grouplistAttributes($grplstattr); $conf->set_grouplistAttributes($grplstattr);
$conf->set_hostlistAttributes($hstlstattr); $conf->set_hostlistAttributes($hstlstattr);
$conf->set_MaxListEntries($maxlistentries);
// check if password was changed // check if password was changed
if ($pass1 != $pass2) { if ($pass1 != $pass2) {