From 115c90dbde9227ff714f699c546f93c108f385f3 Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Sun, 18 May 2008 14:00:30 +0200 Subject: [PATCH] Adds missing "global $globals", used for sending homonyms/payment errors/registration/marketing emails (bugs introduced in r1897). Signed-off-by: Vincent Zanotti --- ChangeLog | 5 +++++ include/validations/homonymes.inc.php | 1 + modules/axletter.php | 2 +- modules/marketing.php | 1 + modules/payment.php | 3 ++- modules/register.php | 1 + modules/register/register.inc.php | 1 + 7 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6eb183b..be6932f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ New: * Core: - Password strength checker -FRU - Show user picture on the mini-profile -FRU + - Add an anti-XSRF framework, and add protection to most pages -VZA + +Bug/Wish: + * Core: + - Fix email sending, correcting bugs introduced in r1897 -VZA From 0.9.16 branch: diff --git a/include/validations/homonymes.inc.php b/include/validations/homonymes.inc.php index ac9de91..c314fdf 100644 --- a/include/validations/homonymes.inc.php +++ b/include/validations/homonymes.inc.php @@ -69,6 +69,7 @@ class HomonymeReq extends Validate protected function _mail_subj() { + global $globals; return "[Polytechnique.org/Support] ".($this->warning?"Dans une semaine : suppression de l'alias":"Mise en place du robot")." $loginbis@" . $globals->mail->domain; } diff --git a/modules/axletter.php b/modules/axletter.php index 67833e8..a863d2f 100644 --- a/modules/axletter.php +++ b/modules/axletter.php @@ -158,6 +158,7 @@ class AXLetterModule extends PLModule signature = {?}, promo_min = {?}, promo_max = {?}, echeance = {?}", $id, $shortname, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance); if (!$saved) { + global $globals; $mailer = new PlMailer(); $mailer->setFrom("support@" . $globals->mail->domain); $mailer->setSubject("Un nouveau projet de mail de l'AX vient d'être proposé"); @@ -177,7 +178,6 @@ class AXLetterModule extends PLModule INNER JOIN auth_user_md5 AS u USING(user_id) INNER JOIN aliases AS a ON (u.user_id = a.id AND FIND_IN_SET('bestalias', a.flags))"); - global $globals; while (list($nom, $prenom, $alias) = $res->next()) { $mailer->addTo("$nom $prenom <$alias@{$globals->mail->domain}>"); } diff --git a/modules/marketing.php b/modules/marketing.php index 23593c0..a272c31 100644 --- a/modules/marketing.php +++ b/modules/marketing.php @@ -79,6 +79,7 @@ class MarketingModule extends PLModule function handler_private(&$page, $uid = null, $action = null, $value = null) { + global $globals; $page->changeTpl('marketing/private.tpl'); if (is_null($uid)) { diff --git a/modules/payment.php b/modules/payment.php index 11926f9..8bc8285 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -21,6 +21,7 @@ /* sort en affichant une erreur */ function cb_erreur($text) { + global $globals; $mymail = new PlMailer(); $mymail->addTo($globals->money->email); $mymail->setFrom("webmaster@" . $globals->mail->domain); @@ -33,7 +34,7 @@ function cb_erreur($text) { /* sort en affichant une erreur */ function paypal_erreur($text, $send=true) { - global $page, $erreur; + global $page, $erreur, $globals; if ($erreur) return; $erreur = $text; if (!$send) return; diff --git a/modules/register.php b/modules/register.php index d18d80a..7fea993 100644 --- a/modules/register.php +++ b/modules/register.php @@ -196,6 +196,7 @@ class RegisterModule extends PLModule $alert .= "Tentative d'inscription depuis une IP surveillee"; } if ($email_banned || $ip_banned) { + global $globals; $err = "Une erreur s'est produite lors de l'inscription." . " Merci de contacter