Fixes the reminding interface for people who have not completed their registration.
authorStéphane Jacob <jacou@melix.net>
Mon, 29 Dec 2008 16:36:42 +0000 (17:36 +0100)
committerStéphane Jacob <jacou@melix.net>
Mon, 29 Dec 2008 16:36:42 +0000 (17:36 +0100)
include/marketing.inc.php
modules/marketing.php

index d488843..de95b4c 100644 (file)
@@ -197,7 +197,9 @@ class Marketing
         $res = XDB::query("SELECT  r.date, u.promo, u.nom, u.prenom, r.email, r.bestalias
                              FROM  register_pending AS r
                        INNER JOIN  auth_user_md5    AS u ON u.user_id = r.uid
-                            WHERE  hash!='INSCRIT' AND uid={?} AND TO_DAYS(relance) < TO_DAYS(NOW())", $uid);
+                            WHERE  hash != 'INSCRIT' AND uid = {?} AND
+                                   (TO_DAYS(relance) IS NULL OR TO_DAYS(relance) < TO_DAYS(NOW()))",
+                          $uid);
         if (!list($date, $promo, $nom, $prenom, $email, $alias) = $res->fetchOneRow()) {
             return false;
         }
@@ -220,7 +222,7 @@ class Marketing
         $mymail->send();
         XDB::execute('UPDATE  register_pending
                          SET  hash={?}, password={?}, relance=NOW()
-                       WHERE uid={?}', $hash, $pass_encrypted, $uid);
+                       WHERE  uid={?}', $hash, $pass_encrypted, $uid);
         return "$prenom $nom ($promo)";
     }
 }
index f6ac4fb..b620e78 100644 (file)
@@ -346,7 +346,7 @@ class MarketingModule extends PLModule
             $sent  = Array();
             foreach (array_keys($_POST['relance']) as $uid) {
                 if ($tmp = Marketing::relance($uid, $nbdix)) {
-                    $sent[] = $tmp.' a été relancé';
+                    $sent[] = $tmp . ' a été relancé.';
                 }
             }
             $page->assign('sent', $sent);