Merge pull request #2084 from owncloud/fix-group-displaynames

Fix #2074 by initializing  as an array
This commit is contained in:
Bernhard Posselt 2013-03-04 11:12:34 -08:00
commit ee00ddeb60
2 changed files with 7 additions and 7 deletions

View file

@ -142,14 +142,14 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
* @param int $offset
* @return array with display names (value) and user ids (key)
*/
public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$displayNames = '';
public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$displayNames = array();
$users = $this->usersInGroup($gid, $search, $limit, $offset);
foreach ( $users as $user ) {
$DisplayNames[$user] = $user;
foreach ($users as $user) {
$displayNames[$user] = $user;
}
return $DisplayNames;
return $displayNames;
}
}

View file

@ -219,8 +219,8 @@ class OC_Group_Database extends OC_Group_Backend {
* @param int $offset
* @return array with display names (value) and user ids (key)
*/
public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$displayNames = '';
public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$displayNames = array();
$stmt = OC_DB::prepare('SELECT `*PREFIX*users`.`uid`, `*PREFIX*users`.`displayname`'
.' FROM `*PREFIX*users`'