summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-30 13:57:54 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-02 09:14:41 +0100
commitdf6fc6cc70ceb06e0b9d8a7ff9ce4cbf2f74e710 (patch)
tree37679559a66256e7d3457d5a93d2534d2e34aa44 /apps
parent7c8a84e7ac31a0f4c1d59ad1c13ca0c5cce65d8e (diff)
downloadnextcloud-server-df6fc6cc70ceb06e0b9d8a7ff9ce4cbf2f74e710.tar.gz
nextcloud-server-df6fc6cc70ceb06e0b9d8a7ff9ce4cbf2f74e710.zip
Add the user's cloud id to the vCard
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/command/syncsystemaddressbook.php6
-rw-r--r--apps/files_sharing/lib/helper.php16
-rw-r--r--apps/files_sharing/settings-personal.php4
3 files changed, 7 insertions, 19 deletions
diff --git a/apps/dav/command/syncsystemaddressbook.php b/apps/dav/command/syncsystemaddressbook.php
index acf9e869d09..74d8295e77b 100644
--- a/apps/dav/command/syncsystemaddressbook.php
+++ b/apps/dav/command/syncsystemaddressbook.php
@@ -49,6 +49,10 @@ class SyncSystemAddressBook extends Command {
->setDescription('Synchronizes users to the system addressbook');
}
+ /**
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ */
protected function execute(InputInterface $input, OutputInterface $output) {
$principalBackend = new Principal(
$this->config,
@@ -72,6 +76,7 @@ class SyncSystemAddressBook extends Command {
$userId = $user->getUID();
$displayName = $user->getDisplayName();
$emailAddress = $user->getEMailAddress();
+ $cloudId = $user->getCloudId();
$image = $user->getAvatarImage(-1);
$cardId = "$name:$userId.vcf";
@@ -81,6 +86,7 @@ class SyncSystemAddressBook extends Command {
$vCard->add(new Text($vCard, 'UID', $userId));
$vCard->add(new Text($vCard, 'FN', $displayName));
$vCard->add(new Text($vCard, 'EMAIL', $emailAddress));
+ $vCard->add(new Text($vCard, 'CLOUD', $cloudId));
if ($image) {
$vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]);
}
diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php
index a804737c490..391b491e1ff 100644
--- a/apps/files_sharing/lib/helper.php
+++ b/apps/files_sharing/lib/helper.php
@@ -310,20 +310,4 @@ class Helper {
\OC::$server->getConfig()->setSystemValue('share_folder', $shareFolder);
}
- /**
- * remove protocol from URL
- *
- * @param string $url
- * @return string
- */
- public static function removeProtocolFromUrl($url) {
- if (strpos($url, 'https://') === 0) {
- return substr($url, strlen('https://'));
- } else if (strpos($url, 'http://') === 0) {
- return substr($url, strlen('http://'));
- }
-
- return $url;
- }
-
}
diff --git a/apps/files_sharing/settings-personal.php b/apps/files_sharing/settings-personal.php
index deaa7b92ac7..85fad9c3eaf 100644
--- a/apps/files_sharing/settings-personal.php
+++ b/apps/files_sharing/settings-personal.php
@@ -32,9 +32,7 @@ if (count($matches) > 0 && $matches[1] <= 9) {
$isIE8 = true;
}
-$uid = \OC::$server->getUserSession()->getUser()->getUID();
-$server = \OC::$server->getURLGenerator()->getAbsoluteURL('/');
-$cloudID = $uid . '@' . rtrim(\OCA\Files_Sharing\Helper::removeProtocolFromUrl($server), '/');
+$cloudID = \OC::$server->getUserSession()->getUser()->getCloudId();
$url = 'https://owncloud.org/federation#' . $cloudID;
$ownCloudLogoPath = \OC::$server->getURLGenerator()->imagePath('core', 'logo-icon.svg');