Skip to content
Snippets Groups Projects
Commit 46d8c0a2 authored by Vincent Petry's avatar Vincent Petry
Browse files

Merge pull request #11894 from owncloud/fix-unreachable-code

fix odd behaviour
parents fe9e6be3 56cf1d9d
No related branches found
No related tags found
No related merge requests found
...@@ -28,15 +28,17 @@ class OC_Connector_Sabre_Principal implements \Sabre\DAVACL\PrincipalBackend\Bac ...@@ -28,15 +28,17 @@ class OC_Connector_Sabre_Principal implements \Sabre\DAVACL\PrincipalBackend\Bac
foreach(OC_User::getUsers() as $user) { foreach(OC_User::getUsers() as $user) {
$user_uri = 'principals/'.$user; $user_uri = 'principals/'.$user;
$principals[] = array( $principal = array(
'uri' => $user_uri, 'uri' => $user_uri,
'{DAV:}displayname' => $user, '{DAV:}displayname' => $user,
); );
$email= \OCP\Config::getUserValue($user, 'settings', 'email'); $email= \OCP\Config::getUserValue($user, 'settings', 'email');
if($email) { if($email) {
$principals['{http://sabredav.org/ns}email-address'] = $email; $principal['{http://sabredav.org/ns}email-address'] = $email;
} }
$principals[] = $principal;
} }
} }
...@@ -56,15 +58,17 @@ class OC_Connector_Sabre_Principal implements \Sabre\DAVACL\PrincipalBackend\Bac ...@@ -56,15 +58,17 @@ class OC_Connector_Sabre_Principal implements \Sabre\DAVACL\PrincipalBackend\Bac
if ($prefix == 'principals' && OC_User::userExists($name)) { if ($prefix == 'principals' && OC_User::userExists($name)) {
return array( $principal = array(
'uri' => 'principals/'.$name, 'uri' => 'principals/'.$name,
'{DAV:}displayname' => $name, '{DAV:}displayname' => $name,
); );
$email= \OCP\Config::getUserValue($user, 'settings', 'email'); $email= \OCP\Config::getUserValue($user, 'settings', 'email');
if($email) { if($email) {
$principals['{http://sabredav.org/ns}email-address'] = $email; $principal['{http://sabredav.org/ns}email-address'] = $email;
} }
return $principal;
} }
return null; 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