summaryrefslogtreecommitdiffstats
path: root/lib/connector/sabre/auth.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connector/sabre/auth.php')
-rw-r--r--lib/connector/sabre/auth.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php
index db8f005745a..6990d928cff 100644
--- a/lib/connector/sabre/auth.php
+++ b/lib/connector/sabre/auth.php
@@ -32,7 +32,7 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
*/
protected function validateUserPass($username, $password) {
if (OC_User::isLoggedIn()) {
- OC_Util::setupFS($username);
+ OC_Util::setupFS(OC_User::getUser());
return true;
} else {
OC_Util::setUpFS();//login hooks may need early access to the filesystem
@@ -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;
+ }
}