From 05240425140f47e3ed030aeea5316c26f18a3b0d Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Fri, 26 Feb 2010 23:04:54 +0100 Subject: [PATCH] homonyms.user_id -> homonyms.uid Signed-off-by: Florent Bruneau --- bin/cron/homonymes.php | 2 +- include/validations/homonymes.inc.php | 2 +- modules/admin.php | 4 ++-- modules/register/register.inc.php | 4 ++-- templates/admin/homonymes.tpl | 4 ++-- upgrade/account/20_naming_convention.sql | 2 ++ 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bin/cron/homonymes.php b/bin/cron/homonymes.php index e9ec420..88fe2d9 100755 --- a/bin/cron/homonymes.php +++ b/bin/cron/homonymes.php @@ -36,7 +36,7 @@ while ($old = $resRobot->next()) { $res = XDB::query( "SELECT u.hruid FROM homonyms AS h - INNER JOIN auth_user_md5 AS u USING (user_id) + INNER JOIN auth_user_md5 AS u ON (h.uid = u.user_id) WHERE homonyme_id = {?}", $old['id']); $hruids = $res->fetchColumn(); diff --git a/include/validations/homonymes.inc.php b/include/validations/homonymes.inc.php index 57fdbac..7144c91 100644 --- a/include/validations/homonymes.inc.php +++ b/include/validations/homonymes.inc.php @@ -125,7 +125,7 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact."; switch_bestalias($this->user, $this->loginbis); if (!$this->warning) { XDB::execute("UPDATE aliases SET type = 'homonyme', expire = NOW() WHERE alias = {?}", $this->loginbis); - XDB::execute("REPLACE INTO homonyms (homonyme_id, user_id) VALUES({?}, {?})", $this->user->id(), $this->user->id()); + XDB::execute("REPLACE INTO homonyms (homonyme_id, uid) VALUES({?}, {?})", $this->user->id(), $this->user->id()); } return true; diff --git a/modules/admin.php b/modules/admin.php index 988a3ea..b085138 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -843,7 +843,7 @@ class AdminModule extends PLModule XDB::execute("UPDATE aliases SET type = 'homonyme', expire=NOW() WHERE alias = {?}", $loginbis); - XDB::execute("REPLACE INTO homonyms (homonyme_id,user_id) + XDB::execute("REPLACE INTO homonyms (homonyme_id, uid) VALUES ({?}, {?})", $target, $target); send_robot_homonyme($user, $loginbis); $op = 'list'; @@ -860,7 +860,7 @@ class AdminModule extends PLModule ac.uid AS user_id FROM aliases AS a LEFT JOIN homonyms AS h ON (h.homonyme_id = a.uid) - INNER JOIN aliases AS s ON (s.uid = h.user_id AND s.type='a_vie') + INNER JOIN aliases AS s ON (s.uid = h.uid AND s.type='a_vie') INNER JOIN accounts AS ac ON (ac.uid = a.uid) WHERE a.type = 'homonyme' OR a.expire != '' ORDER BY a.alias, forlife"); diff --git a/modules/register/register.inc.php b/modules/register/register.inc.php index 971d35f..e70fdae 100644 --- a/modules/register/register.inc.php +++ b/modules/register/register.inc.php @@ -172,8 +172,8 @@ function create_aliases (&$sub) list($h_id, $h_type, $expire) = $res->fetchOneRow(); if ($h_type != 'homonyme' and empty($expire)) { XDB::execute('UPDATE aliases SET expire=ADDDATE(NOW(),INTERVAL 1 MONTH) WHERE alias={?}', $mailorg); - XDB::execute('REPLACE INTO homonyms (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $h_id); - XDB::execute('REPLACE INTO homonyms (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $uid); + XDB::execute('REPLACE INTO homonyms (homonyme_id, uid) VALUES ({?},{?})', $h_id, $h_id); + XDB::execute('REPLACE INTO homonyms (homonyme_id, uid) VALUES ({?},{?})', $h_id, $uid); $res = XDB::query("SELECT alias FROM aliases WHERE uid={?} AND expire IS NULL", $h_id); $als = $res->fetchColumn(); diff --git a/templates/admin/homonymes.tpl b/templates/admin/homonymes.tpl index d51cc90..ab8d9fe 100644 --- a/templates/admin/homonymes.tpl +++ b/templates/admin/homonymes.tpl @@ -55,8 +55,8 @@ fiche edit {if $user.type eq 'alias'} - envoyer un email - corriger + envoyer un email + corriger {/if} diff --git a/upgrade/account/20_naming_convention.sql b/upgrade/account/20_naming_convention.sql index 7e7b867..3e8477b 100644 --- a/upgrade/account/20_naming_convention.sql +++ b/upgrade/account/20_naming_convention.sql @@ -25,6 +25,8 @@ CHANGE COLUMN user_id uid INT(11) not null; CHANGE COLUMN user_id uid INT(11) not null; ALTER TABLE axletter_rights CHANGE COLUMN user_id uid INT(11) not null; + ALTER TABLE homonyms +CHANGE COLUMN user_id uid INT(11) not null; # announces ALTER TABLE announces -- 2.1.4