From d93bc6bebeca9ef0cbcbeb6db396e73278d52b7c Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 2 May 2011 17:15:18 +0200 Subject: [PATCH] Associate the proper best_domain to a user. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/email.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/email.php b/modules/email.php index 41d4bf9..7648515 100644 --- a/modules/email.php +++ b/modules/email.php @@ -72,9 +72,10 @@ class EmailModule extends PLModule WHERE uid = {?} AND email = {?}", $user->id(), $email); XDB::execute('UPDATE accounts AS a INNER JOIN email_virtual_domains AS d ON (d.name = {?}) + INNER JOIN email_virtual_domains AS m ON (d.aliasing = m.id) SET a.best_domain = d.id - WHERE a.uid = {?}', - $domain, $user->id()); + WHERE a.uid = {?} AND m.name = {?}', + $domain, $user->id(), $user->mainEmailDomain()); // As having a non-null bestalias value is critical in // plat/al's code, we do an a posteriori check on the -- 2.1.4