try {
$nl = new NewsLetter($nid);
+ $user =& S::user();
if (Get::has('text')) {
- $nl->toText($page, S::v('prenom'), S::v('nom'), S::v('femme'));
+ $nl->toText($page, $user);
} else {
- $nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme'));
+ $nl->toHtml($page, $user);
}
if (Post::has('send')) {
- $res = XDB::query("SELECT hash
- FROM newsletter_ins
- WHERE user_id = {?}",
- S::i('uid'));
- $nl->sendTo(S::user()->login(), S::user()->bestEmail(),
- S::v('prenom'), S::v('nom'),
- S::v('femme'), S::v('mail_fmt') != 'texte',
- $res->fetchOneCell());
+ $nl->sendTo($user);
}
} catch (MailNotFound $e) {
return PL_NOT_FOUND;
}
if ($aid == 'blacklist_check') {
+ global $globals;
$ips_to_check = array();
- $gethostbyname_count = 0;
+ $blacklist_host_resolution_count = 0;
foreach ($nl->_arts as $key => $articles) {
foreach ($articles as $article) {
- $article_ips = $article->getLinkIps($gethostbyname_count);
+ $article_ips = $article->getLinkIps($blacklist_host_resolution_count);
if (!empty($article_ips)) {
$ips_to_check[$article->title()] = $article_ips;
}
}
$page->assign('ips_to_check', $ips_to_check);
- if ($gethostbyname_count >= $globals->mail->blacklist_host_resolution_limit) {
- $page-trigError("Toutes les url et adresses emails de la lettre"
+ if ($blacklist_host_resolution_count >= $globals->mail->blacklist_host_resolution_limit) {
+ $page->trigError("Toutes les url et adresses emails de la lettre"
. " n'ont pas été prises en compte car la"
. " limite du nombre de résolutions DNS"
. " autorisée a été atteinte.");