From 720fa6852c6cf380abc67d1806b997ec293951ce Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Tue, 12 May 2009 14:22:39 +0000 Subject: [PATCH] Fixed up function a little, untested --- .../include/ajax/functions/AdminUserGroups.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/webgui/include/ajax/functions/AdminUserGroups.php b/webgui/include/ajax/functions/AdminUserGroups.php index 24626e4c..dacec147 100644 --- a/webgui/include/ajax/functions/AdminUserGroups.php +++ b/webgui/include/ajax/functions/AdminUserGroups.php @@ -7,6 +7,8 @@ include_once("include/db.php"); function getAdminUserGroups($params) { global $db; + $i = 0; + # Filters and sorts are the same here $filtersorts = array( 'ID' => 'users_to_groups.GroupID', @@ -17,6 +19,9 @@ function getAdminUserGroups($params) { $res = DBDo("SELECT GroupID FROM users_to_groups WHERE UserID = ?",$params[0]); if ($res !== FALSE) { while ($row = $res->fetchObject()) { + + $i++; + $item = array(); $item['ID'] = $row->groupid; @@ -36,18 +41,7 @@ function getAdminUserGroups($params) { return $res; } - # loop through rows - while ($row = $sth->fetchObject()) { - $item = array(); - - $item['ID'] = $row->groupid; - $item['Name'] = $row->name; - - # push this row onto array - array_push($resultArray,$item); - } - - return array($resultArray,$numResults); + return array($resultArray,$i); } ?> -- GitLab