nextcloud/lib/connector/sabre/auth.php

36 lines
1.0 KiB
PHP
Raw Normal View History

2011-07-20 18:36:36 +04:00
<?php
/**
* HTTP Basic authentication backend class
*
* This class can be used by authentication objects wishing to use HTTP Basic
* Most of the digest logic is handled, implementors just need to worry about
* the validateUserPass method.
*
* @package Sabre
* @subpackage DAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author James David Low (http://jameslow.com/)
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
2011-07-22 16:38:42 +04:00
class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
2011-07-20 18:36:36 +04:00
/**
* Validates a username and password
*
* This method should return true or false depending on if login
* succeeded.
*
* @return bool
*/
protected function validateUserPass($username, $password){
OC_Util::setUpFS();//login hooks may need early access to the filesystem
2011-07-29 23:36:03 +04:00
if(OC_User::login($username,$password)){
OC_Util::setUpFS();
2011-07-20 18:36:36 +04:00
return true;
}
else{
return false;
}
}
}