2014-08-31 04:04:11 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ChangePasswordExampleDriver implements \RainLoop\Providers\ChangePassword\ChangePasswordInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $sAllowedEmails = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $sAllowedEmails
|
|
|
|
*
|
|
|
|
* @return \ChangePasswordExampleDriver
|
|
|
|
*/
|
|
|
|
public function SetAllowedEmails($sAllowedEmails)
|
|
|
|
{
|
|
|
|
$this->sAllowedEmails = $sAllowedEmails;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-15 04:23:46 +08:00
|
|
|
* @param \RainLoop\Model\Account $oAccount
|
2014-08-31 04:04:11 +08:00
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function PasswordChangePossibility($oAccount)
|
|
|
|
{
|
|
|
|
return $oAccount && $oAccount->Email() &&
|
|
|
|
\RainLoop\Plugins\Helper::ValidateWildcardValues($oAccount->Email(), $this->sAllowedEmails);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-15 04:23:46 +08:00
|
|
|
* @param \RainLoop\Model\Account $oAccount
|
2014-08-31 04:04:11 +08:00
|
|
|
* @param string $sPrevPassword
|
|
|
|
* @param string $sNewPassword
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function ChangePassword(\RainLoop\Account $oAccount, $sPrevPassword, $sNewPassword)
|
|
|
|
{
|
|
|
|
$bResult = false;
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
return $bResult;
|
|
|
|
}
|
2013-11-20 20:26:00 +08:00
|
|
|
}
|