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

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

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

Loading…
Cancel
Save