Displays redirections in succesful registration summary (Closes #1501).
authorStéphane Jacob <sj@m4x.org>
Sun, 29 May 2011 12:28:12 +0000 (14:28 +0200)
committerStéphane Jacob <sj@m4x.org>
Sun, 29 May 2011 12:28:12 +0000 (14:28 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
ChangeLog
bin/cron/registrations.php

index 921adaf..68ce17c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@ Bug/Wish:
     * Profile:
         - #1497: Fixes issues with ordinary names                          -JAC
 
+    * Register:
+        - #1501: Displays redirections in succesful registration summary   -JAC
+
     * Search:
         - #1285: Autocompletes on internal words in university search      -JAC
 
index 91cb1ac..a2c22dc 100755 (executable)
@@ -5,19 +5,20 @@ require 'connect.db.inc.php';
 
 $message = '';
 
-$res = XDB::iterRow("SELECT  a.registration_date, a.hruid, s.email
-                       FROM  accounts             AS a
-                 INNER JOIN  account_profiles     AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms))
-                 INNER JOIN  profile_display      AS pd ON (ap.pid = pd.pid)
-                  LEFT JOIN  email_source_account AS s  ON (a.uid = s.uid)
+$res = XDB::iterRow("SELECT  a.registration_date, a.hruid, s.email, GROUP_CONCAT(r.redirect SEPARATOR ', ')
+                       FROM  accounts               AS a
+                 INNER JOIN  account_profiles       AS ap ON (ap.uid = a.uid AND FIND_IN_SET('owner', ap.perms))
+                 INNER JOIN  profile_display        AS pd ON (ap.pid = pd.pid)
+                  LEFT JOIN  email_source_account   AS s  ON (a.uid = s.uid)
+                  LEFT JOIN  email_redirect_account AS r  ON (a.uid = r.uid)
                       WHERE  a.registration_date > {?}
                    GROUP BY  a.hruid
                    ORDER BY  pd.promo",
        date("Ymd000000", strtotime('last Monday')));
 if ($count = $res->total()) {
     $message .= "$count INSCRIPTIONS CONFIRMÉES CETTE SEMAINE :\n";
-    while (list($date, $hruid, $email) = $res->next()) {
-             $message .= "$date, $hruid, $email\n";
+    while (list($date, $hruid, $email, $redirect) = $res->next()) {
+             $message .= "$date, $hruid, $email, $redirect\n";
     }
 }