mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
adjust braces style to match surrounding code
This commit is contained in:
parent
b77dcb5c12
commit
e9892ceec3
1 changed files with 10 additions and 5 deletions
|
|
@ -99,7 +99,8 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
*/
|
*/
|
||||||
public function SetPassword($sPassword)
|
public function SetPassword($sPassword)
|
||||||
{
|
{
|
||||||
if (function_exists('password_hash')) {
|
if (function_exists('password_hash'))
|
||||||
|
{
|
||||||
return $this->Set('security', 'admin_password', password_hash($sPassword, PASSWORD_DEFAULT));
|
return $this->Set('security', 'admin_password', password_hash($sPassword, PASSWORD_DEFAULT));
|
||||||
}
|
}
|
||||||
return $this->Set('security', 'admin_password', \md5(APP_SALT.$sPassword.APP_SALT));
|
return $this->Set('security', 'admin_password', \md5(APP_SALT.$sPassword.APP_SALT));
|
||||||
|
|
@ -115,14 +116,18 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
$sPassword = (string) $sPassword;
|
$sPassword = (string) $sPassword;
|
||||||
$sConfigPassword = (string) $this->Get('security', 'admin_password', '');
|
$sConfigPassword = (string) $this->Get('security', 'admin_password', '');
|
||||||
|
|
||||||
if (0 < strlen($sConfigPassword)) {
|
if (0 < strlen($sConfigPassword))
|
||||||
if (($sPassword === $sConfigPassword) && ('12345' === $sConfigPassword)) {
|
{
|
||||||
|
if (($sPassword === $sConfigPassword) && ('12345' === $sConfigPassword)) // password has not been set
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (32 == strlen($sConfigPassword)) { // legacy md5 hash
|
if (32 == strlen($sConfigPassword)) // legacy md5 hash
|
||||||
|
{
|
||||||
return (\md5(APP_SALT.$sPassword.APP_SALT) === $sConfigPassword);
|
return (\md5(APP_SALT.$sPassword.APP_SALT) === $sConfigPassword);
|
||||||
}
|
}
|
||||||
if (function_exists('password_verify')) {
|
if (function_exists('password_verify')) // secure hash
|
||||||
|
{
|
||||||
return password_verify($sPassword, $sConfigPassword);
|
return password_verify($sPassword, $sConfigPassword);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue