tried to add a new config variable called maxlistentries
This commit is contained in:
parent
43eba6395f
commit
a1bbdeea27
|
@ -73,6 +73,7 @@ class Config {
|
|||
var $userlistAttributes;
|
||||
var $grouplistAttributes;
|
||||
var $hostlistAttributes;
|
||||
var $maxlistentries;
|
||||
|
||||
// constructor, loads preferences from ../config/lam.conf
|
||||
function Config() {
|
||||
|
@ -312,7 +313,7 @@ class Config {
|
|||
echo _("<b>hostlistAttributes: </b>") . $this->hostlistAttributes;
|
||||
}
|
||||
|
||||
// functions to read/write preferences
|
||||
// functions to read/write preferences
|
||||
|
||||
// returns the server address as string
|
||||
function get_ServerURL() {
|
||||
|
@ -502,6 +503,29 @@ class Config {
|
|||
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!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -49,6 +49,7 @@ if ($_POST['maxMach']) $maxMach = $_POST['maxMach'];
|
|||
if ($_POST['usrlstattr']) $usrlstattr = $_POST['usrlstattr'];
|
||||
if ($_POST['grplstattr']) $grplstattr = $_POST['grplstattr'];
|
||||
if ($_POST['hstlstattr']) $hstlstattr = $_POST['hstlstattr'];
|
||||
if ($_POST['maxlistentries']) $maxlistentries = $_POST['maxlistentries'];
|
||||
|
||||
// check if password is correct
|
||||
// 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>");
|
||||
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
|
||||
$conf->set_ServerURL($serverurl);
|
||||
|
@ -146,6 +152,7 @@ $conf->set_maxMachine($maxMach);
|
|||
$conf->set_userlistAttributes($usrlstattr);
|
||||
$conf->set_grouplistAttributes($grplstattr);
|
||||
$conf->set_hostlistAttributes($hstlstattr);
|
||||
$conf->set_MaxListEntries($maxlistentries);
|
||||
|
||||
// check if password was changed
|
||||
if ($pass1 != $pass2) {
|
||||
|
|
Loading…
Reference in New Issue