From a2dc11a423a6902b9eaed87e489f15430e0ad902 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sat, 6 Nov 2004 17:37:21 +0000 Subject: [PATCH] should be done --- htdocs/admin/deces_promo.php | 4 ++-- htdocs/inscription/step4.php | 4 ++-- htdocs/profil.php | 5 ++--- include/notifs.inc.php | 14 ++++++++++++-- include/valid_photos.inc.php | 4 ++-- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/deces_promo.php b/htdocs/admin/deces_promo.php index 113d751..9f397e3 100644 --- a/htdocs/admin/deces_promo.php +++ b/htdocs/admin/deces_promo.php @@ -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]); } } } diff --git a/htdocs/inscription/step4.php b/htdocs/inscription/step4.php index 015698e..3791fd3 100644 --- a/htdocs/inscription/step4.php +++ b/htdocs/inscription/step4.php @@ -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' diff --git a/htdocs/profil.php b/htdocs/profil.php index b0aaa29..f1ff09f 100644 --- a/htdocs/profil.php +++ b/htdocs/profil.php @@ -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 diff --git a/include/notifs.inc.php b/include/notifs.inc.php index 781eadf..2b76c7f 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -18,10 +18,20 @@ * 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; diff --git a/include/valid_photos.inc.php b/include/valid_photos.inc.php index d062e82..79b216f 100644 --- a/include/valid_photos.inc.php +++ b/include/valid_photos.inc.php @@ -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); } } -- 2.1.4