]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix odd behaviour
authorMorris Jobke <hey@morrisjobke.de>
Fri, 31 Oct 2014 17:46:47 +0000 (18:46 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 31 Oct 2014 17:46:47 +0000 (18:46 +0100)
lib/private/connector/sabre/principal.php

index c674e2aa779df692d7d7f21b2e3f4d17cecbec29..fe17fb991caaefe5fff76c93267f473ff5b30491 100644 (file)
@@ -28,15 +28,17 @@ class OC_Connector_Sabre_Principal implements \Sabre\DAVACL\PrincipalBackend\Bac
                        foreach(OC_User::getUsers() as $user) {
 
                                $user_uri = 'principals/'.$user;
-                               $principals[] = array(
+                               $principal = array(
                                        'uri' => $user_uri,
                                        '{DAV:}displayname' => $user,
                                );
 
                                $email= \OCP\Config::getUserValue($user, 'settings', '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
 
                if ($prefix == 'principals' && OC_User::userExists($name)) {
 
-                       return array(
+                       $principal = array(
                                'uri' => 'principals/'.$name,
                                '{DAV:}displayname' => $name,
                        );
 
                        $email= \OCP\Config::getUserValue($user, 'settings', 'email');
                        if($email) {
-                               $principals['{http://sabredav.org/ns}email-address'] = $email;
+                               $principal['{http://sabredav.org/ns}email-address'] = $email;
                        }
+
+                       return $principal;
                }
 
                return null;