#!/usr/local/bin/perl # edit_feature.cgi # Displays a form for editing or creating some M4 file entry, which may be a # feature, define, mailer or other line. require './sendmail-lib.pl'; require './features-lib.pl'; &ReadParse(); $features_access || &error($text{'features_ecannot'}); if ($in{'manual'}) { # Display manual edit form &ui_print_header(undef, $text{'feature_manual'}, ""); print "
\n"; print &text('feature_mdesc', "$config{'sendmail_mc'}"), "
\n"; print "
\n"; print "
\n"; &ui_print_footer("list_features.cgi", $text{'features_return'}); exit; } if ($in{'new'}) { &ui_print_header(undef, $text{'feature_add'}, ""); $feature = { 'type' => $in{'type'} }; } else { &ui_print_header(undef, $text{'feature_edit'}, ""); @features = &list_features(); $feature = $features[$in{'idx'}]; } print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'feature_header'}
\n"; if (!$in{'new'} && $feature->{'type'}) { print "\n"; print "\n"; } if ($feature->{'type'} == 0) { # Unsupported text line print "\n"; printf "\n", &html_escape($feature->{'text'}); } elsif ($feature->{'type'} == 1) { # A FEATURE() definition print "\n"; print "\n"; print "\n"; } elsif ($feature->{'type'} == 2 || $feature->{'type'} == 3) { # A define() or undefine() print "\n"; print "\n"; print "\n"; } elsif ($feature->{'type'} == 4) { # A MAILER() definition print "\n"; print "\n"; } elsif ($feature->{'type'} == 5) { # An OSTYPE() definition print "\n"; print "\n"; } print "
$text{'feature_old'}$feature->{'text'}
$text{'feature_text'}
$text{'feature_feat'}
$text{'feature_values'} \n"; local @v = @{$feature->{'values'}}; @v = ( "" ) if (!@v); for($i=0; $i<=@v; $i++) { print "
\n"; } print "
$text{'feature_def'}\n"; print "
$text{'feature_defval'}\n"; printf " %s\n", $feature->{'type'} == 2 ? "checked" : "", $text{'feature_defmode1'}; printf "
\n", $feature->{'value'}; printf " %s\n", $feature->{'type'} == 3 ? "checked" : "", $text{'feature_defmode0'}; print "
$text{'feature_mailer'}
$text{'feature_ostype'}
\n"; print "\n"; if ($in{'new'}) { print "\n"; } else { print "\n"; print "\n"; } print "
\n"; &ui_print_footer("list_features.cgi", $text{'features_return'});