Commit cf84578c authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added option to prevent confirmation key one time use

parent 2d117daa
...@@ -99,4 +99,11 @@ define("EXPIRATION_DELAY", 180); ...@@ -99,4 +99,11 @@ define("EXPIRATION_DELAY", 180);
*/ */
define ("INVALID_CONFIRMATION_KEY", "ERROR"); define ("INVALID_CONFIRMATION_KEY", "ERROR");
/*
* Update confirmation key to INVALID_CONFIRMATION_KEY after correct use
*
* Default value: TRUE
*/
define("REMOVE_CONFIRMATION_KEY_AFTER_USE", TRUE);
?> ?>
...@@ -141,9 +141,11 @@ function is_key_matching($key, $account) { ...@@ -141,9 +141,11 @@ function is_key_matching($key, $account) {
return false; return false;
} }
// Key is one time only if (REMOVE_CONFIRMATION_KEY_AFTER_USE) {
$account->confirmation_key = INVALID_CONFIRMATION_KEY; // Key is one time only
$account->update(); $account->confirmation_key = INVALID_CONFIRMATION_KEY;
$account->update();
}
return true; return true;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment