From: Stéphane Jacob Date: Mon, 2 May 2011 15:15:18 +0000 (+0200) Subject: Associate the proper best_domain to a user. X-Git-Tag: xorg/1.1.1~36 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d93bc6bebeca9ef0cbcbeb6db396e73278d52b7c;p=platal.git Associate the proper best_domain to a user. Signed-off-by: Stéphane Jacob --- 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