feature: mail confirmed reward

Suggested by @EPuncker
This commit is contained in:
slawkens
2023-02-03 14:39:09 +01:00
parent c318d3a9de
commit 43c197316a
6 changed files with 72 additions and 2 deletions

View File

@@ -23,6 +23,16 @@ if(!$res->rowCount()) {
}
else
{
$query = $db->query('SELECT id FROM accounts WHERE email_hash = ' . $db->quote($hash) . ' AND email_verified = 0');
if ($query->rowCount() == 1) {
$query = $query->fetch(PDO::FETCH_ASSOC);
$account = new OTS_Account();
$account->load($query['id']);
if ($account->isLoaded()) {
$hooks->trigger(HOOK_EMAIL_CONFIRMED, ['account' => $account]);
}
}
$db->update('accounts', array('email_verified' => '1'), array('email_hash' => $hash));
success('You have now verified your e-mail, this will increase the security of your account. Thank you for doing this.');
}