X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fcore.php;h=db4c7a143d029442369a2142eb76419803bc8942;hb=029135c8d7891915fb00fdc5352ba57dc5fa2837;hp=b0d5f2aa4879c123f610a12751d1bac26adcf0eb;hpb=6f84e151da62e6c48392658e0246508bea9e950e;p=platal.git diff --git a/modules/core.php b/modules/core.php index b0d5f2a..db4c7a1 100644 --- a/modules/core.php +++ b/modules/core.php @@ -148,10 +148,11 @@ class CoreModule extends PLModule if (Env::has('send') && trim(Env::v('detailed_desc'))) { S::assert_xsrf_token(); + // TODO(vzanotti): trash the 'forlife' bit when support of forlife will be gone. $body = wordwrap(Env::v('detailed_desc'), 78) . "\n\n" . "----------------------------\n" . "Page : " . Env::v('page') . "\n\n" - . "Utilisateur : " . S::v('forlife') . "\n" + . "Utilisateur : " . (S::user() ? S::user()->login() : S::v('forlife')) . "\n" . "Navigateur : " . $_SERVER['HTTP_USER_AGENT'] . "\n" . "Skin : " . S::v('skin') . "\n"; $page->assign('bug_sent', 1); @@ -159,9 +160,15 @@ class CoreModule extends PLModule . ', tu devrais en recevoir une copie d\'ici quelques minutes. Nous allons ' . 'le traiter et y répondre dans les plus brefs délais.'); $mymail = new PlMailer(); - $mymail->setFrom('"'.S::v('prenom').' '.S::v('nom').'" <'.S::v('bestalias').'@' . $globals->mail->domain . '>'); + // TODO(vzanotti): trash the 'bestalias' bits when support of bestalias will be gone. + if (S::user()) { + $mymail->setFrom(sprintf('"%s" <%s>', S::user()->fullName(), S::user()->bestEmail())); + $mymail->addCc(sprintf('"%s" <%s>', S::user()->fullName(), S::user()->bestEmail())); + } else { + $mymail->setFrom('"'.S::v('prenom').' '.S::v('nom').'" <'.S::v('bestalias').'@' . $globals->mail->domain . '>'); + $mymail->addCc('"'.S::v('prenom').' '.S::v('nom').'" <'.S::v('bestalias').'@' . $globals->mail->domain . '>'); + } $mymail->addTo('support+platal@' . $globals->mail->domain); - $mymail->addCc('"'.S::v('prenom').' '.S::v('nom').'" <'.S::v('bestalias').'@' . $globals->mail->domain . '>'); $mymail->setSubject('Plat/al '.Env::v('task_type').' : '.Env::v('item_summary')); $mymail->setTxtBody($body); $mymail->send();