diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 1a4fa3ca2..045fa011b 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -1213,12 +1213,15 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); continue; } - $stmt = $pdo->prepare("UPDATE `spamalias` SET `validity` = (`validity` + 3600) WHERE - `address` = :address AND - `validity` >= :validity"); + if (empty($_data['validity'])) { + continue; + } + $validity = round((int)time() + ($_data['validity'] * 3600)); + $stmt = $pdo->prepare("UPDATE `spamalias` SET `validity` = :validity WHERE + `address` = :address"); $stmt->execute(array( ':address' => $address, - ':validity' => time() + ':validity' => $validity )); $_SESSION['return'][] = array( 'type' => 'success', diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php index a4a57c140..5c0c64123 100644 --- a/data/web/lang/lang.de.php +++ b/data/web/lang/lang.de.php @@ -178,6 +178,7 @@ $lang['user']['alias_time_left'] = 'Zeit verbleibend'; $lang['user']['alias_full_date'] = 'd.m.Y, H:i:s T'; $lang['user']['alias_select_validity'] = 'Bitte Gültigkeit auswählen'; $lang['user']['sync_jobs'] = 'Sync Jobs'; +$lang['user']['expire_in'] = 'Ungültig in'; $lang['user']['hour'] = 'Stunde'; $lang['user']['hours'] = 'Stunden'; $lang['user']['day'] = 'Tag'; diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php index 383a39970..904d87cbe 100644 --- a/data/web/lang/lang.en.php +++ b/data/web/lang/lang.en.php @@ -181,11 +181,12 @@ $lang['user']['alias_time_left'] = 'Time left'; $lang['user']['alias_full_date'] = 'd.m.Y, H:i:s T'; $lang['user']['alias_select_validity'] = 'Period of validity'; $lang['user']['sync_jobs'] = 'Sync jobs'; -$lang['user']['hour'] = 'Hour'; -$lang['user']['hours'] = 'Hours'; -$lang['user']['day'] = 'Day'; -$lang['user']['week'] = 'Week'; -$lang['user']['weeks'] = 'Weeks'; +$lang['user']['expire_in'] = 'Expire in'; +$lang['user']['hour'] = 'hour'; +$lang['user']['hours'] = 'hours'; +$lang['user']['day'] = 'day'; +$lang['user']['week'] = 'week'; +$lang['user']['weeks'] = 'weeks'; $lang['user']['spamfilter'] = 'Spam filter'; $lang['admin']['spamfilter'] = 'Spam filter'; $lang['user']['spamfilter_wl'] = 'Whitelist'; diff --git a/data/web/user.php b/data/web/user.php index 76f55bee3..bbdd2c6fb 100644 --- a/data/web/user.php +++ b/data/web/user.php @@ -259,7 +259,11 @@ elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == '