Skip to content
Snippets Groups Projects
Commit cbd130be authored by Sebastian Döll's avatar Sebastian Döll Committed by Morris Jobke
Browse files

adding missing email address for principal

* fix #8515
* add mail only if it exists
parent 9babcfb9
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment