aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-12-13 01:30:34 +0100
committerArthur Schiwon <blizzz@owncloud.com>2012-12-14 01:06:09 +0100
commit627da205b32f0733e73e92c3c9702ed5b4f863f7 (patch)
treed85aa9aa4353c92a0327414ac9dce33afdba6287
parent4466e06e7d9413a27d462570066254e2d33d76ef (diff)
downloadnextcloud-server-627da205b32f0733e73e92c3c9702ed5b4f863f7.tar.gz
nextcloud-server-627da205b32f0733e73e92c3c9702ed5b4f863f7.zip
implement getCurrentUser in Sabre Auth Connector, fixes #508
-rw-r--r--lib/connector/sabre/auth.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php
index 4224dbbb14e..6990d928cff 100644
--- a/lib/connector/sabre/auth.php
+++ b/lib/connector/sabre/auth.php
@@ -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;
+ }
}