From: Michael Gapczynski Date: Sun, 15 Jul 2012 19:17:27 +0000 (-0400) Subject: Check if user is already logged in for DAV auth, instead of logging in and creating... X-Git-Tag: v4.0.6~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=89027545a05bddc11572b233dbcae92d905ec599;p=nextcloud-server.git Check if user is already logged in for DAV auth, instead of logging in and creating new sessions for every request --- diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php index ee680391626..99f696e3a07 100644 --- a/lib/connector/sabre/auth.php +++ b/lib/connector/sabre/auth.php @@ -31,13 +31,18 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { * @return bool */ protected function validateUserPass($username, $password){ - OC_Util::setUpFS();//login hooks may need early access to the filesystem - if(OC_User::login($username,$password)){ - OC_Util::setUpFS($username); + if (OC_User::isLoggedIn()) { + OC_Util::setupFS($username); return true; - } - else{ - return false; + } else { + OC_Util::setUpFS();//login hooks may need early access to the filesystem + if(OC_User::login($username,$password)){ + OC_Util::setUpFS($username); + return true; + } + else{ + return false; + } } } }