Fix unsubscription issue with axletter
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Thu, 1 Jul 2010 18:38:28 +0000 (20:38 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Thu, 1 Jul 2010 18:38:28 +0000 (20:38 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
include/massmailer.inc.php
modules/axletter/axletter.inc.php

index d4f0789..269a570 100644 (file)
@@ -173,7 +173,7 @@ abstract class MassMailer
                                        rand(), "X.org rulez"));
             XDB::execute("UPDATE  {$this->_subscriptionTable} as ni
                              SET  ni.hash = {?}
-                           WHERE  ni.uid != {?}",
+                           WHERE  ni.uid = {?}",
                          $hash, $user->id());
         }
 
index 18818c7..761724c 100644 (file)
@@ -117,10 +117,10 @@ class AXLetter extends MassMailer
         if (is_null($uid) && $hash) {
             return false;
         }
-        $res = XDB::query("SELECT *
+        $res = XDB::query("SELECT uid
                              FROM axletter_ins
                             WHERE $field={?}", $user);
-        if (!$res->numRows()) {
+        if ($res->numRows() != 1) {
             return false;
         }
         XDB::execute("DELETE FROM  axletter_ins