Replaces 'id' with 'uid' when addressing SQL result maps in the
authorVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 17 Jul 2010 17:08:48 +0000 (19:08 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 17 Jul 2010 17:08:48 +0000 (19:08 +0200)
GoogleApps cron; this was causing nicknames to be repeatedly recreated.

Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
bin/cron/google_apps.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));
 }