#!/usr/bin/php5 -q googleapps->domain) { exit; } /* Updates the l_userid parameter for newer user accounts. */ $res = XDB::iterator("SELECT g.g_account_name, a.id 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.id IS NOT NULL"); while ($account = $res->next()) { XDB::execute("UPDATE gapps_accounts SET l_userid = {?} WHERE g_account_name = {?}", $account['id'], $account['g_account_name']); } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>