Check if user is already logged in for DAV auth, instead of logging in and creating new sessions for every request

This commit is contained in:
Michael Gapczynski 2012-07-15 15:17:27 -04:00
parent 01f25119d5
commit 89027545a0
1 changed files with 11 additions and 6 deletions

View File

@ -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;
}
}
}
}