Implement account edit; add SessionHelper, PasswordHelper and ActionResult
This commit is contained in:
parent
32add30c9d
commit
6ace072841
15 changed files with 637 additions and 68 deletions
|
|
@ -13,4 +13,20 @@ class AliasRepository extends BaseRepository
|
|||
$statement->execute(['user_id' => $userId]);
|
||||
return $statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function checkAliasAvailable(string $mailAddress): bool
|
||||
{
|
||||
$statement = $this->pdo->prepare('SELECT 1 FROM mail_aliases WHERE mail_address = :mail_address LIMIT 1');
|
||||
$statement->execute(['mail_address' => $mailAddress]);
|
||||
return $statement->rowCount() === 0;
|
||||
}
|
||||
|
||||
public function createNewAlias(int $userId, string $mailAddress): void
|
||||
{
|
||||
$statement = $this->pdo->prepare('INSERT INTO mail_aliases (user_id, mail_address) VALUES (:user_id, :mail_address)');
|
||||
$statement->execute([
|
||||
'user_id' => $userId,
|
||||
'mail_address' => $mailAddress,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue