X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgoogleapps.inc.php;h=28d94599e735646d155c2ec42f59922598f31d1e;hb=032b244ed3fd10b934697f2636fc9a4574822408;hp=e6cd099ffe02976f4e56fc504f819b8c36e4af8c;hpb=afde0a3a880a0ed092671f3cffebc2885174c9ef;p=platal.git diff --git a/include/googleapps.inc.php b/include/googleapps.inc.php index e6cd099..28d9459 100644 --- a/include/googleapps.inc.php +++ b/include/googleapps.inc.php @@ -37,7 +37,7 @@ function post_queue_u_create($job) { if ($account->activate_mail_redirection) { require_once('emails.inc.php'); $storage = new EmailStorage($userid, 'googleapps'); - $storage->enable(); + $storage->activate(); } // Sends the 'account created' email to the user, with basic documentation. @@ -79,7 +79,7 @@ function post_queue_u_update($job) { // Re-adds the email redirection (if the user did request it). if ($account->activate_mail_redirection) { $storage = new EmailStorage($userid, 'googleapps'); - $storage->enable(); + $storage->activate(); } // Sends an email to the account owner. @@ -149,6 +149,9 @@ class GoogleAppsAccount $this->uid = $uid; $this->g_account_name = $account_name; $this->g_status = NULL; + if (!$this->g_account_name) { + return; + } $res = XDB::query( "SELECT l_sync_password, l_activate_mail_redirection, @@ -244,7 +247,7 @@ class GoogleAppsAccount // Creates a queue job of the @p type, for the user represented by this // GoogleAppsAccount object, using @p parameters. @p parameters is supposed // to be a one-dimension array of key-value mappings. - // The created job as a 'normal' priority, and is scheduled for immediate + // The created job as a 'immediate' priority, and is scheduled for immediate // execution. private function create_queue_job($type, $parameters) { $parameters["username"] = $this->g_account_name; @@ -252,7 +255,7 @@ class GoogleAppsAccount "INSERT INTO gapps_queue SET q_owner_id = {?}, q_recipient_id = {?}, p_entry_date = NOW(), p_notbefore_date = NOW(), - p_priority = 'normal', + p_priority = 'immediate', j_type = {?}, j_parameters = {?}", S::v('uid'), $this->uid, @@ -444,7 +447,7 @@ class GoogleAppsAccount "SELECT g_admin FROM gapps_accounts WHERE l_userid = {?} AND g_status = 'active'", $uid); - return ($res->numRows() > 0 ? (bool)$res->fetchOneRow() : false); + return ($res->numRows() > 0 ? (bool)$res->fetchOneCell() : false); } }