Changeset:
        b5b3919db394
        
https://sourceforge.net/p/mrbs/hg-code/ci/b5b3919db39446ca346ced76d75375e8facc0d5c
Author:
        Campbell Morrison <[email protected]>
Date:
        Mon Feb 20 14:23:59 2017 +0000
Log message:

Restructured code

diffstat:

 web/auth/auth_db.inc |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r ccda9c6e53ea -r b5b3919db394 web/auth/auth_db.inc
--- a/web/auth/auth_db.inc      Mon Feb 20 14:00:05 2017 +0000
+++ b/web/auth/auth_db.inc      Mon Feb 20 14:23:59 2017 +0000
@@ -89,7 +89,7 @@
   /* Otherwise it's a legacy MD5 hash */
   else
   {
-    if (md5($pass) == $password_hash)
+    if (md5($password) == $password_hash)
     {
       $result = true;
 
@@ -116,8 +116,8 @@
  * $pass  - The password
  * 
  * Returns:
- *   0        - The pair are invalid or do not exist
- *   non-zero - The pair are valid
+ *   true     - The pair are invalid or do not exist
+ *   false    - The pair are valid
  */
 
 function authValidateUser($user, $pass)
@@ -140,6 +140,12 @@
   $res = db()->query($sql, $sql_params);
   
   $row = $res->row_keyed(0);
+  
+  if (!isset($row['password_hash']))
+  {
+    // No user found with that name
+    return false;
+  }
 
   return checkPassword($pass, $row['password_hash'], 'name', $user);
 }

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to