2013-12-20 07:28:03 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace RainLoop\SabreDAV;
|
|
|
|
|
|
|
|
class AuthBasic extends \Sabre\DAV\Auth\Backend\AbstractBasic
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var \RainLoop\Providers\PersonalAddressBook
|
|
|
|
*/
|
|
|
|
private $oPersonalAddressBook;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \RainLoop\Providers\PersonalAddressBook $oPersonalAddressBook
|
|
|
|
*/
|
|
|
|
public function __construct($oPersonalAddressBook)
|
|
|
|
{
|
|
|
|
$this->oPersonalAddressBook = $oPersonalAddressBook;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $sUserName
|
|
|
|
* @param string $sPassword
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
protected function validateUserPass($sUserName, $sPassword)
|
|
|
|
{
|
|
|
|
return $sPassword === $this->oPersonalAddressBook->GetUserHashByEmail($sUserName, true);
|
|
|
|
}
|
|
|
|
}
|