From 3d820bd98d07b3031e6b5a12fe425a31991a6d98 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 25 Mar 2005 12:54:04 +0000 Subject: [PATCH] fixed error handling in getNextGIDs() --- lam/lib/modules/posixGroup.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index fb7da4f7..02450cac 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -109,7 +109,8 @@ class posixGroup extends baseModule { } // fill in autoGIDs if (sizeof($needAutoGID) > 0) { - $gids = $this->getNextGIDs(sizeof($needAutoGID)); + $errorsTemp = array(); + $gids = $this->getNextGIDs(sizeof($needAutoGID), $errorsTemp); if (is_array($gids)) { for ($i = 0; $i < sizeof($needAutoGID); $i++) { $partialAccounts[$i]['gidNumber'] = $gids[$i]; @@ -510,7 +511,7 @@ class posixGroup extends baseModule { if ($this->attributes['gidNumber'][0]=='') { // No id-number given, find free GID if ($this->orig['gidNumber'][0]=='') { - $newGID = $this->getNextGIDs(1); + $newGID = $this->getNextGIDs(1, $triggered_messages); if (is_array($newGID)) { $this->attributes['gidNumber'][0] = $newGID[0]; } @@ -767,9 +768,10 @@ class posixGroup extends baseModule { * Returns one or more free GID numbers. * * @param integer $count Number of needed free GIDs. + * @param array $triggered_messages list of error messages where errors can be added * @return mixed Null if no GIDs are free else an array of free GIDs. */ - function getNextGIDs($count) { + function getNextGIDs($count, &$triggered_messages) { $ret = array(); $minID = intval($this->moduleSettings['posixGroup_minGID'][0]); $maxID = intval($this->moduleSettings['posixGroup_maxGID'][0]);