do not check UID/GID for existing accounts
This commit is contained in:
parent
8eff004b83
commit
1f6e60114d
|
@ -758,17 +758,19 @@ class posixAccount extends baseModule {
|
||||||
// old account -> return id-number which has been used
|
// old account -> return id-number which has been used
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Check manual ID
|
// check manual ID
|
||||||
// id-number is out of valid range
|
if ($this->getAccountContainer()->isNewAccount || !isset($this->orig['uidNumber'][0]) || ($this->orig['uidNumber'][0] != $this->attributes['uidNumber'][0])) {
|
||||||
if (!is_numeric($this->attributes['uidNumber'][0]) || ($this->attributes['uidNumber'][0] < $minID) || ($this->attributes['uidNumber'][0] > $maxID)) $errors[] = array('ERROR', _('ID-Number'), sprintf(_('Please enter a value between %s and %s!'), $minID, $maxID));
|
// check range
|
||||||
// $uids is allways an array but not if no entries were found
|
if (!is_numeric($this->attributes['uidNumber'][0]) || ($this->attributes['uidNumber'][0] < $minID) || ($this->attributes['uidNumber'][0] > $maxID)) $errors[] = array('ERROR', _('ID-Number'), sprintf(_('Please enter a value between %s and %s!'), $minID, $maxID));
|
||||||
if (is_array($uids)) {
|
// $uids is always an array but not if no entries were found
|
||||||
// id-number is in use and account is a new account
|
if (is_array($uids)) {
|
||||||
if ((in_array($this->attributes['uidNumber'][0], $uids)) && $this->orig['uidNumber'][0]=='') $errors[] = array('ERROR', _('ID-Number'), _('ID is already in use'));
|
// id-number is in use and account is a new account
|
||||||
// id-number is in use, account is existing account and id-number is not used by itself
|
if ((in_array($this->attributes['uidNumber'][0], $uids)) && $this->orig['uidNumber'][0]=='') $errors[] = array('ERROR', _('ID-Number'), _('ID is already in use'));
|
||||||
if ((in_array($this->attributes['uidNumber'][0], $uids)) && $this->orig['uidNumber'][0]!='' && ($this->orig['uidNumber'][0] != $this->attributes['uidNumber'][0]) ) {
|
// id-number is in use, account is existing account and id-number is not used by itself
|
||||||
$errors[] = $this->messages['uidNumber'][3];
|
if ((in_array($this->attributes['uidNumber'][0], $uids)) && $this->orig['uidNumber'][0]!='' && ($this->orig['uidNumber'][0] != $this->attributes['uidNumber'][0]) ) {
|
||||||
$this->attributes['uidNumber'][0] = $this->orig['uidNumber'][0];
|
$errors[] = $this->messages['uidNumber'][3];
|
||||||
|
$this->attributes['uidNumber'][0] = $this->orig['uidNumber'][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -568,23 +568,25 @@ class posixGroup extends baseModule {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Check manual ID
|
// Check manual ID
|
||||||
// id-number is out of valid range
|
if ($this->getAccountContainer()->isNewAccount || !isset($this->orig['gidNumber'][0]) || ($this->orig['gidNumber'][0] != $this->attributes['gidNumber'][0])) {
|
||||||
if (($this->attributes['gidNumber'][0] < $minID) || ($this->attributes['gidNumber'][0] > $maxID) || !is_numeric($this->attributes['gidNumber'][0])) {
|
// check range
|
||||||
$errors[] = array('ERROR', _('ID-Number'), sprintf(_('Please enter a value between %s and %s!'), $minID, $maxID));
|
if (($this->attributes['gidNumber'][0] < $minID) || ($this->attributes['gidNumber'][0] > $maxID) || !is_numeric($this->attributes['gidNumber'][0])) {
|
||||||
if (isset($this->orig['gidNumber'][0])) $this->attributes['gidNumber'][0] = $this->orig['gidNumber'][0];
|
$errors[] = array('ERROR', _('ID-Number'), sprintf(_('Please enter a value between %s and %s!'), $minID, $maxID));
|
||||||
else unset($this->attributes['gidNumber'][0]);
|
if (isset($this->orig['gidNumber'][0])) $this->attributes['gidNumber'][0] = $this->orig['gidNumber'][0];
|
||||||
}
|
else unset($this->attributes['gidNumber'][0]);
|
||||||
// $uids is allways an array but not if no entries were found
|
|
||||||
if (is_array($gids)) {
|
|
||||||
// id-number is in use and account is a new account
|
|
||||||
if ((in_array($this->attributes['gidNumber'][0], $gids)) && $this->orig['gidNumber'][0]=='') {
|
|
||||||
$errors[] = array('ERROR', _('ID-Number'), _('ID is already in use'));
|
|
||||||
unset($this->attributes['gidNumber'][0]);
|
|
||||||
}
|
}
|
||||||
// id-number is in use, account is existing account and id-number is not used by itself
|
// $uids is allways an array but not if no entries were found
|
||||||
if ((in_array($this->attributes['gidNumber'][0], $gids)) && $this->orig['gidNumber'][0]!='' && ($this->orig['gidNumber'][0] != $this->attributes['gidNumber'][0]) ) {
|
if (is_array($gids)) {
|
||||||
$errors[] = $this->messages['gidNumber'][4];
|
// id-number is in use and account is a new account
|
||||||
$this->attributes['gidNumber'][0] = $this->orig['gidNumber'][0];
|
if ((in_array($this->attributes['gidNumber'][0], $gids)) && $this->orig['gidNumber'][0]=='') {
|
||||||
|
$errors[] = array('ERROR', _('ID-Number'), _('ID is already in use'));
|
||||||
|
unset($this->attributes['gidNumber'][0]);
|
||||||
|
}
|
||||||
|
// id-number is in use, account is existing account and id-number is not used by itself
|
||||||
|
if ((in_array($this->attributes['gidNumber'][0], $gids)) && $this->orig['gidNumber'][0]!='' && ($this->orig['gidNumber'][0] != $this->attributes['gidNumber'][0]) ) {
|
||||||
|
$errors[] = $this->messages['gidNumber'][4];
|
||||||
|
$this->attributes['gidNumber'][0] = $this->orig['gidNumber'][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue