summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-31 13:24:42 +0100
committerVincent Petry <pvince81@owncloud.com>2014-10-31 13:24:42 +0100
commitfd4b97d75891232f4f07a0df103e9b1aec9b72fd (patch)
treebc8cabb4d9f7deb2c873191f305228fcdbbb53c2 /lib
parente0528c7598bc98ae951f4a6a44b126bbfabd8f3b (diff)
parentcbd130bed0164095ab3432b9c92111fad8a9f7ac (diff)
downloadnextcloud-server-fd4b97d75891232f4f07a0df103e9b1aec9b72fd.tar.gz
nextcloud-server-fd4b97d75891232f4f07a0df103e9b1aec9b72fd.zip
Merge pull request #9044 from owncloud/add-missing-email-principal
adding missing email address for principal
Diffstat (limited to 'lib')
-rw-r--r--lib/private/connector/sabre/principal.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/principal.php b/lib/private/connector/sabre/principal.php
index 9bad3b9df16..c674e2aa779 100644
--- a/lib/private/connector/sabre/principal.php
+++ b/lib/private/connector/sabre/principal.php
@@ -26,11 +26,17 @@ class OC_Connector_Sabre_Principal implements \Sabre\DAVACL\PrincipalBackend\Bac
if ($prefixPath == 'principals') {
foreach(OC_User::getUsers() as $user) {
+
$user_uri = 'principals/'.$user;
$principals[] = array(
'uri' => $user_uri,
'{DAV:}displayname' => $user,
);
+
+ $email= \OCP\Config::getUserValue($user, 'settings', 'email');
+ if($email) {
+ $principals['{http://sabredav.org/ns}email-address'] = $email;
+ }
}
}
@@ -49,10 +55,16 @@ class OC_Connector_Sabre_Principal implements \Sabre\DAVACL\PrincipalBackend\Bac
list($prefix, $name) = explode('/', $path);
if ($prefix == 'principals' && OC_User::userExists($name)) {
+
return array(
'uri' => 'principals/'.$name,
'{DAV:}displayname' => $name,
);
+
+ $email= \OCP\Config::getUserValue($user, 'settings', 'email');
+ if($email) {
+ $principals['{http://sabredav.org/ns}email-address'] = $email;
+ }
}
return null;