X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=inline;f=include%2Fvalidations%2Fphotos.inc.php;h=26f45f8a6906665ac16e3cc5c8cda7ee27361ddc;hb=730a173a333507926e0029d8a96c3a26b55756e4;hp=9010dea14df0677fc40ffa2f29d80673a2ddc023;hpb=abe7e055f16e6f6e9605c2965164169babbf9b7f;p=platal.git diff --git a/include/validations/photos.inc.php b/include/validations/photos.inc.php index 9010dea..26f45f8 100644 --- a/include/validations/photos.inc.php +++ b/include/validations/photos.inc.php @@ -1,6 +1,6 @@ valid = $upload->resizeImage(240, 300, 160, 0, SIZE_MAX); + $this->valid = $upload->resizeImage(240, 300, 160, 0, SIZE_MAX); if (!$this->valid) { $this->trig('Le fichier que tu as transmis n\'est pas une image valide, ou est trop gros pour être traité'); } @@ -62,7 +62,7 @@ class PhotoReq extends Validate list($this->x, $this->y, $this->mimetype) = $upload->imageInfo(); $upload->rm(); } - + // }}} // {{{ function isValid() @@ -137,11 +137,11 @@ class PhotoReq extends Validate public function commit() { + require_once 'notifs.inc.php'; XDB::execute('REPLACE INTO photo (uid, attachmime, attach, x, y) VALUES ({?},{?},{?},{?},{?})', $this->uid, $this->mimetype, $this->data, $this->x, $this->y); - require_once('notifs.inc.php'); - register_watch_op($this->uid, WATCH_FICHE); + register_watch_op($this->uid, WATCH_FICHE, 'photo'); return true; }