From 12e42751ceda4af320c654ed08bd07211fb82619 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 9 Jan 2011 14:45:12 +0000 Subject: [PATCH] fixed PHP notices --- lam/lib/modules/posixAccount.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index ef411517..4d212c1d 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -656,7 +656,7 @@ class posixAccount extends baseModule implements passwordService { $errorMessage[] = array($this->orig['gidNumber'][0], $this->orig['uidNumber'][0], $_POST['gidNumber']); $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[] = array($this->orig['uidNumber'][0], $_POST['uidNumber']); $errors[] = $errorMessage; @@ -716,7 +716,7 @@ class posixAccount extends baseModule implements passwordService { $uids = $this->getUIDs(); if ($this->attributes['uidNumber'][0]=='') { // 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 $newUID = $this->getNextUIDs(1, $errors); if (is_array($newUID)) { @@ -981,7 +981,11 @@ class posixAccount extends baseModule implements passwordService { $return->addElement($homeServerContainer); $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 if (checkIfWriteAccessIsAllowed() && isset($this->attributes['userPassword'][0])) {