djmaze 2021-02-24 22:03:14 +01:00
parent 65b508364a
commit 1a82dde49b
30 changed files with 401 additions and 31 deletions

View file

@ -0,0 +1,36 @@
<?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;
}
public function isPossible(\RainLoop\Model\Account $oAccount) : bool
{
$sFoundedValue = '';
return $oAccount && $oAccount->Email() &&
\RainLoop\Plugins\Helper::ValidateWildcardValues($oAccount->Email(), $this->sAllowedEmails, $sFoundedValue);
}
public function ChangePassword(\RainLoop\Model\Account $oAccount, string $sPrevPassword, string $sNewPassword) : bool
{
$bResult = false;
// TODO
return $bResult;
}
}