remove fail() that is not used
[platal.git] / modules / marketing.php
index d2ede2a..ae2ad4a 100644 (file)
@@ -37,8 +37,6 @@ class MarketingModule extends PLModule
 
     function handler_marketing(&$page)
     {
-        global $globals;
-
         $page->changeTpl('marketing/index.tpl');
 
         $page->assign('xorg_title','Polytechnique.org - Marketing');
@@ -80,8 +78,6 @@ 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)) {
@@ -143,7 +139,7 @@ class MarketingModule extends PLModule
                 "INSERT INTO register_marketing
                          SET uid = {?}, sender = {?}, email = {?},
                              date = NOW(), type = {?}",
-                $uid, Session::get('uid'), Post::get('email'), Post::get('type')); 
+                $uid, S::v('uid'), Post::get('email'), Post::get('type')); 
         }
 
         $res = XDB::iterator(
@@ -164,12 +160,10 @@ class MarketingModule extends PLModule
 
     function handler_promo(&$page, $promo = null)
     {
-        global $globals;
-
         $page->changeTpl('marketing/promo.tpl');
 
         if (is_null($promo)) {
-            $promo = Session::getInt('promo');
+            $promo = S::v('promo');
         }
         $page->assign('promo', $promo);
 
@@ -186,8 +180,6 @@ class MarketingModule extends PLModule
 
     function handler_public(&$page, $uid = null)
     {
-        global $globals;
-
         $page->changeTpl('marketing/public.tpl');
 
         if (is_null($uid)) {
@@ -218,9 +210,9 @@ class MarketingModule extends PLModule
                     XDB::execute(
                             "INSERT INTO  register_marketing (uid,sender,email,date,last,nb,type,hash)
                                   VALUES  ({?}, {?}, {?}, NOW(), 0, 0, {?}, '')",
-                            $uid, Session::getInt('uid'), $email, Post::get('origine'));
+                            $uid, S::v('uid'), $email, Post::get('origine'));
                     require_once('validations.inc.php');
-                    $req = new MarkReq(Session::getInt('uid'), $uid, $email,
+                    $req = new MarkReq(S::v('uid'), $uid, $email,
                                        Post::get('origine')=='user');
                     $req->submit();
                 }
@@ -230,8 +222,6 @@ class MarketingModule extends PLModule
 
     function handler_week(&$page, $sorting = 'per_promo')
     {
-        global $globals;
-
         $page->changeTpl('marketing/this_week.tpl');
 
         $sort = $sorting == 'per_promo' ? 'promo' : 'date_ins';
@@ -246,8 +236,6 @@ class MarketingModule extends PLModule
 
     function handler_volontaire(&$page, $promo = null)
     {
-        global $globals;
-
         $page->changeTpl('marketing/volontaire.tpl');
 
         $res = XDB::query(
@@ -272,8 +260,6 @@ class MarketingModule extends PLModule
 
     function handler_relance(&$page)
     {
-        global $globals;
-
         $page->changeTpl('marketing/relance.tpl');
 
         if (Post::has('relancer')) {