diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-12-15 02:21:26 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-12-15 02:21:26 +0100 |
commit | 946d58eaa8f93eb612a277fad1d7f870554b578e (patch) | |
tree | 18ad2ac0c504eb283d70c040ce449b259d88f97f /lib/connector | |
parent | 7969d6e64617235744889df42d0e671085a779a8 (diff) | |
parent | 6ff38624a717316d7992c81db6d4dbf8f5d86f3a (diff) | |
download | nextcloud-server-946d58eaa8f93eb612a277fad1d7f870554b578e.tar.gz nextcloud-server-946d58eaa8f93eb612a277fad1d7f870554b578e.zip |
merge master into filesystem
Diffstat (limited to 'lib/connector')
-rw-r--r-- | lib/connector/sabre/auth.php | 17 | ||||
-rw-r--r-- | lib/connector/sabre/quotaplugin.php | 2 |
2 files changed, 17 insertions, 2 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; + } } diff --git a/lib/connector/sabre/quotaplugin.php b/lib/connector/sabre/quotaplugin.php index a56a65ad863..fbbb4a3cf6f 100644 --- a/lib/connector/sabre/quotaplugin.php +++ b/lib/connector/sabre/quotaplugin.php @@ -51,7 +51,7 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { } list($parentUri, $newName) = Sabre_DAV_URLUtil::splitPath($uri); if ($length > OC_Filesystem::free_space($parentUri)) { - throw new Sabre_DAV_Exception('Quota exceeded. File is too big.'); + throw new Sabre_DAV_Exception_InsufficientStorage(); } } return true; |