summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre/principal.php
diff options
context:
space:
mode:
authorlibasys <sebastian.doell@libasys.de>2014-05-27 10:38:56 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-10-24 11:12:23 +0200
commitcbd130bed0164095ab3432b9c92111fad8a9f7ac (patch)
treeb6aa7362277b430d5aacd336c4fe9b100c2dbfc7 /lib/private/connector/sabre/principal.php
parent9babcfb9e22cb09f0d0af759b6491c45ff2f2278 (diff)
downloadnextcloud-server-cbd130bed0164095ab3432b9c92111fad8a9f7ac.tar.gz
nextcloud-server-cbd130bed0164095ab3432b9c92111fad8a9f7ac.zip
adding missing email address for principal
* fix #8515 * add mail only if it exists
Diffstat (limited to 'lib/private/connector/sabre/principal.php')
-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;