19 declare(strict_types=1);
51 $query = $this->db->queryF(
52 'SELECT count(*) as cnt FROM `' . self::TABLE_NAME .
'`' . PHP_EOL
53 .
'WHERE `usr_id` = %s' . PHP_EOL
54 .
'AND `status` = %s' . PHP_EOL
55 .
'AND `created_ts` >= %s',
63 ChangeMailStatus::EmailConfirmation->value,
64 time() - ChangeMailStatus::EmailConfirmation->getValidity($this->
settings)
68 $result = $this->db->fetchObject($query);
70 if ($result->cnt > 0) {
79 $query = $this->db->queryF(
80 'SELECT * FROM `' . self::TABLE_NAME .
'` WHERE `token` = %s',
85 $result = $this->db->fetchObject($query);
87 if ($result ===
null) {
100 if (!
$token->isTokenValidForCurrentStatus($this->settings)) {
123 $query =
'DELETE FROM `' . self::TABLE_NAME .
'` WHERE `token` = %s';
130 ChangeMailStatus::Login->getValidity($this->
settings),
131 ChangeMailStatus::EmailConfirmation->getValidity($this->
settings)
133 $query =
'DELETE FROM `' . self::TABLE_NAME .
'` WHERE `created_ts` < %s';
142 'token' => [
'text', $token->
getToken()]
getTokenForTokenString(string $token_string, \ilObjUser $user)
This Function will check if the token is actually valid for the given user before returning the new e...
hasUserValidEmailConfirmationToken(\ilObjUser $user)
getNewTokenForUser(\ilObjUser $user, string $new_email, int $now)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(private readonly \ilDBInterface $db, private readonly \ilSetting $settings)
moveToNextStep(ChangeMailToken $token, int $now)
deleteEntryByToken(string $token)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
storeChangeMailToken(ChangeMailToken $token)