From f29d7096bfc75f9fcee638759635106f0f4cb49c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 23 Sep 2006 09:50:29 +0000 Subject: [PATCH] added error message for wrong uid numbers in file upload --- lam/lib/modules/posixAccount.inc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 8d7bc03f..15c7060f 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -1126,15 +1126,27 @@ class posixAccount extends baseModule { $needAutoUID[] = $i; } elseif (get_preg($rawAccounts[$i][$ids['posixAccount_uid']], 'digit')) { - if (($this->get_scope() == 'user') && - ($rawAccounts[$i][$ids['posixAccount_uid']] > $this->moduleSettings['posixAccount_minUID'][0]) && - ($rawAccounts[$i][$ids['posixAccount_uid']] < $this->moduleSettings['posixAccount_maxUID'][0])) { - $partialAccounts[$i]['uidNumber'] = $rawAccounts[$i][$ids['posixAccount_uid']]; + if ($this->get_scope() == 'user') { + if (($rawAccounts[$i][$ids['posixAccount_uid']] > $this->moduleSettings['posixAccount_minUID'][0]) && + ($rawAccounts[$i][$ids['posixAccount_uid']] < $this->moduleSettings['posixAccount_maxUID'][0])) { + $partialAccounts[$i]['uidNumber'] = $rawAccounts[$i][$ids['posixAccount_uid']]; + } + else { + $errMsg = $this->messages['uidNumber'][4]; + array_push($errMsg, array($i)); + $errors[] = $errMsg; + } } - elseif (($this->get_scope() == 'host') && - ($rawAccounts[$i][$ids['posixAccount_uid']] > $this->moduleSettings['posixAccount_minMachine'][0]) && - ($rawAccounts[$i][$ids['posixAccount_uid']] < $this->moduleSettings['posixAccount_maxMachine'][0])) { - $partialAccounts[$i]['uidNumber'] = $rawAccounts[$i][$ids['posixAccount_uid']]; + elseif ($this->get_scope() == 'host') { + if (($rawAccounts[$i][$ids['posixAccount_uid']] > $this->moduleSettings['posixAccount_minMachine'][0]) && + ($rawAccounts[$i][$ids['posixAccount_uid']] < $this->moduleSettings['posixAccount_maxMachine'][0])) { + $partialAccounts[$i]['uidNumber'] = $rawAccounts[$i][$ids['posixAccount_uid']]; + } + else { + $errMsg = $this->messages['uidNumber'][4]; + array_push($errMsg, array($i)); + $errors[] = $errMsg; + } } } else {