X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fgoogle_apps.php;h=66138b84feaced7f3c455d2cca717683a82888ff;hb=0b2c582e3daf62d24b2e61742b37b2530f842926;hp=307fb7a5b9eb0cd0eacb0274dc696826b08c10e1;hpb=93d42b4fcc6f055a428c9b63e386ac62c918d08a;p=platal.git diff --git a/bin/cron/google_apps.php b/bin/cron/google_apps.php index 307fb7a..66138b8 100755 --- a/bin/cron/google_apps.php +++ b/bin/cron/google_apps.php @@ -1,7 +1,7 @@ #!/usr/bin/php5 -q 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)); }