diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-08-29 15:17:37 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-08-31 11:59:57 +0200 |
commit | 8d786ec4567ece27edf960c625f5c350f4078d79 (patch) | |
tree | 36b4c3a4e2f6e824ccae8dca1208b806e0383533 /lib | |
parent | 9c4fe0bc3a615afa223f1923b148254d907b3d9b (diff) | |
download | nextcloud-server-8d786ec4567ece27edf960c625f5c350f4078d79.tar.gz nextcloud-server-8d786ec4567ece27edf960c625f5c350f4078d79.zip |
retrieve local users, groups and group members in a sorted way
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/group/database.php | 4 | ||||
-rw-r--r-- | lib/private/user/database.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/group/database.php b/lib/private/group/database.php index 92d209d3a7b..ff2c24ae9d7 100644 --- a/lib/private/group/database.php +++ b/lib/private/group/database.php @@ -168,7 +168,7 @@ class OC_Group_Database extends OC_Group_Backend { * Returns a list with all groups */ public function getGroups($search = '', $limit = null, $offset = null) { - $stmt = OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups` WHERE `gid` LIKE ?', $limit, $offset); + $stmt = OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups` WHERE `gid` LIKE ? ORDER BY `gid` ASC', $limit, $offset); $result = $stmt->execute(array('%' . $search . '%')); $groups = array(); while ($row = $result->fetchRow()) { @@ -200,7 +200,7 @@ class OC_Group_Database extends OC_Group_Backend { * @return array with user ids */ public function usersInGroup($gid, $search = '', $limit = null, $offset = null) { - $stmt = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*group_user` WHERE `gid` = ? AND `uid` LIKE ?', + $stmt = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*group_user` WHERE `gid` = ? AND `uid` LIKE ? ORDER BY `uid` ASC', $limit, $offset); $result = $stmt->execute(array($gid, '%'.$search.'%')); diff --git a/lib/private/user/database.php b/lib/private/user/database.php index 4fb7132fd57..0abb09748b9 100644 --- a/lib/private/user/database.php +++ b/lib/private/user/database.php @@ -155,7 +155,7 @@ class OC_User_Database extends OC_User_Backend { $displayNames = array(); $query = OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users`' . ' WHERE LOWER(`displayname`) LIKE LOWER(?) OR ' - . 'LOWER(`uid`) LIKE LOWER(?)', $limit, $offset); + . 'LOWER(`uid`) LIKE LOWER(?) ORDER BY `uid` ASC', $limit, $offset); $result = $query->execute(array('%' . $search . '%', '%' . $search . '%')); $users = array(); while ($row = $result->fetchRow()) { @@ -209,7 +209,7 @@ class OC_User_Database extends OC_User_Backend { * Get a list of all users. */ public function getUsers($search = '', $limit = null, $offset = null) { - $query = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users` WHERE LOWER(`uid`) LIKE LOWER(?)', $limit, $offset); + $query = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users` WHERE LOWER(`uid`) LIKE LOWER(?) ORDER BY `uid` ASC', $limit, $offset); $result = $query->execute(array('%' . $search . '%')); $users = array(); while ($row = $result->fetchRow()) { |