Revision: 2223
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2223&view=rev
Author:   cimorrison
Date:     2011-12-31 11:06:23 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
Fixed problem with spurious error message being triggered

Modified Paths:
--------------
    mrbs/trunk/web/auth_db.inc

Modified: mrbs/trunk/web/auth_db.inc
===================================================================
--- mrbs/trunk/web/auth_db.inc  2011-12-31 10:45:20 UTC (rev 2222)
+++ mrbs/trunk/web/auth_db.inc  2011-12-31 11:06:23 UTC (rev 2223)
@@ -72,7 +72,13 @@
   $result = sql_query1("SELECT level FROM $tbl_users WHERE name='" . 
strtolower(addslashes($user)) . "' LIMIT 1");
   if ($result == -1)
   {
-    trigger_error(sql_error(), E_USER_WARNING);
+    $sql_error = sql_error();
+    if (!empty($sql_error))
+    {
+      // It's possible that sql_query1 returned -1 because there were no 
matching rows,
+      // so we only trigger an error if there was a genuine SQL error.
+      trigger_error($sql_error, E_USER_WARNING);
+    }
     return 0;
   }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to