Skip to content

Commit 74196ba

Browse files
committed
always write before/after sieve scripts, and autoresponder dates optional
1 parent acdbd68 commit 74196ba

33 files changed

+162
-173
lines changed

install/sql/incremental/upd_dev_collection.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ ALTER TABLE `web_domain` CHANGE `apache_directives` `apache_directives` mediumte
4949
ALTER TABLE `web_domain` CHANGE `nginx_directives` `nginx_directives` mediumtext NULL DEFAULT NULL;
5050

5151
-- add move to junk before/after option, default to after
52-
ALTER TABLE `mail_user` MODIFY `move_junk` enum('y','a','n') NOT NULL DEFAULT 'a';
52+
ALTER TABLE `mail_user` MODIFY `move_junk` enum('y','a','n') NOT NULL DEFAULT 'y';

install/sql/ispconfig3.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ CREATE TABLE `mail_user` (
10461046
`autoresponder_end_date` datetime NULL default NULL,
10471047
`autoresponder_subject` varchar(255) NOT NULL default 'Out of office reply',
10481048
`autoresponder_text` mediumtext NULL,
1049-
`move_junk` enum('y','a','n') NOT NULL default 'a',
1049+
`move_junk` enum('y','a','n') NOT NULL default 'y',
10501050
`purge_trash_days` INT NOT NULL DEFAULT '0',
10511051
`purge_junk_days` INT NOT NULL DEFAULT '0',
10521052
`custom_mailfilter` mediumtext,

interface/lib/classes/validate_autoresponder.inc.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,11 @@
3131

3232
class validate_autoresponder extends validate_datetime
3333
{
34-
function start_date($field_name, $field_value, $validator)
35-
{
36-
global $app;
37-
38-
// save field value for later use in end_date()
39-
$this->start_date = $field_value;
40-
41-
if($_POST['autoresponder'] == 'y' && $field_value == '') {
42-
// we need a start date when autoresponder is on
43-
return $app->tform->lng($validator['errmsg']).'<br />';
44-
}
45-
}
46-
4734
function end_date($field_name, $field_value, $validator)
4835
{
4936
global $app;
5037

51-
$start_date = $this->start_date;
52-
//$start_date = $app->tform_actions->dataRecord['autoresponder_start_date'];
38+
$start_date = $app->tform_actions->dataRecord['autoresponder_start_date'];
5339

5440
// Parse date
5541
$datetimeformat = (isset($app->remoting_lib) ? $app->remoting_lib->datetimeformat : $app->tform->datetimeformat);
@@ -60,8 +46,8 @@ function end_date($field_name, $field_value, $validator)
6046
$start_date_tstamp = mktime($start_date_array['hour'], $start_date_array['minute'], $start_date_array['second'], $start_date_array['month'], $start_date_array['day'], $start_date_array['year']);
6147
$end_date_tstamp = mktime($end_date_array['hour'], $end_date_array['minute'], $end_date_array['second'], $end_date_array['month'], $end_date_array['day'], $end_date_array['year']);
6248

63-
// End date has to be > start date
64-
if($end_date_tstamp <= $start_date_tstamp && ($start_date || $field_value)) {
49+
// If both are set, end date has to be > start date
50+
if($start_date && $field_value && $end_date_tstamp <= $start_date_tstamp) {
6551
return $app->tform->lng($validator['errmsg']).'<br />';
6652
}
6753
}

interface/web/mail/form/mail_user.tform.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,6 @@
364364
0 => array ( 'type' => 'ISDATETIME',
365365
'allowempty' => 'y',
366366
'errmsg'=> 'autoresponder_start_date_is_no_date'),
367-
1 => array ( 'type' => 'CUSTOM',
368-
'class' => 'validate_autoresponder',
369-
'function' => 'start_date',
370-
'errmsg'=> 'autoresponder_start_date_is_required'),
371367
)
372368
),
373369
'autoresponder_end_date' => array (
@@ -403,7 +399,7 @@
403399
'move_junk' => array (
404400
'datatype' => 'VARCHAR',
405401
'formtype' => 'SELECT',
406-
'default' => 'a',
402+
'default' => 'y',
407403
'value' => array('y' => 'move_junk_y_txt', 'a' => 'move_junk_a_txt', 'n' => 'move_junk_n_txt'),
408404
),
409405
'purge_trash_days' => array (

interface/web/mail/lib/lang/ar_mail_user.lng

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $wb['autoresponder_txt'] = 'Active';
1111
$wb['autoresponder_start_date_txt'] = 'Start on';
1212
$wb['autoresponder_start_date_ispast'] = 'Start date cannot be in the past.';
1313
$wb['autoresponder_end_date_txt'] = 'End by';
14-
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
14+
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
1515
$wb['no_domain_perm'] = 'You have no permission for this domain.';
1616
$wb['error_no_pwd'] = 'Password is empty.';
1717
$wb['quota_error_isint'] = 'Mailbox size must be a number.';
@@ -60,7 +60,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
6060
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
6161
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
6262
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
63-
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
6463
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
6564
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
6665
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';

interface/web/mail/lib/lang/bg_mail_user.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ $wb['password_match_txt'] = 'The passwords do match.';
5454
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
5555
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
5656
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
57-
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
5857
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
5958
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
6059
$wb['backup_interval_txt'] = 'Backup interval';

interface/web/mail/lib/lang/br_mail_user.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ $wb['autoresponder_start_date_txt'] = 'Iniciar em';
1414
$wb['autoresponder_start_date_ispast'] = 'O campo "Iniciar em" não pode ser menor que a data atual.';
1515
$wb['autoresponder_end_date_txt'] = 'Terminar em';
1616
$wb['autoresponder_end_date_isgreater'] = 'O campo "Terminar em" deve ser configurado e não pode ser menor ou igual a data atual.';
17-
$wb['autoresponder_start_date_is_required'] = 'Data iniciar deve ser configurado quando a opção de auto-resposta estiver habilitada.';
1817
$wb['no_domain_perm'] = 'Você não tem permissão para este domínio.';
1918
$wb['error_no_pwd'] = 'A senha está em branco.';
2019
$wb['quota_error_isint'] = 'O tamanho da conta de e-mail deve ser um número.';

interface/web/mail/lib/lang/ca_mail_user.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ $wb['password_match_txt'] = 'Les mots de passe correspondent.';
5353
$wb['disablesmtp_txt'] = 'Désactiver SMTP (envoi)';
5454
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
5555
$wb['cc_note_txt'] = '(Séparer chaque adresses par une virgule)';
56-
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
5756
$wb['greylisting_txt'] = 'Enable greylisting';
5857
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
5958
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';

interface/web/mail/lib/lang/cz_mail_user.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ $wb['password_match_txt'] = 'Hesla se shodují.';
5353
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
5454
$wb['cc_note_txt'] = '(Při posílání kopií na více e-mailových adres, oddělte čárkami.)';
5555
$wb['disablesmtp_txt'] = 'Zakázat SMTP (pouze odesílání)';
56-
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
5756
$wb['greylisting_txt'] = 'Povolit greylisting';
5857
$wb['sender_cc_txt'] = 'Odeslat odchozí kopii na';
5958
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';

interface/web/mail/lib/lang/de_mail_user.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ $wb['daily_backup_txt'] = 'taeglich';
6060
$wb['weekly_backup_txt'] = 'woechentlich';
6161
$wb['monthly_backup_txt'] = 'monatlich';
6262
$wb['cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)';
63-
$wb['autoresponder_start_date_is_required'] = 'Startdatum muss angegeben werden.';
6463
$wb['sender_cc_txt'] = 'Kopie ausgehender Emails senden an (BCC)';
6564
$wb['sender_cc_error_isemail'] = '-Kopie ausgehender Emails senden an- Feld enthält keine gültige Emailadresse';
6665
$wb['sender_cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)';

0 commit comments

Comments
 (0)