summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/ajax/share.php2
-rw-r--r--lib/user/database.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 231cdc5e242..6704a00c5a2 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -164,7 +164,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
$users = OC_User::getDisplayNames($_GET['search'], $limit, $offset);
}
$offset += $limit;
- foreach ($users as $displayName => $uid) {
+ foreach ($users as $uid => $displayName) {
if ((!isset($_GET['itemShares']) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $uid != OC_User::getUser()) {
$shareWith[] = array('label' => $displayName, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $uid));
$count++;
diff --git a/lib/user/database.php b/lib/user/database.php
index bed97f25fdb..7deeb0c4697 100644
--- a/lib/user/database.php
+++ b/lib/user/database.php
@@ -155,7 +155,7 @@ class OC_User_Database extends OC_User_Backend {
*/
public function getDisplayNames($search = '', $limit = null, $offset = null) {
$displayNames = array();
- $query = OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users` WHERE LOWER(`uid`) LIKE LOWER(?)', $limit, $offset);
+ $query = OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users` WHERE LOWER(`displayname`) LIKE LOWER(?)', $limit, $offset);
$result = $query->execute(array($search.'%'));
$users = array();
while ($row = $result->fetchRow()) {