Merge branch 'master' into php81

This commit is contained in:
the-djmaze 2024-02-27 23:19:18 +01:00
commit 0985df857c
81 changed files with 1015 additions and 741 deletions

View file

@ -120,25 +120,14 @@ class Application extends \RainLoop\Config\AbstractConfig
parent::Set($sSectionKey, $sParamKey, $mParamValue);
}
public function SetPassword(
#[\SensitiveParameter]
string $sPassword
) : void
public function SetPassword(\SnappyMail\SensitiveString $oPassword) : void
{
$this->Set('security', 'admin_password', \password_hash($sPassword, PASSWORD_DEFAULT));
$this->Set('security', 'admin_password', \password_hash($oPassword, PASSWORD_DEFAULT));
}
public function ValidatePassword(
#[\SensitiveParameter]
string $sPassword
) : bool
public function ValidatePassword(\SnappyMail\SensitiveString $oPassword) : bool
{
$sConfigPassword = (string) $this->Get('security', 'admin_password', '');
if (32 == \strlen($sPassword) && \md5(APP_SALT.$sPassword.APP_SALT) === $sConfigPassword) {
$this->SetPassword($sPassword);
return true;
}
return \strlen($sPassword) && \password_verify($sPassword, $sConfigPassword);
return \strlen($oPassword) && \password_verify($oPassword, $this->Get('security', 'admin_password', ''));
}
public function Save() : bool