should be done
authorx2000habouzit <x2000habouzit>
Sat, 6 Nov 2004 17:37:21 +0000 (17:37 +0000)
committerx2000habouzit <x2000habouzit>
Sat, 6 Nov 2004 17:37:21 +0000 (17:37 +0000)
htdocs/admin/deces_promo.php
htdocs/inscription/step4.php
htdocs/profil.php
include/notifs.inc.php
include/valid_photos.inc.php

index 113d751..9f397e3 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: deces_promo.php,v 1.6 2004-11-04 20:19:36 x2000habouzit Exp $
+        $Id: deces_promo.php,v 1.7 2004-11-06 17:37:22 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -39,7 +39,7 @@ if (isset($_REQUEST["valider"]) && $_REQUEST["valider"] == "Valider") {
        $globals->db->query("UPDATE auth_user_md5 SET deces='".$_REQUEST[$mat]."' WHERE matricule = '".$mat."'");
        if($deces=='0000-00-00' or empty($deces)) {
            require_once('notifs.inc.php');
-           register_watch_op($uid,'death');
+           register_watch_op($uid,WATCH_DEATH,$_REQUEST[$mat]);
        }
     }
 }
index 015698e..3791fd3 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: step4.php,v 1.8 2004-11-04 20:19:36 x2000habouzit Exp $
+        $Id: step4.php,v 1.9 2004-11-06 17:37:22 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -122,7 +122,7 @@ if (!empty($_REQUEST['ref'])) {
     // insérer l'inscription dans la table des inscriptions confirmé
     $globals->db->query("INSERT INTO ins_confirmees SET id=$uid");
     require_once('notifs.inc.php');
-    register_watch_op($uid,'ins');
+    register_watch_op($uid,WATCH_INSCR);
 
     // insérer une ligne dans user_changes pour que les coordonnées complè
     // soient envoyées a l'
index b0aaa29..f1ff09f 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: profil.php,v 1.12 2004-11-05 13:29:52 x2000habouzit Exp $
+        $Id: profil.php,v 1.13 2004-11-06 17:37:21 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -101,9 +101,8 @@ if (isset($_REQUEST['modifier']) || isset($_REQUEST['suivant'])) {
     $globals->db->query($sql);
     
     if(empty($_SESSION['suid'])) {
-        $sql = $sql.",date='$date' WHERE user_id={$_SESSION['uid']}";
        require_once('notifs.inc.php');
-       register_watch_op($_SESSION['uid'],'fiche');
+       register_watch_op($_SESSION['uid'],WATCH_FICHE);
     }
 
     // mise a jour des champs relatifs au tab ouvert
index 781eadf..2b76c7f 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: notifs.inc.php,v 1.7 2004-11-06 17:22:12 x2000habouzit Exp $
+        $Id: notifs.inc.php,v 1.8 2004-11-06 17:37:22 x2000habouzit Exp $
  ***************************************************************************/
 
-require_once('diogenes.flagset.inc.php');
+define("WATCH_FICHE", 1);
+define("WATCH_INSCR", 2);
+define("WATCH_DEATH", 3);
+
+function register_watch_op($uid,$cid,$date='',$info='') {
+    $date = empty($date) ? 'NOW()' : "'$date'";
+    $globals->db->query("REPLACE INTO watch_ops (uid,cid,known,date,info) VALUES('$uid','$cid',NOW(),$date,'$info')");
+    if($cid == WATCH_FICHE) {
+       $globals->db->query("UPDATE auth_user_md5 SET DATE=NOW() WHERE user_id='$uid'");
+    }
+}
 
 class Watch {
     var $_uid;
index d062e82..79b216f 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: valid_photos.inc.php,v 1.14 2004-11-04 20:19:36 x2000habouzit Exp $
+        $Id: valid_photos.inc.php,v 1.15 2004-11-06 17:37:22 x2000habouzit Exp $
  ***************************************************************************/
 
 
@@ -108,7 +108,7 @@ class PhotoReq extends Validate {
         $globals->db->query("REPLACE INTO photo set uid='".$this->uid."', attachmime = '".$this->mimetype."', attach='"
             .addslashes($this->data)."', x='".$this->x."', y='".$this->y."'");
        require('notifs.inc.php');
-       register_watch_op($this->uid,'fiche');
+       register_watch_op($this->uid,WATCH_FICHE);
     }
 }