Merge branch 'platal-0.10.2'
[platal.git] / include / validations / photos.inc.php
index 7194e04..f78607d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -34,7 +34,7 @@ class PhotoReq extends Validate
     public $valid  = false;
 
     public $rules = "Refuser les photos copyrightées, de mineurs, ou ayant
-        un caractère pornographique, violent, etc... Si une photo est mal
+        un caractère pornographique, violent&hellip; Si une photo est mal
         cadrée (20% de photo et 80% de blanc par exemple), si c'est un
         camarade antique, on lui arrange sinon on lui
         refuse en lui expliquant gentiment le problème. Idem si les dimensions de
@@ -137,11 +137,10 @@ class PhotoReq extends Validate
 
     public function commit()
     {
-        require_once 'notifs.inc.php';
-        XDB::execute('REPLACE INTO  photo (uid, attachmime, attach, x, y)
+        XDB::execute('REPLACE INTO  profile_photos (pid, attachmime, attach, x, y)
                             VALUES  ({?},{?},{?},{?},{?})',
-                     $this->user->id(), $this->mimetype, $this->data, $this->x, $this->y);
-        register_watch_op($this->user->id(), WATCH_FICHE, '', 'photo');
+                     $this->user->profile()->id(), $this->mimetype, $this->data, $this->x, $this->y);
+
         return true;
     }