X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgoogleapps.inc.php;h=54e3efe55cef568c442dfd3d03b97aed6f733802;hb=730a173a333507926e0029d8a96c3a26b55756e4;hp=908083b7f86d59101ea21be301761dbdc9b7d742;hpb=0089e5947ab47ba3f35f7a977884392adf3c6da5;p=platal.git diff --git a/include/googleapps.inc.php b/include/googleapps.inc.php index 908083b..54e3efe 100644 --- a/include/googleapps.inc.php +++ b/include/googleapps.inc.php @@ -36,8 +36,8 @@ function post_queue_u_create($job) { $account = new GoogleAppsAccount($userid, $forlife); if ($account->activate_mail_redirection) { require_once('emails.inc.php'); - $storage = new MailStorageGoogleApps($userid); - $storage->enable(); + $storage = new EmailStorage($userid, 'googleapps'); + $storage->activate(); } // Sends the 'account created' email to the user, with basic documentation. @@ -78,8 +78,8 @@ function post_queue_u_update($job) { if ($account->active()) { // Re-adds the email redirection (if the user did request it). if ($account->activate_mail_redirection) { - $storage = new MailStorageGoogleApps($userid); - $storage->enable(); + $storage = new EmailStorage($userid, 'googleapps'); + $storage->activate(); } // Sends an email to the account owner. @@ -289,6 +289,7 @@ class GoogleAppsAccount if (!$this->pending_update_password) { $this->create_queue_job('u_update', array('password' => $password)); + $this->pending_update_password = true; } } @@ -318,6 +319,11 @@ class GoogleAppsAccount if (!$this->pending_update_suspension) { $this->create_queue_job('u_update', array('suspended' => true)); $this->pending_update_suspension = true; + XDB::execute( + "UPDATE gapps_accounts + SET g_status = 'disabled' + WHERE g_account_name = {?} AND g_status = 'active'", + $this->g_account_name); } }