Only show un-conditional forward and autoreply rules in quick links
authorJamie Cameron <jcameron@webmin.com>
Fri, 1 Jan 2010 19:28:59 +0000 (11:28 -0800)
committerJamie Cameron <jcameron@webmin.com>
Fri, 1 Jan 2010 19:28:59 +0000 (11:28 -0800)
filter/CHANGELOG
filter/edit_auto.cgi
filter/edit_forward.cgi
filter/filter-lib.pl
filter/save_auto.cgi
filter/save_forward.cgi

index 7a1a09f..eba8a2a 100644 (file)
@@ -26,3 +26,5 @@ Creation of filters that match headers is now less error-prone, due to a new men
 When an autoreply is deleted, the underlying message file is deleted too.
 ---- Changes since 1.420 ----
 Autoreply messages starting with <html> or <body> will now be sent using the text/html MIME type.
+---- Changes since 1.430 ----
+Quick autoreply and forward setup pages now only show un-conditional rules.
index 8f83089..93ce969 100755 (executable)
@@ -8,7 +8,7 @@ require './filter-lib.pl';
 
 # Get the autoreply filter, if any
 @filters = &list_filters();
-($filter) = grep { $_->{'actionreply'} } @filters;
+($filter) = grep { $_->{'actionreply'} && $_->{'nocond'} } @filters;
 $dis = !$filter;
 
 print &ui_form_start("save_auto.cgi", "post");
index f1f64ce..80eec2e 100755 (executable)
@@ -8,7 +8,7 @@ require './filter-lib.pl';
 
 # Get the forwarding filter, if any
 @filters = &list_filters();
-($filter) = grep { $_->{'actiontype'} eq '!' } @filters;
+($filter) = grep { $_->{'actiontype'} eq '!' && $_->{'nocond'} } @filters;
 $dis = !$filter;
 
 print &ui_form_start("save_forward.cgi", "post");
index 344023e..96bafe8 100755 (executable)
@@ -105,6 +105,7 @@ foreach my $r (@pmrc) {
        # Finally create the simple object
        local $simple = { 'condtype' => $condtype,
                          'cond' => $cond,
+                         'nocond' => !scalar(@{$r->{'conds'}}),
                          'body' => $flags{'B'},
                          'continue' => $flags{'c'},
                          'actiontype' => $r->{'type'},
index d6b0ecb..4581274 100755 (executable)
@@ -9,7 +9,7 @@ require './filter-lib.pl';
 # Find existing autoreply filter object
 &lock_file($procmail::procmailrc);
 @filters = &list_filters();
-($old) = grep { $_->{'actionreply'} } @filters;
+($old) = grep { $_->{'actionreply'} && $_->{'nocond'} } @filters;
 $filter = $old;
 
 if ($filter && !$in{'enabled'}) {
index 8369f7e..a4828cf 100755 (executable)
@@ -8,7 +8,7 @@ require './filter-lib.pl';
 # Find existing forwarding filter object
 &lock_file($procmail::procmailrc);
 @filters = &list_filters();
-($old) = grep { $_->{'actiontype'} eq '!' } @filters;
+($old) = grep { $_->{'actiontype'} eq '!' && $_->{'nocond'} } @filters;
 $filter = $old;
 
 if ($filter && !$in{'enabled'}) {