summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-25 13:57:08 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-25 13:57:08 +0100
commite9a57e28fc9b87c0fd84de39a0e4cb305165a9d1 (patch)
tree0d932faa6412a7a779325835baa90c6b647377f1 /core
parent839f4bd94916d0673341528ffa8a2a7b3242bf46 (diff)
downloadnextcloud-server-e9a57e28fc9b87c0fd84de39a0e4cb305165a9d1.tar.gz
nextcloud-server-e9a57e28fc9b87c0fd84de39a0e4cb305165a9d1.zip
show display name instead of uid
Diffstat (limited to 'core')
-rw-r--r--core/ajax/share.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
index 077baa8ba56..231cdc5e242 100644
--- a/core/ajax/share.php
+++ b/core/ajax/share.php
@@ -72,6 +72,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
case 'email':
// read post variables
$user = OCP\USER::getUser();
+ $displayName = OCP\User::getDisplayName();
$type = $_POST['itemType'];
$link = $_POST['link'];
$file = $_POST['file'];
@@ -81,13 +82,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
$l = OC_L10N::get('core');
// setup the email
- $subject = (string)$l->t('User %s shared a file with you', $user);
+ $subject = (string)$l->t('User %s shared a file with you', $displayName);
if ($type === 'dir')
- $subject = (string)$l->t('User %s shared a folder with you', $user);
+ $subject = (string)$l->t('User %s shared a folder with you', $displayName);
- $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', array($user, $file, $link));
+ $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', array($displayName, $file, $link));
if ($type === 'dir')
- $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', array($user, $file, $link));
+ $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', array($displayName, $file, $link));
$default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply');
@@ -158,14 +159,14 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
while ($count < 4 && count($users) == $limit) {
$limit = 4 - $count;
if ($sharePolicy == 'groups_only') {
- $users = OC_Group::usersInGroups($groups, $_GET['search'], $limit, $offset);
+ $users = OC_Group::DisplayNamesInGroups($groups, $_GET['search'], $limit, $offset);
} else {
- $users = OC_User::getUsers($_GET['search'], $limit, $offset);
+ $users = OC_User::getDisplayNames($_GET['search'], $limit, $offset);
}
$offset += $limit;
- foreach ($users as $user) {
- if ((!isset($_GET['itemShares']) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($user, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $user != OC_User::getUser()) {
- $shareWith[] = array('label' => $user, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $user));
+ foreach ($users as $displayName => $uid) {
+ 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++;
}
}