Browse Source

Why write an entire comment explaining what a variable is for instead of just naming it properly

spaghetti 8 years ago
parent
commit
afd3bd05eb
2 changed files with 5 additions and 5 deletions
  1. 4
    4
      sections/login/index.php
  2. 1
    1
      sections/login/recover_step2.php

+ 4
- 4
sections/login/index.php View File

@@ -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');

+ 1
- 1
sections/login/recover_step2.php View File

@@ -9,7 +9,7 @@ echo $Validate->GenerateJS('recoverform');
9 9
   <div style="width: 500px;">
10 10
     <span class="titletext">Reset your password - Final Step</span><br /><br />
11 11
 <?
12
-if (empty($Reset)) {
12
+if (empty($PassWasReset)) {
13 13
   if (!empty($Err)) {
14 14
 ?>
15 15
     <strong class="important_text"><?=display_str($Err)?></strong><br /><br />

Loading…
Cancel
Save