X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fplatal.php;h=1772921ecfa007ba220570dbb3c6f09e6fb67908;hb=07e02fe3af9db38b14225e5bf0ed937147acb37d;hp=baa18b10c407e6f63e90745a4d32e94d831ea7d0;hpb=07d0a10adbc2578f9b85875e551a03b99d3650e8;p=platal.git diff --git a/modules/platal.php b/modules/platal.php index baa18b1..1772921 100644 --- a/modules/platal.php +++ b/modules/platal.php @@ -1,6 +1,6 @@ $this->make_hook('exit', AUTH_PUBLIC), 'review' => $this->make_hook('review', AUTH_PUBLIC), 'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC), + + 'error' => $this->make_hook('test_error', AUTH_COOKIE), ); } @@ -370,9 +372,14 @@ class PlatalModule extends PLModule $mymail->setFrom('"Gestion des mots de passe" mail->domain . '>'); if (is_null($to)) { $mymail->addTo($user); - $mymail->addTo($inactives_to); + $log_to = $user->bestEmail(); + if (!is_null($inactives_to)) { + $log_to = $inactives_to . ', ' . $log_to; + $mymail->addTo($inactives_to); + } } else { $mymail->addTo($to); + $log_to = $to; } $mymail->setSubject("Ton certificat d'authentification"); $mymail->setTxtBody("Visite la page suivante qui expire dans six heures : @@ -388,7 +395,7 @@ Email envoyé à ".Env::v('login') . (is_null($to) ? '' : ' Adresse de secours : ' . $to)); $mymail->send(); - S::logger($user->id())->log('recovery', is_null($to) ? $inactives_to . ', ' . $user->bestEmail() : $to); + S::logger($user->id())->log('recovery', $log_to); } function handler_recovery_ext($page) @@ -605,7 +612,16 @@ Adresse de secours : ' . $to)); } $wiz->apply($page, 'review', $action, $mode); } + + function handler_test_error($page, $mode = null) + { + if ($mode == 'js') { + $page->changeTpl('platal/error.tpl'); + } else { + throw new Exception("Blih"); + } + } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>