2 /***************************************************************************
3 * Copyright (C) 2003-2010 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 class GoogleAppsUnsuspendReq
extends Validate
25 public $rules = "Bien faire attention à la raison de la suspension. Si le compte a été suspendu par Google,
26 alors la raison s'affichera (mais seulement 24-48h après la suspension).
27 Si l'utilisateur a désactivé lui-même son compte, la raison sera toujours vierge.";
29 public function __construct(User
&$_user)
31 parent
::__construct($_user, true
, 'gapps-unsuspend');
34 public function sendmail($isok)
36 // Using overloading to prevent the validation from sending emails, as a valid
37 // unsuspend will automatically generate an email when commited through
38 // the Google Apps provisioning API.
40 parent
::sendmail($isok);
44 public function formu()
46 return 'include/form.valid.gapps-unsuspend.tpl';
49 protected function _mail_subj()
51 return "[Polytechnique.org] Demande de réactivation de ton compte Google Apps";
54 protected function _mail_body($isok)
57 return " La demande que tu avais faite de réactivation de compte Google Apps a été refusée.";
61 public function commit()
63 require_once dirname(__FILE__
) . '/../googleapps.inc.php';
64 $account = new GoogleAppsAccount($this->user
);
65 return $account->do_unsuspend();
68 public function suspension_reason()
73 WHERE g_account_name = {?}",
74 $this->user
->login());
75 return $res->fetchOneCell();
79 /* vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 foldmethod=marker enc=utf-8: */