Merge remote branch 'origin/xorg/maint' into xorg/master
[platal.git] / bin / cron / google_apps.php
index 307fb7a..66138b8 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -32,7 +32,7 @@ if (!$globals->mailstorage->googleapps_domain) {
 
 /* Updates the l_userid parameter for newer user accounts. */
 $res = XDB::iterator(
-    "SELECT  g.g_account_name, a.id
+    "SELECT  g.g_account_name, a.uid
        FROM  gapps_accounts AS g
   LEFT JOIN  aliases as a ON (a.alias = g.g_account_name AND a.type = 'a_vie')
       WHERE  (g.l_userid IS NULL OR g.l_userid <= 0) AND a.uid IS NOT NULL");
@@ -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. */
@@ -58,7 +58,7 @@ while ($account = $res->next()) {
 
 /* Updates the l_userid parameter for newer nicknames. */
 $res = XDB::iterator(
-    "SELECT  g.g_account_name, a.id
+    "SELECT  g.g_account_name, a.uid
        FROM  gapps_nicknames AS g
   LEFT JOIN  aliases AS a ON (a.alias = g.g_account_name AND a.type = 'a_vie')
       WHERE  (g.l_userid IS NULL or g.l_userid <= 0) AND a.uid IS NOT NULL
@@ -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));
 }