X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fgoogle_apps.php;h=a145fc415094199ddeefc622592a0ac13905806e;hb=7fa56f0623f8cf2c637f5f19c41b10a302387e7a;hp=307fb7a5b9eb0cd0eacb0274dc696826b08c10e1;hpb=1bf36cd12647c3d2eb8f9ec2a1f0eaad0b5f7e81;p=platal.git diff --git a/bin/cron/google_apps.php b/bin/cron/google_apps.php index 307fb7a..a145fc4 100755 --- a/bin/cron/google_apps.php +++ b/bin/cron/google_apps.php @@ -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)); }