From 5f8dfa53664a6c88a42d3515fd85a0df8112c247 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Wed, 1 Sep 2004 17:59:07 +0000 Subject: [PATCH] easy backport ... utilisateur.php will be trickier --- htdocs/admin/homonymes.php | 4 ++-- include/identification.inc.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/homonymes.php b/htdocs/admin/homonymes.php index 5a71d34..1a7ad27 100644 --- a/htdocs/admin/homonymes.php +++ b/htdocs/admin/homonymes.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: homonymes.php,v 1.2 2004-08-31 10:03:29 x2000habouzit Exp $ + $Id: homonymes.php,v 1.3 2004-09-01 17:59:07 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -60,7 +60,7 @@ if ($target) { $op = 'list'; break; case 'correct': - $globals->db->query("update auth_user_md5 set alias='' where user_id=$target"); + $globals->db->query("REPLACE INTO aliases VALUES ('$loginbis', 'homonyme', 0)"); $mymail = new DiogenesMailer($cc,$username,"Mise en place du robot $loginbis@polytechnique.org",false,$cc); $mymail->addHeader($FROM); $mymail->setBody(stripslashes($_REQUEST['mailbody'])); diff --git a/include/identification.inc.php b/include/identification.inc.php index aeb5390..433e237 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.2 2004-08-31 11:16:48 x2000habouzit Exp $ + $Id: identification.inc.php,v 1.3 2004-09-01 17:59:08 x2000habouzit Exp $ ***************************************************************************/ @@ -193,7 +193,7 @@ if ( mysql_num_rows($result) > 0 ) { // un homonyme est déjà enregistré, le prévenir // (la promo ne peut pas être pareille, cas déjà testé) mysql_free_result($result); - $newlogin = sprintf("%s%02d",$loginbis,$mypromo%100); + $newlogin = $loginbis.".".(($mypromo >= 2000) ? $mypromo : ($mypromo%100))); $sql = "UPDATE auth_user_md5 SET loginbis='$loginbis', username = '$newlogin', alias='$loginbis', date_mise_alias_temp = NOW() WHERE user_id = $uid"; $globals->db->query($sql); if ( mysql_affected_rows() == 0 ) { -- 2.1.4