]> source.dussan.org Git - nextcloud-server.git/commitdiff
implement getCurrentUser in Sabre Auth Connector, fixes #508
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 13 Dec 2012 00:30:34 +0000 (01:30 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Fri, 14 Dec 2012 00:06:09 +0000 (01:06 +0100)
lib/connector/sabre/auth.php

index 4224dbbb14eca05f9fbf8cada70a3155ab956d35..6990d928cffee9d462e08cb8d2c6de2c615fc571 100644 (file)
@@ -45,4 +45,19 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
                        }
                }
        }
+
+       /**
+        * Returns information about the currently logged in username.
+        *
+        * If nobody is currently logged in, this method should return null.
+        *
+        * @return string|null
+        */
+       public function getCurrentUser() {
+               $user = OC_User::getUser();
+               if(!$user) {
+                       return null;
+               }
+               return $user;
+       }
 }