X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fhomonymes.inc.php;h=c314fdfbb58ea57b35bb8c8c307658a22608179e;hb=1d08054d724a64a6a3d136bd61348e3a8615b46a;hp=dfc4f029905630ae255b10c5f0ff5a13ea223223;hpb=0337d704b62718d7c77106c0e4c4e26fb02beacf;p=platal.git diff --git a/include/validations/homonymes.inc.php b/include/validations/homonymes.inc.php index dfc4f02..c314fdf 100644 --- a/include/validations/homonymes.inc.php +++ b/include/validations/homonymes.inc.php @@ -1,6 +1,6 @@ warning = $warning; - $this->Validate($_uid, true, $this->title()); + parent::__construct($_uid, true, $this->title()); $this->refuse = false; - $this->loginbis = $_loginbis; - $this->homonymes_forlife = $_homonymes_forlife; - - } - - // }}} - // {{{ title() - - function title() { - return $this->warning?'alerte alias':'robot répondeur'; } // }}} - // {{{ function get_request() + // {{{ title() - function get_request($uid) + private function title() { - return parent::get_request($uid,$this->title); + return $this->warning?'alerte alias':'robot répondeur'; } // }}} // {{{ function formu() - function formu() - { return 'include/form.valid.homonymes.tpl'; } + public function formu() + { + return 'include/form.valid.homonymes.tpl'; + } // }}} // {{{ function _mail_subj - function _mail_subj() + protected function _mail_subj() { - return "[Polytechnique.org/Support] ".($this->warning?"Dans une semaine : suppression de l'alias":"Mise en place du robot")." $loginbis@polytechnique.org"; + global $globals; + return "[Polytechnique.org/Support] ".($this->warning?"Dans une semaine : suppression de l'alias":"Mise en place du robot")." $loginbis@" . $globals->mail->domain; } // }}} // {{{ function _mail_body - - function _mail_body($isok) + + protected function _mail_body($isok) { global $globals; return " -Comme nous t'en avons informé par mail il y a quelques temps, +Comme nous t'en avons informé par mail il y a quelques temps, pour respecter nos engagements en terme d'adresses e-mail devinables, -tu te verras bientôt retirer l'alias ".$this->loginbis."@".$globals->mail->domain." pour +tu te verras bientôt retirer l'alias ".$this->loginbis."@".$globals->mail->domain." pour ne garder que ".$this->forlife."@".$globals->mail->domain.". -Toute personne qui écrira à ".$this->loginbis."@".$globals->mail->domain." recevra la -réponse d'un robot qui l'informera que ".$this->loginbis."@".$globals->mail->domain." +Toute personne qui écrira à ".$this->loginbis."@".$globals->mail->domain." recevra la +réponse d'un robot qui l'informera que ".$this->loginbis."@".$globals->mail->domain." est ambigu pour des raisons d'homonymie et signalera ton email exact."; } // }}} // {{{ function sendmail() - function sendmail($isok) + protected function sendmail($isok) { if (!$isok) return false; global $globals; - require_once('diogenes/diogenes.hermes.inc.php'); - $mailer = new HermesMailer; + $mailer = new PlMailer; $cc = "support+homonyme@".$globals->mail->domain; $FROM = "\"Support Polytechnique.org\" <$cc>"; $mailer->setSubject($this->_mail_subj()); @@ -118,26 +108,25 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact."; $body = $this->prenom.",\n\n" . $this->_mail_body($isok) - . (Env::has('comm') ? "\n\n".Env::get('comm') : '') - . "\n\nCordialement,\nL'équipe Polytechnique.org\n"; + . (Env::has('comm') ? "\n\n".Env::v('comm') : '') + . "\n\nCordialement,\n\n-- \nL'équipe de Polytechnique.org\n"; $mailer->setTxtBody(wordwrap($body)); $mailer->send(); } // }}} // {{{ function commit() - - function commit() + + public function commit() { - global $globals; require_once('homonymes.inc.php'); switch_bestalias($this->uid, $this->loginbis); if (!$this->warning) { - $globals->xdb->execute("UPDATE aliases SET type='homonyme',expire=NOW() WHERE alias={?}", $this->loginbis); - $globals->xdb->execute("REPLACE INTO homonymes (homonyme_id,user_id) VALUES({?},{?})", $this->uid, $this->uid); + XDB::execute("UPDATE aliases SET type='homonyme',expire=NOW() WHERE alias={?}", $this->loginbis); + XDB::execute("REPLACE INTO homonymes (homonyme_id,user_id) VALUES({?},{?})", $this->uid, $this->uid); } - + return true; } @@ -146,5 +135,5 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact."; // }}} -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>