2 /***************************************************************************
3 * Copyright (C) 2003-2014 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 HomonymeReq
24 class HomonymeReq
extends Validate
29 public $homonymes_hruid;
30 public $warning = true
;
31 public $rules = "Accepter, sauf cas particulier d'utilisateur dont l'homonymie est traité plus … manuellement.";
36 public function __construct(User
$_user, $_email, $_homonymes_hruid, $warning = true
)
38 $this->warning
= $warning;
40 parent
::__construct($_user, true
, $this->title());
42 $this->refuse
= false
;
43 $this->email
= $_email;
44 $this->homonymes_hruid
= $_homonymes_hruid;
50 private function title()
52 return ($this->warning ?
'alerte alias' : 'robot répondeur');
56 // {{{ function formu()
58 public function formu()
60 return 'include/form.valid.homonymes.tpl';
64 // {{{ function _mail_subj
66 protected function _mail_subj()
68 return "[Polytechnique.org/Support] "
69 . ($this->warning ?
"Dans une semaine : suppression de l'alias " : "Mise en place du robot")
70 . " $email@" . $this->user
->mainEmailDomain();
74 // {{{ function _mail_body
76 protected function _mail_body($isok)
80 Comme nous t'en avons informé par email il y a quelques temps,
81 pour respecter nos engagements en terme d'adresses email devinables,
82 tu te verras bientôt retirer l'alias " . $this->email
. "@" . $this->user
->mainEmailDomain() . " pour
83 ne garder que " . $this->user
->forlifeEmail() . ".
85 Toute personne qui écrira à " . $this->email
. "@" . $this->user
->mainEmailDomain() . " recevra la
86 réponse d'un robot qui l'informera que " . $this->email
. "@" . $this->user
->mainEmailDomain() . "
87 est ambigu pour des raisons d'homonymie et signalera ton email exact.";
91 // {{{ function sendmail()
93 protected function sendmail($isok)
99 Platal
::load('admin', 'homonyms.inc.php');
100 if ($this->warning
) {
101 send_warning_homonym($this->user
, $this->email
);
103 send_robot_homonym($this->user
, $this->email
);
107 // {{{ function commit()
109 public function commit()
111 if (!$this->warning
) {
112 Platal
::load('admin', 'homonyms.inc.php');
113 fix_homonym($this->user
, $this->email
);
124 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: