Skip to content

Commit 7cb199b

Browse files
committed
Add missing invalidateVerificationToken method
1 parent a09f4ce commit 7cb199b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/libraries/User.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,22 @@ public function getVerifierToken() {
475475
return $this->verifier_token;
476476
}
477477

478+
public static function invalidateVerificationToken() {
479+
if (!isset(Common::$database)) {
480+
Common::$database = DatabaseDriver::getDatabaseObject();
481+
}
482+
483+
$stmt = Common::$database->prepare(
484+
'UPDATE `users` SET `verifier_token` = NULL WHERE `id` = :id LIMIT 1;'
485+
);
486+
487+
$stmt->bindParam(':id', $this->id, PDO::PARAM_INT);
488+
$successful = $stmt->execute();
489+
490+
$stmt->closeCursor();
491+
return $successful;
492+
}
493+
478494
public function isDisabled() {
479495
return ($this->options_bitmask & self::OPTION_DISABLED);
480496
}

0 commit comments

Comments
 (0)