|
@@ -57,7 +57,7 @@ if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'recover') {
|
57
|
57
|
|
58
|
58
|
if (!empty($_REQUEST['password'])) {
|
59
|
59
|
// If the user has entered a password.
|
60
|
|
- // If the user has not entered a password, $Reset is not set to 1, and the success message is not shown
|
|
60
|
+ // If the user has not entered a password, $PassWasReset is not set to 1, and the success message is not shown
|
61
|
61
|
$Err = $Validate->ValidateForm($_REQUEST);
|
62
|
62
|
if ($Err == '') {
|
63
|
63
|
// Form validates without error, set new secret and password.
|
|
@@ -77,7 +77,7 @@ if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'recover') {
|
77
|
77
|
(UserID, ChangerIP, ChangeTime)
|
78
|
78
|
VALUES
|
79
|
79
|
('$UserID', '".DBCrypt::encrypt($_SERVER['REMOTE_ADDR'])."', '".sqltime()."')");
|
80
|
|
- $Reset = true; // Past tense form of "to reset", meaning that password has now been reset
|
|
80
|
+ $PassWasReset = true;
|
81
|
81
|
$LoggedUser['ID'] = $UserID; // Set $LoggedUser['ID'] for logout_all_sessions() to work
|
82
|
82
|
logout_all_sessions();
|
83
|
83
|
|
|
@@ -85,7 +85,7 @@ if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'recover') {
|
85
|
85
|
}
|
86
|
86
|
|
87
|
87
|
// Either a form asking for them to enter the password
|
88
|
|
- // Or a success message if $Reset is 1
|
|
88
|
+ // Or a success message if $PassWasReset is 1
|
89
|
89
|
require('recover_step2.php');
|
90
|
90
|
|
91
|
91
|
} else {
|
|
@@ -193,7 +193,7 @@ else {
|
193
|
193
|
|
194
|
194
|
// Function to log a user's login attempt
|
195
|
195
|
function log_attempt() {
|
196
|
|
- global $DB, $Cache, $Attempts;
|
|
196
|
+ global $Cache, $Attempts;
|
197
|
197
|
$Attempts = ($Attempts ?? 0) + 1;
|
198
|
198
|
$Cache->cache_value('login_attempts_'.db_string($_SERVER['REMOTE_ADDR']), array($Attempts, ($Attempts > 5)), 60*60*$Attempts);
|
199
|
199
|
$AllAttempts = $Cache->get_value('login_attempts');
|