Privacy/GDPR friendly version (removed: Social, Gravatar, Facebook, Google, Twitter, DropBox, OwnCloud)

Also removed: POP3, OAuth2 and update feature
Added: admin password_hash/password_verify
Requires: PHP 7.3+
Replaced: CRLF with LF
Replaced: pclZip with ZipArchive
This commit is contained in:
djmaze 2020-03-09 17:04:17 +01:00
parent 15ceddc202
commit 2cada68f41
293 changed files with 23728 additions and 85420 deletions

View file

@ -19,42 +19,24 @@ class ChangePassword extends \RainLoop\Providers\AbstractProvider
*/
private $bCheckWeak;
/**
* @param \RainLoop\Actions $oActions
* @param \RainLoop\Providers\ChangePassword\ChangePasswordInterface|null $oDriver = null
* @param bool $bCheckWeak = true
*
* @return void
*/
public function __construct($oActions, $oDriver = null, $bCheckWeak = true)
public function __construct(\RainLoop\Actions $oActions, ?\RainLoop\Providers\ChangePassword\ChangePasswordInterface $oDriver = null, bool $bCheckWeak = true)
{
$this->oActions = $oActions;
$this->oDriver = $oDriver;
$this->bCheckWeak = !!$bCheckWeak;
$this->bCheckWeak = $bCheckWeak;
}
/**
* @param \RainLoop\Account $oAccount
*
* @return bool
*/
public function PasswordChangePossibility($oAccount)
public function PasswordChangePossibility(\RainLoop\Model\Account $oAccount) : bool
{
return $this->IsActive() &&
$oAccount instanceof \RainLoop\Account &&
$this->oDriver && $this->oDriver->PasswordChangePossibility($oAccount)
;
}
/**
* @param \RainLoop\Account $oAccount
* @param string $sPrevPassword
* @param string $sNewPassword
*/
public function ChangePassword(\RainLoop\Account $oAccount, $sPrevPassword, $sNewPassword)
public function ChangePassword(\RainLoop\Model\Account $oAccount, string $sPrevPassword, string $sNewPassword)
{
$mResult = false;
if ($this->oDriver instanceof \RainLoop\Providers\ChangePassword\ChangePasswordInterface &&
$this->PasswordChangePossibility($oAccount))
{
@ -92,10 +74,7 @@ class ChangePassword extends \RainLoop\Providers\AbstractProvider
return $mResult;
}
/**
* @return bool
*/
public function IsActive()
public function IsActive() : bool
{
return $this->oDriver instanceof \RainLoop\Providers\ChangePassword\ChangePasswordInterface;
}