From: Stéphane Jacob Date: Fri, 25 Feb 2011 12:59:54 +0000 (+0100) Subject: Bestalias should not be expired. X-Git-Tag: xorg/1.1.0~108 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=aca54585dcd431240a0286adf6007b1ceb5a672a;p=platal.git Bestalias should not be expired. Signed-off-by: Stéphane Jacob --- diff --git a/include/emails.inc.php b/include/emails.inc.php index e1750a7..35621e2 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -178,7 +178,7 @@ function fix_bestalias(User $user) { $count = XDB::fetchOneCell('SELECT COUNT(*) FROM email_source_account - WHERE uid = {?} AND FIND_IN_SET(\'bestalias\', flags)', + WHERE uid = {?} AND FIND_IN_SET(\'bestalias\', flags) AND expire IS NULL', $user->id()); if ($count == 1) { @@ -196,7 +196,7 @@ function fix_bestalias(User $user) // related to a usage name and contains a '.'. XDB::execute("UPDATE email_source_account SET flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'bestalias') - WHERE uid = {?} + WHERE uid = {?} AND expire IS NULL ORDER BY NOT FIND_IN_SET('usage', flags), email LIKE '%.%', LENGTH(email) LIMIT 1", $user->id());