#!/usr/local/bin/perl # edit_ffile.cgi # Allow editing of a filter config file require (-r 'sendmail-lib.pl' ? './sendmail-lib.pl' : -r 'qmail-lib.pl' ? './qmail-lib.pl' : './postfix-lib.pl'); &ReadParse(); if (substr($in{'file'}, 0, length($access{'apath'})) ne $access{'apath'}) { &error(&text('ffile_efile', $in{'file'})); } &ui_print_header(undef, $text{'ffile_title'}, ""); &open_readfile(FILE, $in{'file'}); while() { s/\r|\n//g; if (/^(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) { push(@filter, [ $1, $2, $3, $4 ]); } elsif (/^(2)\s+(\S+)$/) { $other = $2; } } close(FILE); print "",&text('ffile_desc', "$in{'file'}"),"

\n"; print "

\n"; print "\n"; print "\n"; print "\n"; $i = 0; foreach $f (@filter, [ 1, '', '', '' ], [ 1, '', '', '' ], [ 1, '', '', '' ], [ 1, '', '', '' ], [ 1, '', '', '' ]) { $field = "\n"; $what = "\n"; $match = "\n"; $action = "\n"; print &text('ffile_line', $field, $what, $match, $action),"
\n"; $i++; } print &text('ffile_other', ""),"
\n"; print "\n"; print "
\n"; &ui_print_footer("edit_alias.cgi?name=$in{'name'}&num=$in{'num'}", $text{'aform_return'});