X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgoogleapps.inc.php;h=68bf04d0482e02c3a1969a2e407da783040d4b85;hb=47712f77e9718652c516c85cde99a58d142f67c9;hp=5cf6eb6158d9c8ea5e416aadb68f5e0fe7360f9d;hpb=80fc062dd4e38fd01ef458309bba9634f8f8b556;p=platal.git diff --git a/include/googleapps.inc.php b/include/googleapps.inc.php index 5cf6eb6..68bf04d 100644 --- a/include/googleapps.inc.php +++ b/include/googleapps.inc.php @@ -1,6 +1,6 @@ activate_mail_redirection) { - require_once('emails.inc.php'); - $storage = new EmailStorage($user, 'googleapps'); - $storage->activate(); + require_once 'emails.inc.php'; + Email::activate_storage($user, 'googleapps'); } // Sends the 'account created' email to the user, with basic documentation. @@ -63,13 +62,12 @@ function post_queue_u_update($job) { } if (isset($parameters['suspended']) && $parameters['suspended'] == false) { - require_once('emails.inc.php'); + require_once 'emails.inc.php'; $account = new GoogleAppsAccount($user); if ($account->active()) { // Re-adds the email redirection (if the user did request it). if ($account->activate_mail_redirection) { - $storage = new EmailStorage($user, 'googleapps'); - $storage->activate(); + Email::activate_storage($user, 'googleapps'); } // Sends an email to the account owner. @@ -124,7 +122,7 @@ class GoogleAppsAccount // Constructs the account object, by retrieving all informations from the // GApps account table, from GApps job queue, and from plat/al validation queue. - public function __construct(User &$user) + public function __construct(User $user) { $this->user = &$user; if (!$this->user || !$this->user->login()) { @@ -193,7 +191,6 @@ class GoogleAppsAccount // validation queue. private function load_pending_validations() { - require_once('validations.inc.php'); $this->pending_validation_unsuspend = Validate::get_typed_requests_count($this->user->id(), 'gapps-unsuspend'); } @@ -341,7 +338,6 @@ class GoogleAppsAccount } if (!$this->pending_update_suspension && !$this->pending_validation_unsuspend) { - require_once('validations.inc.php'); $unsuspend = new GoogleAppsUnsuspendReq($this->user); $unsuspend->submit(); $this->pending_validation_unsuspend = true;