moved min/maxUID settings for users and hosts to posixAccount module

This commit is contained in:
Roland Gruber 2004-08-01 09:39:24 +00:00
parent 8786dea1c3
commit 0a75fe91a0
9 changed files with 110 additions and 213 deletions

View File

@ -27,18 +27,6 @@ hostsuffix: ou=machines,dc=my-domain,dc=com
# e.g. ou=domains,dc=yourdomain,dc=org # e.g. ou=domains,dc=yourdomain,dc=org
domainsuffix: ou=domains,dc=my-domain,dc=com domainsuffix: ou=domains,dc=my-domain,dc=com
# minimum and maximum UID numbers
minUID: 10000
maxUID: 20000
# minimum and maximum GID numbers
minGID: 10000
maxGID: 20000
# minimum and maximum UID numbers for Samba Hosts
minMachine: 25000
maxMachine: 35000
# list of attributes to show in user list # list of attributes to show in user list
# entries can either be predefined values (e.g. '#cn' or '#uid') # entries can either be predefined values (e.g. '#cn' or '#uid')
# or individual ones (e.g. 'uid:User ID' or 'host:Host Name') # or individual ones (e.g. 'uid:User ID' or 'host:Host Name')
@ -75,3 +63,12 @@ cachetimeout: 5
# Password hash algorithm (CRYPT/MD5/SMD5/SHA/SSHA/PLAIN). # Password hash algorithm (CRYPT/MD5/SMD5/SHA/SSHA/PLAIN).
pwdhash: SSHA pwdhash: SSHA
# Module settings
modules: posixAccount_minUID: 10000
modules: posixAccount_maxUID: 30000
modules: posixAccount_minMachine: 50000
modules: posixAccount_maxMachine: 60000
modules: posixGroup_minGID: 10000
modules: posixGroup_maxGID: 20000

View File

