Fixes a SQL query in modules/axletter/axletter.inc.php.
authorVincent Zanotti <vincent.zanotti@m4x.org>
Mon, 15 Jun 2009 18:39:03 +0000 (20:39 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Mon, 15 Jun 2009 18:39:03 +0000 (20:39 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
modules/axletter/axletter.inc.php

index 385365e..ef8d11a 100644 (file)
@@ -155,10 +155,10 @@ class AXLetter extends MassMailer
         if (S::has_perms()) {
             return true;
         }
-        $res = XDB::query("SELECT  1
+        $res = XDB::query("SELECT  COUNT(*)
                              FROM  axletter_rights
                             WHERE  user_id = {?}", S::i('uid'));
-        return $res->fetchOneCell();
+        return ($res->fetchOneCell() > 0);
     }
 
     static public function grantPerms($uid)