summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-30 13:41:42 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-02 09:14:41 +0100
commit7c8a84e7ac31a0f4c1d59ad1c13ca0c5cce65d8e (patch)
tree95fec874cf7547bdb7a4cd557304d85a1e7aae14 /apps
parent079ae9b7a97a25497e0692dfc31eae831439f4f1 (diff)
downloadnextcloud-server-7c8a84e7ac31a0f4c1d59ad1c13ca0c5cce65d8e.tar.gz
nextcloud-server-7c8a84e7ac31a0f4c1d59ad1c13ca0c5cce65d8e.zip
Add user's email address to vCard
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/command/syncsystemaddressbook.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/dav/command/syncsystemaddressbook.php b/apps/dav/command/syncsystemaddressbook.php
index 460d398a8b7..acf9e869d09 100644
--- a/apps/dav/command/syncsystemaddressbook.php
+++ b/apps/dav/command/syncsystemaddressbook.php
@@ -34,6 +34,7 @@ class SyncSystemAddressBook extends Command {
/**
* @param IUserManager $userManager
* @param IDBConnection $dbConnection
+ * @param IConfig $config
*/
function __construct(IUserManager $userManager, IDBConnection $dbConnection, IConfig $config) {
parent::__construct();
@@ -70,7 +71,7 @@ class SyncSystemAddressBook extends Command {
$name = $user->getBackendClassName();
$userId = $user->getUID();
$displayName = $user->getDisplayName();
- //$emailAddress = $user->getEMailAddress();
+ $emailAddress = $user->getEMailAddress();
$image = $user->getAvatarImage(-1);
$cardId = "$name:$userId.vcf";
@@ -79,7 +80,7 @@ class SyncSystemAddressBook extends Command {
$vCard = new VCard();
$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, 'EMAIL', $emailAddress));
if ($image) {
$vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]);
}
@@ -92,6 +93,10 @@ class SyncSystemAddressBook extends Command {
$vCard->FN = new Text($vCard, 'FN', $displayName);
$updated = true;
}
+ if($vCard->EMail !== $emailAddress) {
+ $vCard->FN = new Text($vCard, 'EMAIL', $emailAddress);
+ $updated = true;
+ }
if ($updated) {
$this->backend->updateCard($systemAddressBook['id'], $cardId, $vCard->serialize());
}