X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fevts.inc.php;h=41896cb74e22835ed8ddf2636fdeef829c870503;hb=2553b7686e0678b8e27858a7c377e73ecb410aec;hp=4a3a0ceee64bbd41473cbb4378658b05e9144e66;hpb=787bb3d745141f2f85bd947ad7dd775d2c63f908;p=platal.git diff --git a/include/validations/evts.inc.php b/include/validations/evts.inc.php index 4a3a0ce..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,14 +94,14 @@ 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->trig("Impossible de télécharger le fichier"); + $this->trigError("Impossible de télécharger le fichier"); } elseif (!$upload->isType('image')) { - $page->trig('Le fichier n\'est pas une image valide au format JPEG, GIF ou PNG'); + $page->trigError('Le fichier n\'est pas une image valide au format JPEG, GIF ou PNG'); $upload->rm(); } elseif (!$upload->resizeImage(200, 300, 100, 100, 32284)) { - $page->trig('Impossible de retraiter l\'image'); + $page->trigError('Impossible de retraiter l\'image'); } else { $this->readImage($upload); } @@ -136,8 +136,8 @@ 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')", - $this->uid, $this->titre, $this->texte, + peremption={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')", + $this->user->id(), $this->titre, $this->texte, $this->peremption, $this->pmin, $this->pmax)) { $eid = XDB::insertId(); if ($this->img) { @@ -147,18 +147,11 @@ 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); - $text = strip_tags($this->texte, '