@ -138,8 +138,7 @@ $helpArray = array (
"400" => array ("ext" => "FALSE", "Headline" => _("Username"), "400" => array ("ext" => "FALSE", "Headline" => _("Username"),
"Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")), "Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")),
"401" => array ("ext" => "FALSE", "Headline" => _("UID number"), "401" => array ("ext" => "FALSE", "Headline" => _("UID number"),
"Text" => _("If empty UID number will be generated automaticly. Valid values are between %s and %s."), "Text" => _("If empty UID number will be generated automaticly.")),
"variables" => array($_SESSION['config']->get_minUID(), $_SESSION['config']->get_maxUID())),
"402" => array ("ext" => "FALSE", "Headline" => _("Additional groups"), "402" => array ("ext" => "FALSE", "Headline" => _("Additional groups"),
"Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty.")), "Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty.")),
"403" => array ("ext" => "FALSE", "Headline" => _("Home directory"), "403" => array ("ext" => "FALSE", "Headline" => _("Home directory"),
@ -159,8 +158,7 @@ $helpArray = array (
"410" => array ("ext" => "FALSE", "Headline" => _("Host name"), "410" => array ("ext" => "FALSE", "Headline" => _("Host name"),
"Text" => _("Host name of the host which should be created. Valid characters are: a-z,0-9, .-_$. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. Hostnames are always ending with $. If last character is not $ it will be added. If hostname is already used hostname will be expanded with a number. The next free number will be used.")), "Text" => _("Host name of the host which should be created. Valid characters are: a-z,0-9, .-_$. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. Hostnames are always ending with $. If last character is not $ it will be added. If hostname is already used hostname will be expanded with a number. The next free number will be used.")),
"411" => array ("ext" => "FALSE", "Headline" => _("UID number"), "411" => array ("ext" => "FALSE", "Headline" => _("UID number"),
"Text" => _("If empty UID number will be generated automaticly. Valid values are between %s and %s."), "Text" => _("If empty UID number will be generated automaticly.")),
"variables" => array($_SESSION['config']->get_minMachine(), $_SESSION['config']->get_maxMachine())),
"412" => array ("ext" => "FALSE", "Headline" => _("Primary group"), "412" => array ("ext" => "FALSE", "Headline" => _("Primary group"),
"Text" => _("The Primary group the host should be member of.")), "Text" => _("The Primary group the host should be member of.")),
"413" => array ("ext" => "FALSE", "Headline" => _("Gecos"), "413" => array ("ext" => "FALSE", "Headline" => _("Gecos"),

View File

@ -119,15 +119,6 @@ class Config {
/** LDAP suffix for Samba 3 domains */ /** LDAP suffix for Samba 3 domains */
var $domainsuffix; var $domainsuffix;
/** Minimum UID number for users */
var $MinUID;
/** Maximum UID number for users */
var $MaxUID;
/** Minimum UID number for Samba hosts */
var $MinMachine;
/** Maximum UID number for Samba hosts */
var $MaxMachine;
/** Attributes that are shown in the user list */ /** Attributes that are shown in the user list */
var $userlistAttributes; var $userlistAttributes;
/** Attributes that are shown in the group list */ /** Attributes that are shown in the group list */
@ -179,8 +170,7 @@ class Config {
/** List of all settings in config file */ /** List of all settings in config file */
var $settings = array("ServerURL", "Passwd", "Admins", "usersuffix", "groupsuffix", "hostsuffix", var $settings = array("ServerURL", "Passwd", "Admins", "usersuffix", "groupsuffix", "hostsuffix",
"domainsuffix", "MinUID", "MaxUID", "MinMachine", "MaxMachine", "domainsuffix", "userlistAttributes", "grouplistAttributes", "hostlistAttributes", "maxlistentries",
"userlistAttributes", "grouplistAttributes", "hostlistAttributes", "maxlistentries",
"defaultLanguage", "scriptPath", "scriptServer", "cachetimeout", "pwdhash", "defaultLanguage", "scriptPath", "scriptServer", "cachetimeout", "pwdhash",
"usermodules", "groupmodules", "hostmodules", "modules"); "usermodules", "groupmodules", "hostmodules", "modules");
@ -292,10 +282,6 @@ class Config {
"# e.g. ou=machines,dc=yourdomain,dc=org\n" . "hostsuffix: " . $this->hostsuffix . "\n"); "# e.g. ou=machines,dc=yourdomain,dc=org\n" . "hostsuffix: " . $this->hostsuffix . "\n");
if (!in_array("domainsuffix", $saved)) array_push($file_array, "\n\n# suffix of Samba 3 domains\n" . if (!in_array("domainsuffix", $saved)) array_push($file_array, "\n\n# suffix of Samba 3 domains\n" .
"# e.g. ou=domains,dc=yourdomain,dc=org\n" . "domainsuffix: " . $this->domainsuffix . "\n"); "# e.g. ou=domains,dc=yourdomain,dc=org\n" . "domainsuffix: " . $this->domainsuffix . "\n");
if (!in_array("MinUID", $saved)) array_push($file_array, "\n\n# minimum UID number\n" . "minUID: " . $this->MinUID . "\n");
if (!in_array("MaxUID", $saved)) array_push($file_array, "\n\n# maximum UID number\n" . "maxUID: " . $this->MaxUID . "\n");
if (!in_array("MinMachine", $saved)) array_push($file_array, "\n\n# minimum UID number for Samba hosts\n" . "minMachine: " . $this->MinMachine . "\n");
if (!in_array("MaxMachine", $saved)) array_push($file_array, "\n\n# maximum UID number for Samba hosts\n" . "maxMachine: " . $this->MaxMachine . "\n");
if (!in_array("userlistAttributes", $saved)) 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')" . if (!in_array("userlistAttributes", $saved)) 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"); "\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 (!in_array("grouplistAttributes", $saved)) 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')" . if (!in_array("grouplistAttributes", $saved)) 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')" .
@ -340,10 +326,6 @@ class Config {
echo "<b>" . _("GroupSuffix") . ": </b>" . $this->groupsuffix . "<br>\n"; echo "<b>" . _("GroupSuffix") . ": </b>" . $this->groupsuffix . "<br>\n";
echo "<b>" . _("HostSuffix") . ": </b>" . $this->hostsuffix . "<br>\n"; echo "<b>" . _("HostSuffix") . ": </b>" . $this->hostsuffix . "<br>\n";
echo "<b>" . _("DomainSuffix") . ": </b>" . $this->domainsuffix . "<br>\n"; echo "<b>" . _("DomainSuffix") . ": </b>" . $this->domainsuffix . "<br>\n";
echo "<b>" . _("Minimum UID number") . ": </b>" . $this->MinUID . "<br>\n";
echo "<b>" . _("Maximum UID number") . ": </b>" . $this->MaxUID . "<br>\n";
echo "<b>" . _("Minimum Machine number") . ": </b>" . $this->MinMachine . "<br>\n";
echo "<b>" . _("Maximum Machine number") . ": </b>" . $this->MaxMachine . "<br>\n";
echo "<b>" . _("Attributes in User List") . ": </b>" . $this->userlistAttributes . "<br>\n"; echo "<b>" . _("Attributes in User List") . ": </b>" . $this->userlistAttributes . "<br>\n";
echo "<b>" . _("Attributes in Group List") . ": </b>" . $this->grouplistAttributes . "<br>\n"; echo "<b>" . _("Attributes in Group List") . ": </b>" . $this->grouplistAttributes . "<br>\n";
echo "<b>" . _("Attributes in Host List") . ": </b>" . $this->hostlistAttributes . "<br>\n"; echo "<b>" . _("Attributes in Host List") . ": </b>" . $this->hostlistAttributes . "<br>\n";
@ -541,92 +523,6 @@ class Config {
return true; return true;
} }
/**
* Returns the minimum UID to use when creating new users
*
* @return the minimum UID number
*/
function get_minUID() {
return $this->MinUID;
}
/**
* Sets the minimum UID to use when creating new users
*
* @param $value new minimum UID number
* @return true if $value has correct format
*/
function set_minUID($value) {
if (is_numeric($value)) $this->MinUID = $value;
else return false;
return true;
}
/**
* Returns the maximum UID to use when creating new users
*
* @return the maximum UID number
*/
function get_maxUID() {
return $this->MaxUID;
}
/**
* Sets the maximum UID to use when creating new users
*
* @param $value new maximum UID number
* @return true if $value has correct format
*/
function set_maxUID($value) {
if (is_numeric($value)) $this->MaxUID = $value;
else return false;
return true;
}
/**
* Returns the minimum UID to use when creating new Samba hosts
*
* @return the minimum UID number
*/
function get_minMachine() {
return $this->MinMachine;
}
/**
* Sets the minimum UID to use when creating new Samba hosts
*
* @param $value new minimum UID number
* @return true if $value has correct format
*/
function set_minMachine($value) {
if (! $value && ($this->hostsuffix == "")) $this->MinMachine = "";
elseif (is_numeric($value)) $this->MinMachine = $value;
else return false;
return true;
}
/**
* Returns the maximum UID to use when creating new Samba hosts
*
* @return the maximum UID number
*/
function get_maxMachine() {
return $this->MaxMachine;
}
/**
* Sets the maximum UID to use when creating new Samba hosts
*
* @param $value new maximum UID number
* @return true if $value has correct format
*/
function set_maxMachine($value) {
if (! $value && ($this->hostsuffix == "")) $this->MaxMachine = "";
elseif (is_numeric($value)) $this->MaxMachine = $value;
else return false;
return true;
}
/** /**
* Returns the list of attributes to show in user list * Returns the list of attributes to show in user list
* *

View File

@ -60,6 +60,13 @@ class posixAccount extends baseModule {
function posixAccount($scope) { function posixAccount($scope) {
// error messages for input checks // error messages for input checks
$this->messages['homedir'] = array('ERROR', _('Home directory'), _('Homedirectory contains invalid characters.')); $this->messages['homedir'] = array('ERROR', _('Home directory'), _('Homedirectory contains invalid characters.'));
$this->messages['minUID'] = array('ERROR', _('Users') . ': &nbsp;' . _('Minimum UID number'), _("Minimum UID number is invalid!"));
$this->messages['maxUID'] = array('ERROR', _('Users') . ': &nbsp;' . _('Maximum UID number'), _("Maximum UID number is invalid!"));
$this->messages['minMachine'] = array('ERROR', _('Hosts') . ': &nbsp;' . _('Minimum UID number'), _("Minimum UID number is invalid!"));
$this->messages['maxMachine'] = array('ERROR', _('Hosts') . ': &nbsp;' . _('Maximum UID number'), _("Maximum UID number is invalid!"));
$this->messages['cmp_UID'] = array('ERROR', _('Users') . ': &nbsp;' . _('Maximum UID number'), _("Maximum UID number must be greater than minimum UID number!"));
$this->messages['cmp_Machine'] = array('ERROR', _('Hosts') . ': &nbsp;' . _('Maximum UID number'), _("Maximum UID number must be greater than minimum UID number!"));
$this->messages['cmp_both'] = array('ERROR', _('UID ranges'), _("The UID ranges for users and hosts overlap! This is a problem because LAM uses the highest UID in use + 1. Please set the minimum UID to equal values or use independent ranges."));
// call parent constructor // call parent constructor
parent::baseModule($scope); parent::baseModule($scope);
} }
@ -91,6 +98,35 @@ class posixAccount extends baseModule {
// profile checks // profile checks
$return['profile_checks']['posixAccount_homeDirectory'] = array('type' => 'regex_i', 'regex' => $this->regex_homedir, $return['profile_checks']['posixAccount_homeDirectory'] = array('type' => 'regex_i', 'regex' => $this->regex_homedir,
'error_message' => $this->messages['homedir']); 'error_message' => $this->messages['homedir']);
// configuration options
$return['config_options']['user'] = array(
array(
0 => array('kind' => 'text', 'text' => '<b>' . _("Users") . ': &nbsp;</b>' . _('Minimum UID number') . ": "),
1 => array('kind' => 'input', 'name' => 'posixAccount_minUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
2 => array('kind' => 'text', 'value' => '&nbsp;'),
3 => array('kind' => 'text', 'text' => _('Maximum UID number') . ": "),
4 => array('kind' => 'input', 'name' => 'posixAccount_maxUID', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
5 => array('kind' => 'help', 'value' => 'TODO'))
);
$return['config_options']['host'] = array(
array(
0 => array('kind' => 'text', 'text' => '<b>' . _("Hosts") . ': &nbsp;</b>' . _('Minimum UID number') . ": "),
1 => array('kind' => 'input', 'name' => 'posixAccount_minMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
2 => array('kind' => 'text', 'value' => '&nbsp;'),
3 => array('kind' => 'text', 'text' => _('Maximum UID number') . ": "),
4 => array('kind' => 'input', 'name' => 'posixAccount_maxMachine', 'type' => 'text', 'size' => '10', 'maxlength' => '255'),
5 => array('kind' => 'help', 'value' => 'TODO'))
);
// configuration descriptions
$return['config_descriptions'] = array(
'legend' => _("UID ranges for Unix accounts"),
'descriptions' => array(
'posixAccount_minUID' => _("Minimum UID number for Unix accounts (users)"),
'posixAccount_maxUID' => _("Maximum UID number for Unix accounts (users)"),
'posixAccount_minMachine' => _("Minimum UID number for Unix accounts (hosts)"),
'posixAccount_maxMachine' => _("Maximum UID number for Unix accounts (hosts)"),
)
);
return $return; return $return;
} }
@ -418,12 +454,12 @@ class posixAccount extends baseModule {
// Check if UID is valid. If none value was entered, the next useable value will be inserted // Check if UID is valid. If none value was entered, the next useable value will be inserted
// load min and may uidNumber // load min and may uidNumber
if ($_SESSION[$this->base]->type=='user') { if ($_SESSION[$this->base]->type=='user') {
$minID = intval($_SESSION[$_SESSION[$this->base]->config]->get_minUID()); $minID = intval($this->moduleSettings['posixAccount_minUID'][0]);
$maxID = intval($_SESSION[$_SESSION[$this->base]->config]->get_maxUID()); $maxID = intval($this->moduleSettings['posixAccount_maxUID'][0]);
} }
if ($_SESSION[$this->base]->type=='host') { if ($_SESSION[$this->base]->type=='host') {
$minID = intval($_SESSION[$_SESSION[$this->base]->config]->get_minMachine()); $minID = intval($this->moduleSettings['posixAccount_minMachine'][0]);
$maxID = intval($_SESSION[$_SESSION[$this->base]->config]->get_maxMachine()); $maxID = intval($this->moduleSettings['posixAccount_maxMachine'][0]);
} }
$dn_uids = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('uidNumber', 'posixAccount', '*'); $dn_uids = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('uidNumber', 'posixAccount', '*');
// get_cache will return an array ( dn1 => array(uidnumber1), dn2 => array(uidnumber2), ... ) // get_cache will return an array ( dn1 => array(uidnumber1), dn2 => array(uidnumber2), ... )
@ -747,6 +783,64 @@ class posixAccount extends baseModule {
); );
} }
/**
* Checks input values of module settings.
*
* @param array $scopes list of account types which are used
* @param array $options hash array containing the settings (array('option' => array('value')))
* @return array list of error messages
*/
function check_configOptions($scopes, $options) {
$return = array();
// user settings
if (in_array('user', $scopes)) {
// min/maxUID are required, check if they are numeric
if (!isset($options['posixAccount_minUID'][0]) || !ereg('^[0-9]+$', $options['posixAccount_minUID'][0])) {
$return[] = $this->messages['minUID'];
}
if (!isset($options['posixAccount_maxUID'][0]) || !ereg('^[0-9]+$', $options['posixAccount_maxUID'][0])) {
$return[] = $this->messages['maxUID'];
}
// minUID < maxUID
if (isset($options['posixAccount_minUID'][0]) && isset($options['posixAccount_maxUID'][0])) {
if ($options['posixAccount_minUID'][0] > $options['posixAccount_maxUID'][0]) {
$return[] = $this->messages['cmp_UID'];
}
}
}
// host settings
if (in_array('host', $scopes)) {
// min/maxUID are required, check if they are numeric
if (!isset($options['posixAccount_minMachine'][0]) || !ereg('^[0-9]+$', $options['posixAccount_minMachine'][0])) {
$return[] = $this->messages['minMachine'];
}
if (!isset($options['posixAccount_maxMachine'][0]) || !ereg('^[0-9]+$', $options['posixAccount_maxMachine'][0])) {
$return[] = $this->messages['maxMachine'];
}
// minUID < maxUID
if (isset($options['posixAccount_minMachine'][0]) && isset($options['posixAccount_maxMachine'][0])) {
if ($options['posixAccount_minMachine'][0] > $options['posixAccount_maxMachine'][0]) {
$return[] = $this->messages['cmp_Machine'];
}
}
}
// check if user and host ranges overlap
if (in_array('user', $scopes) && in_array('host', $scopes)) {
if (isset($options['posixAccount_minUID'][0]) && isset($options['posixAccount_maxUID'][0]) &&
isset($options['posixAccount_minMachine'][0]) && isset($options['posixAccount_maxMachine'][0])) {
if (($options['posixAccount_minMachine'][0] > $options['posixAccount_minUID'][0]) &&
($options['posixAccount_minMachine'][0] < $options['posixAccount_maxUID'][0])) {
$return[] = $this->messages['cmp_both'];
}
if (($options['posixAccount_minUID'][0] > $options['posixAccount_minMachine'][0]) &&
($options['posixAccount_minUID'][0] < $options['posixAccount_maxMachine'][0])) {
$return[] = $this->messages['cmp_both'];
}
}
}
return $return;
}
} }
?> ?>

View File

@ -66,10 +66,6 @@ convsave, confmain, conflogin:
- conf_suffgroups: Eingabe von confmain - conf_suffgroups: Eingabe von confmain
- conf_suffhosts: Eingabe von confmain - conf_suffhosts: Eingabe von confmain
- conf_suffdomains: Eingabe von confmain - conf_suffdomains: Eingabe von confmain
- conf_minUID: Eingabe von confmain
- conf_maxUID: Eingabe von confmain
- conf_minMach: Eingabe von confmain
- conf_maxMach: Eingabe von confmain
- conf_usrlstattr: Eingabe von confmain - conf_usrlstattr: Eingabe von confmain
- conf_grplstattr: Eingabe von confmain - conf_grplstattr: Eingabe von confmain
- conf_hstlstattr: Eingabe von confmain - conf_hstlstattr: Eingabe von confmain

View File

@ -50,10 +50,6 @@ unset($_SESSION['conf_admins']);
unset($_SESSION['conf_suffusers']); unset($_SESSION['conf_suffusers']);
unset($_SESSION['conf_suffgroups']); unset($_SESSION['conf_suffgroups']);
unset($_SESSION['conf_suffhosts']); unset($_SESSION['conf_suffhosts']);
unset($_SESSION['conf_minUID']);
unset($_SESSION['conf_maxUID']);
unset($_SESSION['conf_minMach']);
unset($_SESSION['conf_maxMach']);
unset($_SESSION['conf_usrlstattr']); unset($_SESSION['conf_usrlstattr']);
unset($_SESSION['conf_grplstattr']); unset($_SESSION['conf_grplstattr']);
unset($_SESSION['conf_hstlstattr']); unset($_SESSION['conf_hstlstattr']);

View File

@ -57,10 +57,6 @@ if ($_POST['back'] || $_POST['submitconf'] || $_POST['editmodules']){
$_SESSION['conf_suffgroups'] = $_POST['suffgroups']; $_SESSION['conf_suffgroups'] = $_POST['suffgroups'];
$_SESSION['conf_suffhosts'] = $_POST['suffhosts']; $_SESSION['conf_suffhosts'] = $_POST['suffhosts'];
$_SESSION['conf_suffdomains'] = $_POST['suffdomains']; $_SESSION['conf_suffdomains'] = $_POST['suffdomains'];
$_SESSION['conf_minUID'] = $_POST['minUID'];
$_SESSION['conf_maxUID'] = $_POST['maxUID'];
$_SESSION['conf_minMach'] = $_POST['minMach'];
$_SESSION['conf_maxMach'] = $_POST['maxMach'];
$_SESSION['conf_usrlstattr'] = $_POST['usrlstattr']; $_SESSION['conf_usrlstattr'] = $_POST['usrlstattr'];
$_SESSION['conf_grplstattr'] = $_POST['grplstattr']; $_SESSION['conf_grplstattr'] = $_POST['grplstattr'];
$_SESSION['conf_hstlstattr'] = $_POST['hstlstattr']; $_SESSION['conf_hstlstattr'] = $_POST['hstlstattr'];
@ -127,10 +123,6 @@ if ($_GET["modulesback"] == "true") {
$conf->set_GroupSuffix($_SESSION['conf_suffgroups']); $conf->set_GroupSuffix($_SESSION['conf_suffgroups']);
$conf->set_HostSuffix($_SESSION['conf_suffhosts']); $conf->set_HostSuffix($_SESSION['conf_suffhosts']);
$conf->set_DomainSuffix($_SESSION['conf_suffdomains']); $conf->set_DomainSuffix($_SESSION['conf_suffdomains']);
$conf->set_minUID($_SESSION['conf_minUID']);
$conf->set_maxUID($_SESSION['conf_maxUID']);
$conf->set_minMachine($_SESSION['conf_minMach']);
$conf->set_maxMachine($_SESSION['conf_maxMach']);
$conf->set_userlistAttributes($_SESSION['conf_usrlstattr']); $conf->set_userlistAttributes($_SESSION['conf_usrlstattr']);
$conf->set_grouplistAttributes($_SESSION['conf_grplstattr']); $conf->set_grouplistAttributes($_SESSION['conf_grplstattr']);
$conf->set_hostlistAttributes($_SESSION['conf_hstlstattr']); $conf->set_hostlistAttributes($_SESSION['conf_hstlstattr']);
@ -297,34 +289,6 @@ for ($m = 0; $m < sizeof($modules); $m++) {
} }
echo ("<fieldset><legend><b>" . _("Ranges") . "</b></legend>");
echo ("<table border=0>");
// minUID
echo ("<tr><td align=\"right\"><b>".
_("Minimum UID number") . " *: </b>".
"<input size=6 type=\"text\" name=\"minUID\" value=\"" . $conf->get_minUID() . "\"></td>\n");
echo "<td>&nbsp;&nbsp;&nbsp;</td>\n";
// maxUID
echo ("<td align=\"right\"><b>" . _("Maximum UID number") . " *: </b>".
"<input size=6 type=\"text\" name=\"maxUID\" value=\"" . $conf->get_maxUID() . "\"></td>\n");
// UID text
echo ("<td><a href=\"../help.php?HelpNumber=203\" target=\"lamhelp\">" . _("Help") . "</a></td></tr>\n");
// minMach
echo ("<tr><td align=\"right\"><b>".
_("Minimum Machine number") . " **: </b>".
"<input size=6 type=\"text\" name=\"minMach\" value=\"" . $conf->get_minMachine() . "\"></td>\n");
echo "<td>&nbsp;&nbsp;&nbsp;</td>\n";
// maxMach
echo ("<td align=\"right\"><b>" . _("Maximum Machine number") . " **: </b>".
"<input size=6 type=\"text\" name=\"maxMach\" value=\"" . $conf->get_maxMachine() . "\"></td>\n");
// Machine text
echo ("<td><a href=\"../help.php?HelpNumber=205\" target=\"lamhelp\">" . _("Help") . "</a></td></tr>\n");
echo ("</table>\n");
echo ("</fieldset>\n");
echo ("<p></p>\n");
echo ("<fieldset><legend><b>" . _("LDAP List settings") . "</b></legend>\n"); echo ("<fieldset><legend><b>" . _("LDAP List settings") . "</b></legend>\n");
echo ("<table border=0>\n"); echo ("<table border=0>\n");

View File

@ -52,10 +52,6 @@ $suffusers = $_SESSION['conf_suffusers'];
$suffgroups = $_SESSION['conf_suffgroups']; $suffgroups = $_SESSION['conf_suffgroups'];
$suffhosts = $_SESSION['conf_suffhosts']; $suffhosts = $_SESSION['conf_suffhosts'];
$suffdomains = $_SESSION['conf_suffdomains']; $suffdomains = $_SESSION['conf_suffdomains'];
$minUID = $_SESSION['conf_minUID'];
$maxUID = $_SESSION['conf_maxUID'];
$minMach = $_SESSION['conf_minMach'];
$maxMach = $_SESSION['conf_maxMach'];
$usrlstattr = $_SESSION['conf_usrlstattr']; $usrlstattr = $_SESSION['conf_usrlstattr'];
$grplstattr = $_SESSION['conf_grplstattr']; $grplstattr = $_SESSION['conf_grplstattr'];
$hstlstattr = $_SESSION['conf_hstlstattr']; $hstlstattr = $_SESSION['conf_hstlstattr'];
@ -119,26 +115,6 @@ if (!$conf->set_DomainSuffix($suffdomains)) {
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 (!$conf->set_minUID($minUID)) {
echo ("<font color=\"red\"><b>" . _("Minimum UID number is invalid!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit;
}
if (!$conf->set_maxUID($maxUID)) {
echo ("<font color=\"red\"><b>" . _("Maximum UID number is invalid!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit;
}
if (!$conf->set_minMachine($minMach)) {
echo ("<font color=\"red\"><b>" . _("Minimum Machine number is invalid!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit;
}
if (!$conf->set_maxMachine($maxMach)) {
echo ("<font color=\"red\"><b>" . _("Maximum Machine number is invalid!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit;
}
if (!$conf->set_userlistAttributes($usrlstattr)) { if (!$conf->set_userlistAttributes($usrlstattr)) {
echo ("<font color=\"red\"><b>" . _("User list attributes are invalid!") . "</b></font>"); echo ("<font color=\"red\"><b>" . _("User list attributes are invalid!") . "</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>");
@ -283,10 +259,6 @@ unset($_SESSION['conf_suffusers']);
unset($_SESSION['conf_suffgroups']); unset($_SESSION['conf_suffgroups']);
unset($_SESSION['conf_suffhosts']); unset($_SESSION['conf_suffhosts']);
unset($_SESSION['conf_suffdomains']); unset($_SESSION['conf_suffdomains']);
unset($_SESSION['conf_minUID']);
unset($_SESSION['conf_maxUID']);
unset($_SESSION['conf_minMach']);
unset($_SESSION['conf_maxMach']);
unset($_SESSION['conf_usrlstattr']); unset($_SESSION['conf_usrlstattr']);
unset($_SESSION['conf_grplstattr']); unset($_SESSION['conf_grplstattr']);
unset($_SESSION['conf_hstlstattr']); unset($_SESSION['conf_hstlstattr']);

View File

@ -39,10 +39,6 @@ $Suff_users = $conf->get_UserSuffix();
$Suff_groups = $conf->get_GroupSuffix(); $Suff_groups = $conf->get_GroupSuffix();
$Suff_hosts = $conf->get_HostSuffix(); $Suff_hosts = $conf->get_HostSuffix();
$Suff_domains = $conf->get_DomainSuffix(); $Suff_domains = $conf->get_DomainSuffix();
$MinUID = $conf->get_minUID();
$MaxUID = $conf->get_maxUID();
$MinMachine = $conf->get_minMachine();
$MaxMachine = $conf->get_maxMachine();
$userlistAttributes = $conf->get_userlistAttributes(); $userlistAttributes = $conf->get_userlistAttributes();
$grouplistAttributes = $conf->get_grouplistAttributes(); $grouplistAttributes = $conf->get_grouplistAttributes();
$hostlistAttributes = $conf->get_hostlistAttributes(); $hostlistAttributes = $conf->get_hostlistAttributes();
@ -63,10 +59,6 @@ $conf->set_UserSuffix("ou=test,o=test,c=de");
$conf->set_GroupSuffix("ou=testgrp,o=test,c=de"); $conf->set_GroupSuffix("ou=testgrp,o=test,c=de");
$conf->set_HostSuffix("ou=testhst,o=test,c=de"); $conf->set_HostSuffix("ou=testhst,o=test,c=de");
$conf->set_DomainSuffix("ou=testdom,o=test,c=de"); $conf->set_DomainSuffix("ou=testdom,o=test,c=de");
$conf->set_minUID("25");
$conf->set_maxUID("254");
$conf->set_minMachine("3");
$conf->set_maxMachine("47");
$conf->set_userlistAttributes("#uid;#cn"); $conf->set_userlistAttributes("#uid;#cn");
$conf->set_grouplistAttributes("#gidNumber;#cn;#memberUID"); $conf->set_grouplistAttributes("#gidNumber;#cn;#memberUID");
$conf->set_hostlistAttributes("#cn;#uid;#description"); $conf->set_hostlistAttributes("#cn;#uid;#description");
@ -89,10 +81,6 @@ if ($conf2->get_UserSuffix() != "ou=test,o=test,c=de") echo ("<br><font color=\"
if ($conf2->get_GroupSuffix() != "ou=testgrp,o=test,c=de") echo ("<br><font color=\"#FF0000\">Saving group suffix failed!</font><br>"); if ($conf2->get_GroupSuffix() != "ou=testgrp,o=test,c=de") echo ("<br><font color=\"#FF0000\">Saving group suffix failed!</font><br>");
if ($conf2->get_HostSuffix() != "ou=testhst,o=test,c=de") echo ("<br><font color=\"#FF0000\">Saving host suffix failed!</font><br>"); if ($conf2->get_HostSuffix() != "ou=testhst,o=test,c=de") echo ("<br><font color=\"#FF0000\">Saving host suffix failed!</font><br>");
if ($conf2->get_DomainSuffix() != "ou=testdom,o=test,c=de") echo ("<br><font color=\"#FF0000\">Saving domain suffix failed!</font><br>"); if ($conf2->get_DomainSuffix() != "ou=testdom,o=test,c=de") echo ("<br><font color=\"#FF0000\">Saving domain suffix failed!</font><br>");
if ($conf2->get_minUID() != "25") echo ("<br><font color=\"#FF0000\">Saving minUID failed!</font><br>");
if ($conf2->get_maxUID() != "254") echo ("<br><font color=\"#FF0000\">Saving maxUID failed!</font><br>");
if ($conf2->get_minMachine() != "3") echo ("<br><font color=\"#FF0000\">Saving maxMachine failed!</font><br>");
if ($conf2->get_maxMachine() != "47") echo ("<br><font color=\"#FF0000\">Saving minMachine failed!</font><br>");
if ($conf2->get_userlistAttributes() != "#uid;#cn") echo ("<br><font color=\"#FF0000\">Saving userlistAttributes failed!</font><br>"); if ($conf2->get_userlistAttributes() != "#uid;#cn") echo ("<br><font color=\"#FF0000\">Saving userlistAttributes failed!</font><br>");
if ($conf2->get_grouplistAttributes() != "#gidNumber;#cn;#memberUID") echo ("<br><font color=\"#FF0000\">Saving grouplistAttributes failed!</font><br>"); if ($conf2->get_grouplistAttributes() != "#gidNumber;#cn;#memberUID") echo ("<br><font color=\"#FF0000\">Saving grouplistAttributes failed!</font><br>");
if ($conf2->get_hostlistAttributes() != "#cn;#uid;#description") echo ("<br><font color=\"#FF0000\">Saving hostlistAttributes failed!</font><br>"); if ($conf2->get_hostlistAttributes() != "#cn;#uid;#description") echo ("<br><font color=\"#FF0000\">Saving hostlistAttributes failed!</font><br>");
@ -114,10 +102,6 @@ $conf2->set_UserSuffix($Suff_users);
$conf2->set_GroupSuffix($Suff_groups); $conf2->set_GroupSuffix($Suff_groups);
$conf2->set_HostSuffix($Suff_hosts); $conf2->set_HostSuffix($Suff_hosts);
$conf2->set_DomainSuffix($Suff_domains); $conf2->set_DomainSuffix($Suff_domains);
$conf2->set_minUID($MinUID);
$conf2->set_maxUID($MaxUID);
$conf2->set_minMachine($MinMachine);
$conf2->set_maxMachine($MaxMachine);
$conf2->set_userlistAttributes($userlistAttributes); $conf2->set_userlistAttributes($userlistAttributes);
$conf2->set_grouplistAttributes($grouplistAttributes); $conf2->set_grouplistAttributes($grouplistAttributes);
$conf2->set_hostlistAttributes($hostlistAttributes); $conf2->set_hostlistAttributes($hostlistAttributes);