Browse Source

Allow disabled users to reset their password

spaghetti 8 years ago
parent
commit
64b931d108
1 changed files with 3 additions and 6 deletions
  1. 3
    6
      sections/login/index.php

+ 3
- 6
sections/login/index.php View File

40
       FROM users_main AS m
40
       FROM users_main AS m
41
         INNER JOIN users_info AS i ON i.UserID = m.ID
41
         INNER JOIN users_info AS i ON i.UserID = m.ID
42
       WHERE i.ResetKey = '".db_string($_REQUEST['key'])."'
42
       WHERE i.ResetKey = '".db_string($_REQUEST['key'])."'
43
-        AND i.ResetKey != ''
44
-        AND m.Enabled = '1'");
43
+        AND i.ResetKey != ''");
45
     list($UserID, $Email, $Country, $Expires) = $DB->next_record();
44
     list($UserID, $Email, $Country, $Expires) = $DB->next_record();
46
 
45
 
47
     if (!apc_exists('DBKEY')) {
46
     if (!apc_exists('DBKEY')) {
121
         $DB->query("
120
         $DB->query("
122
           SELECT
121
           SELECT
123
             Email
122
             Email
124
-          FROM users_main
125
-          WHERE Enabled = '1'");
123
+          FROM users_main");
126
         while(list($EncEmail) = $DB->next_record()) {
124
         while(list($EncEmail) = $DB->next_record()) {
127
           if ($_REQUEST['email'] == DBCrypt::decrypt($EncEmail)) {
125
           if ($_REQUEST['email'] == DBCrypt::decrypt($EncEmail)) {
128
             break; // $EncEmail is now the encrypted form of the given email from the database
126
             break; // $EncEmail is now the encrypted form of the given email from the database
135
             Username,
133
             Username,
136
             Email
134
             Email
137
           FROM users_main
135
           FROM users_main
138
-          WHERE Email = '$EncEmail'
139
-            AND Enabled = '1'");
136
+          WHERE Email = '$EncEmail'");
140
         list($UserID, $Username, $Email) = $DB->next_record();
137
         list($UserID, $Username, $Email) = $DB->next_record();
141
         $Email = DBCrypt::decrypt($Email);
138
         $Email = DBCrypt::decrypt($Email);
142
 
139
 

Loading…
Cancel
Save