Merge remote branch 'origin/platal-1.0.0'
authorStéphane Jacob <sj@m4x.org>
Tue, 20 Jul 2010 09:39:51 +0000 (11:39 +0200)
committerStéphane Jacob <sj@m4x.org>
Tue, 20 Jul 2010 09:39:51 +0000 (11:39 +0200)
bin/cron/google_apps.php
bin/cron/registrations.php
include/marketing.inc.php

index f5133f7..a145fc4 100755 (executable)
@@ -41,7 +41,7 @@ while ($account = $res->next()) {
         "UPDATE  gapps_accounts
             SET  l_userid = {?}
           WHERE  g_account_name = {?}",
-        $account['id'], $account['g_account_name']);
+        $account['uid'], $account['g_account_name']);
 }
 
 /* Emits a warning for GApps accounts without local uid. */
@@ -68,7 +68,7 @@ while ($nickname = $res->next()) {
         "UPDATE  gapps_nicknames
             SET  l_userid = {?}
           WHERE  g_account_name = {?}",
-        $nickname['id'], $nickname['g_account_name']);
+        $nickname['uid'], $nickname['g_account_name']);
 }
 
 /* Emits a warning for nicknames without local uid. */
@@ -101,7 +101,7 @@ while ($nickname = $res->next()) {
             "INSERT  INTO gapps_queue
                 SET  q_recipient_id = {?}, p_entry_date = NOW(), p_notbefore_date = NOW(),
                      p_priority = 'offline', j_type = 'n_create', j_parameters = {?}",
-            $nickname['id'],
+            $nickname['uid'],
             json_encode($nickname));
     }
 }
@@ -118,7 +118,7 @@ while ($nickname = $res->next()) {
         "INSERT  INTO gapps_queue
             SET  q_recipient_id = {?}, p_entry_date = NOW(), p_notbefore_date = NOW(),
                  p_priority = 'offline', j_type = 'n_delete', j_parameters = {?}",
-        $nickname['id'],
+        $nickname['uid'],
         json_encode($nickname));
 }
 
index 3b997a1..75ac753 100755 (executable)
@@ -5,14 +5,13 @@ require 'connect.db.inc.php';
 
 $message = '';
 
-$res = XDB::iterRow("SELECT  al.alias, pd.promo, e.email
+$res = XDB::iterRow("SELECT  a.hruid, pd.promo, e.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  aliases          AS al ON (a.uid =a.uid AND al.type = 'a_vie')
                   LEFT JOIN  emails           AS e  ON (a.uid = e.uid AND NOT FIND_IN_SET('filter', e.flags))
                       WHERE  a.registration_date > {?}
-                   GROUP BY  al.alias
+                   GROUP BY  a.hruid
                    ORDER BY  pd.promo",
        date("Ymd000000", strtotime('last Monday')));
 if ($count = $res->total()) {
index 592f95a..a6948ac 100644 (file)
@@ -174,7 +174,7 @@ class Marketing
         if ($res->numRows() == 0) {
             return null;
         }
-        list ($uid, $email, $type, $data, $from, $senderi, $personal_notes) = $res->fetchOneRow();
+        list ($uid, $email, $type, $data, $from, $sender, $personal_notes) = $res->fetchOneRow();
         return new Marketing($uid, $email, $type, $data, $from, $sender, $personal_notes);
     }