<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
// the user at creation time.
$account = new GoogleAppsAccount($user);
if ($account->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.
}
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.
// 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()) {
// 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');
}
}
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;
if (!$this->pending_create) {
// Retrieves information on the new account.
- // TODO: retreive first_name and last_name from the profile.
- if (!$user->hasProfile()) {
- $prenom = $user->displayName();
- $nom = $user->fullName();
+ if (!$this->user->hasProfile()) {
+ $prenom = $this->user->displayName();
+ $nom = $this->user->fullName();
} else {
- $prenom = $user->profile()->firstName();
- $nom = $user->profile()->lastName();
+ $prenom = $this->user->profile()->firstName();
+ $nom = $this->user->profile()->lastName();
}
// Adds an 'unprovisioned' entry in the gapps_accounts table.