Implement account edit; add SessionHelper, PasswordHelper and ActionResult

This commit is contained in:
Lexi / Zoe 2021-08-15 17:40:35 +02:00
parent 32add30c9d
commit 6ace072841
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
15 changed files with 637 additions and 68 deletions

View file

@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace MailAccountAdmin\Common;
class PasswordHelper
{
public function hashPassword(string $password): string
{
return password_hash($password, PASSWORD_DEFAULT);
}
public function verifyPassword(string $password, string $hash): bool
{
return password_verify($password, $hash);
}
public function getPasswordHashType(string $passwordHash): string
{
if ($passwordHash === '') {
return 'empty';
}
$passwordHashInfo = password_get_info($passwordHash);
return $passwordHashInfo['algoName'] ?? 'unknown';
}
}