X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fvalidations%2Fevts.inc.php;h=41896cb74e22835ed8ddf2636fdeef829c870503;hb=e46cf8c46341b447cc3701c8afcc9baec3da11e5;hp=c33ce5e06309cff271f3ec62426e1db8983ec6c5;hpb=527ccdb5d9e3a120168331f4aa3070f6c574228e;p=platal.git diff --git a/include/validations/evts.inc.php b/include/validations/evts.inc.php index c33ce5e..41896cb 100644 --- a/include/validations/evts.inc.php +++ b/include/validations/evts.inc.php @@ -1,6 +1,6 @@ titre = $_titre; $this->texte = $_texte; $this->pmin = $_pmin; @@ -94,7 +94,7 @@ class EvtReq extends Validate $this->pmax = Env::i('promo_max'); $this->peremption = Env::v('peremption'); if (@$_FILES['image']['tmp_name']) { - $upload = PlUpload::get($_FILES['image'], S::v('forlife'), 'event'); + $upload = PlUpload::get($_FILES['image'], S::user()->login(), 'event'); if (!$upload) { $this->trigError("Impossible de télécharger le fichier"); } elseif (!$upload->isType('image')) { @@ -137,7 +137,7 @@ class EvtReq extends Validate if (XDB::execute("INSERT INTO evenements SET user_id = {?}, creation_date=NOW(), titre={?}, texte={?}, peremption={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')", - $this->uid, $this->titre, $this->texte, + $this->user->id(), $this->titre, $this->texte, $this->peremption, $this->pmin, $this->pmax)) { $eid = XDB::insertId(); if ($this->img) { @@ -147,10 +147,8 @@ class EvtReq extends Validate } global $globals; if ($globals->banana->event_forum) { - require_once 'user.func.inc.php'; - $forlife = get_user_forlife($this->uid); require_once 'banana/forum.inc.php'; - $banana = new ForumsBanana($forlife); + $banana = new ForumsBanana($this->user); $post = $banana->post($globals->banana->event_forum, $globals->banana->event_reply, $this->titre, MiniWiki::wikiToText($this->texte, false, 0, 80));