From: x2000habouzit Date: Mon, 6 Sep 2004 08:27:04 +0000 (+0000) Subject: correct a bug I thought at this night X-Git-Tag: xorg/old~1565 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=0170028e039244717b602a19b7a7307118049944;p=platal.git correct a bug I thought at this night --- diff --git a/include/identification.inc.php b/include/identification.inc.php index 374eee0..660923d 100644 --- a/include/identification.inc.php +++ b/include/identification.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: identification.inc.php,v 1.5 2004-09-05 22:25:45 x2000habouzit Exp $ + $Id: identification.inc.php,v 1.6 2004-09-06 08:27:04 x2000habouzit Exp $ ***************************************************************************/ require_once('xorg.misc.inc.php'); @@ -169,11 +169,11 @@ if ($promo > 1995) { /***************************** IDENTIFICATION OK *****************************/ /*****************************************************************************/ -$result = $globals->db->query("SELECT id,type FROM aliases WHERE alias='$mailorg'"); +$result = $globals->db->query("SELECT id,type,expire FROM aliases WHERE alias='$mailorg'"); $homonyme = mysql_num_rows($result) > 0; if ( $homonyme ) { - list($h_id,$h_type) = mysql_fetch_row($result); + list($h_id,$h_type,$expire) = mysql_fetch_row($result); mysql_free_result($result); $result = $globals->db->query("SELECT alias FROM aliases WHERE alias='$forlife'"); @@ -183,8 +183,9 @@ if ( $homonyme ) { } mysql_free_result($result); - if ( $h_type != 'homonyme' ) { + if ( $h_type != 'homonyme' and empty($expire) ) { $globals->db->query("UPDATE aliases SET expire=ADD_DATE(NOW(),INTERVAL 1 MONTH) WHERE alias='$mailorg'"); + $globals->db->query("REPLACE INTO homonymes SET (homonyme_id,user_id) VALUES ($h_id,$h_id)"); require_once('diogenes.mailer.inc.php'); $mailer = new DiogenesMailer('Support Polytechnique.org ', "$mailorg@polytechnique.org",