X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fnewsletter.php;h=5a41e9aef0f7e8e919486458c73f62481b18bb09;hb=0173649da100caf1f8fa5cfcfac632283f047b2c;hp=3abc1ee278f8e4b504237ca767d45b2e0f38ef99;hpb=eaf30d86cc99df2414cf4f171a9b0f11b0561e3b;p=platal.git diff --git a/modules/newsletter.php b/modules/newsletter.php index 3abc1ee..5a41e9a 100644 --- a/modules/newsletter.php +++ b/modules/newsletter.php @@ -1,6 +1,6 @@ toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme')); } if (Post::has('send')) { + $res = XDB::query("SELECT hash FROM newsletter_ins WHERE user_id = {?}", S::i('uid')); $nl->sendTo(S::v('prenom'), S::v('nom'), S::v('bestalias'), S::v('femme'), - S::v('mail_fmt') != 'texte'); + S::v('mail_fmt') != 'texte', + $res->fetchOneCell()); } } @@ -79,7 +81,7 @@ class NewsletterModule extends PLModule if (Post::has('see') || (Post::has('valid') && (!trim(Post::v('title')) || !trim(Post::v('body'))))) { if (!Post::has('see')) { - $page->trig("L'article doit avoir un titre et un contenu"); + $page->trigError("L'article doit avoir un titre et un contenu"); } $art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append')); $page->assign('art', $art); @@ -128,7 +130,7 @@ class NewsletterModule extends PLModule if (preg_match('/^[-a-z0-9]*$/i', $nl->_shortname) && !is_numeric($nl->_shortname)) { $nl->save(); } else { - $page->trig('Le nom de la NL n\'est pas valide'); + $page->trigError('Le nom de la NL n\'est pas valide'); pl_redirect('admin/newsletter/edit/' . $nl->_id); } }