Adds missing "global $globals", used for sending homonyms/payment errors/registration...
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 18 May 2008 12:00:30 +0000 (14:00 +0200)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 18 May 2008 12:00:30 +0000 (14:00 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
ChangeLog
include/validations/homonymes.inc.php
modules/axletter.php
modules/marketing.php
modules/payment.php
modules/register.php
modules/register/register.inc.php

index 6eb183b..be6932f 100644 (file)
--- 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:
 
index ac9de91..c314fdf 100644 (file)
@@ -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;
     }
 
index 67833e8..a863d2f 100644 (file)
@@ -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}>");
                     }
index 23593c0..a272c31 100644 (file)
@@ -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)) {
index 11926f9..8bc8285 100644 (file)
@@ -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;
index d18d80a..7fea993 100644 (file)
@@ -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 <a href='mailto:register@{$globals->mail->domain}>"
                                  . " register@{$globals->mail->domain}</a>"
index a8cde72..585200a 100644 (file)
@@ -148,6 +148,7 @@ function check_new_user(&$sub)
 
 function create_aliases (&$sub)
 {
+    global $globals;
     extract ($sub);
 
     require_once "xorg.misc.inc.php";