Fixes non-referenced use of User, which would have led to a performance impact.
[platal.git] / modules / events.php
index 1d63a4b..24b0a4b 100644 (file)
@@ -218,7 +218,7 @@ class EventsModule extends PLModule
                 exit;
             }
         } else {
-            $upload = new PlUpload(S::v('forlife'), 'event');
+            $upload = new PlUpload(S::user()->login(), 'event');
             if ($upload->exists() && $upload->isType('image')) {
                 header('Content-Type: ' . $upload->contentType());
                 echo $upload->getContents();
@@ -233,7 +233,7 @@ class EventsModule extends PLModule
 
     function handler_rss(&$page, $user = null, $hash = null)
     {
-        require_once dirname(__FILE__) . '/events/feed.inc.php';
+        $this->load('feed.inc.php');
         $feed = new EventFeed();
         return $feed->run($page, $user, $hash);
     }
@@ -269,7 +269,7 @@ class EventsModule extends PLModule
         $peremption = Post::i('peremption');
         $valid_mesg = Post::v('valid_mesg');
         $action     = Post::v('action');
-        $upload     = new PlUpload(S::v('forlife'), 'event');
+        $upload     = new PlUpload(S::user()->login(), 'event');
         $this->upload_image($page, $upload);
 
         if (($promo_min > $promo_max && $promo_max != 0)||
@@ -299,7 +299,7 @@ class EventsModule extends PLModule
 
             require_once 'validations.inc.php';
             $evtreq = new EvtReq($titre, $texte, $promo_min, $promo_max,
-                                 $peremption, $valid_mesg, S::v('uid'), $upload);
+                                 $peremption, $valid_mesg, S::user(), $upload);
             $evtreq->submit();
             $page->assign('ok', true);
         } elseif (!Env::v('preview')) {
@@ -343,7 +343,7 @@ class EventsModule extends PLModule
         $arch = $action == 'archives';
         $page->assign('action', $action);
 
-        $upload = new PlUpload(S::v('forlife'), 'event');
+        $upload = new PlUpload(S::user()->login(), 'event');
         if ((Env::has('preview') || Post::v('action') == "Proposer") && $eid) {
             $action = 'edit';
             $this->upload_image($page, $upload);