fixed PHP notices

This commit is contained in:
Roland Gruber 2011-01-09 14:45:12 +00:00
parent 216cf67e31
commit 12e42751ce
1 changed files with 7 additions and 3 deletions

View File

@ -656,7 +656,7 @@ class posixAccount extends baseModule implements passwordService {
$errorMessage[] = array($this->orig['gidNumber'][0], $this->orig['uidNumber'][0], $_POST['gidNumber']); $errorMessage[] = array($this->orig['gidNumber'][0], $this->orig['uidNumber'][0], $_POST['gidNumber']);
$errors[] = $errorMessage; $errors[] = $errorMessage;
} }
if ($this->orig['uidNumber'][0]!='' && $_POST['uidNumber']!=$this->attributes['uidNumber'][0]) { if (isset($this->orig['uidNumber'][0]) && $this->orig['uidNumber'][0]!='' && $_POST['uidNumber']!=$this->attributes['uidNumber'][0]) {
$errorMessage = $this->messages['uidNumber'][5]; $errorMessage = $this->messages['uidNumber'][5];
$errorMessage[] = array($this->orig['uidNumber'][0], $_POST['uidNumber']); $errorMessage[] = array($this->orig['uidNumber'][0], $_POST['uidNumber']);
$errors[] = $errorMessage; $errors[] = $errorMessage;
@ -716,7 +716,7 @@ class posixAccount extends baseModule implements passwordService {
$uids = $this->getUIDs(); $uids = $this->getUIDs();
if ($this->attributes['uidNumber'][0]=='') { if ($this->attributes['uidNumber'][0]=='') {
// No id-number given // No id-number given
if ($this->orig['uidNumber'][0]=='') { if (!isset($this->orig['uidNumber'][0]) || ($this->orig['uidNumber'][0] == '')) {
// new account -> we have to find a free id-number // new account -> we have to find a free id-number
$newUID = $this->getNextUIDs(1, $errors); $newUID = $this->getNextUIDs(1, $errors);
if (is_array($newUID)) { if (is_array($newUID)) {
@ -981,7 +981,11 @@ class posixAccount extends baseModule implements passwordService {
$return->addElement($homeServerContainer); $return->addElement($homeServerContainer);
$return->addElement(new htmlHelpLink('createhomedir'), true); $return->addElement(new htmlHelpLink('createhomedir'), true);
} }
$return->addElement(new htmlTableExtendedSelect('loginShell', $shelllist, array($this->attributes['loginShell'][0]), _('Login shell'), 'loginShell'), true); $selectedShell = array();
if (isset($this->attributes['loginShell'][0])) {
$selectedShell = array($this->attributes['loginShell'][0]);
}
$return->addElement(new htmlTableExtendedSelect('loginShell', $shelllist, $selectedShell, _('Login shell'), 'loginShell'), true);
} }
// password buttons // password buttons
if (checkIfWriteAccessIsAllowed() && isset($this->attributes['userPassword'][0])) { if (checkIfWriteAccessIsAllowed() && isset($this->attributes['userPassword'][0])) {