*/\r
public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {\r
$displayNames = '';
- /*
-
- SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo\r
- FROM Persons\r
- INNER JOIN Orders\r
- ON Persons.P_Id=Orders.P_Id\r
- ORDER BY Persons.LastName
- */
+
$stmt = OC_DB::prepare('SELECT `*PREFIX*users`.`uid`, `*PREFIX*users`.`displayname` FROM `*PREFIX*users` INNER JOIN `*PREFIX*group_user` ON `*PREFIX*group_user`.`uid` = `*PREFIX*users`.`uid` WHERE `gid` = ? AND `*PREFIX*group_user.uid` LIKE ?', $limit, $offset);\r
$result = $stmt->execute(array($gid, $search.'%'));\r
$users = array();\r
while ($row = $result->fetchRow()) {
$displayName = trim($row['displayname'], ' ');\r
$displayNames[$row['uid']] = empty($displayName) ? $row['uid'] : $displayName;\r
- }\r
+ } \r
return $displayNames;\r
}
}