3 # Display a list of all sendmail features from the M4 file
5 require './sendmail-lib.pl';
6 require './features-lib.pl';
8 $features_access || &error($text{'features_ecannot'});
9 &ui_print_header(undef, $text{'features_title'}, "");
11 @features = &list_features() if (-r $config{'sendmail_mc'} &&
12 -r "$config{'sendmail_features'}/feature");
14 # Show table of features
15 print &text('features_desc', "<tt>$config{'sendmail_mc'}</tt>",
16 "<tt>$config{'sendmail_cf'}</tt>"),"<p>\n";
17 print "<form action=edit_feature.cgi>\n";
18 print "<input type=hidden name=new value=1>\n";
19 print "<table cellpadding=0 cellspacing=0 width=100%>\n";
20 print "<tr $tb> <td><b>$text{'features_type'}</b></td>\n";
21 print "<td><b>$text{'features_value'}</b></td>\n";
22 print "<td><b>$text{'features_move'}</b></td> </tr>\n";
24 foreach $f (@features) {
26 print "<td><a href='edit_feature.cgi?idx=$f->{'index'}'>";
27 print "<b>" if ($f->{'type'});
28 print $text{"features_type".$f->{'type'}};
29 print "</b>" if ($f->{'type'});
31 print "<td><tt>",$f->{'text'} ? &html_escape($f->{'text'})
32 : "<br>","</tt></td>\n";
35 if ($i == @features-1) {
36 print "<img src=images/gap.gif>";
39 print "<a href='move.cgi?idx=$i&down=1'>",
40 "<img border=0 src=images/down.gif></a>";
43 print "<img src=images/gap.gif>";
46 print "<a href='move.cgi?idx=$i&up=1'>",
47 "<img border=0 src=images/up.gif></a>";
54 print "<table width=100%><tr><td>\n";
55 print "<input type=submit value='$text{'features_add'}'>\n";
56 print "<select name=type>\n";
57 foreach $i (0, 1, 2, 4, 5) {
58 print "<option value=$i>",$text{'features_type'.$i},"\n";
60 print "</select></td>\n";
61 print "<td align=right><input type=submit name=manual ",
62 "value='$text{'features_manual'}'></td>\n";
63 print "</tr></table></form>\n";
65 # Show button to rebuild sendmail.cf
67 print "<form action=build.cgi>\n";
68 print "<table width=100%><tr>\n";
69 print "<td><input type=submit value='$text{'features_build'}'></td>\n";
70 print "<td>",&text('features_buildmsg', "<tt>$config{'sendmail_cf'}</tt>"),
72 print "</tr></table>\n";
75 # Features file is not setup yet ..
76 if (!$config{'sendmail_mc'} || !$config{'sendmail_features'}) {
77 print "<p>",&text('features_econfig',
78 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
80 elsif (!-r $config{'sendmail_mc'}) {
81 print "<p>",&text('features_emc', "$gconfig{'webprefix'}/config.cgi?$module_name",
82 "<tt>$config{'sendmail_mc'}</tt>"),"<p>\n";
84 elsif (!-r "$config{'sendmail_features'}/feature") {
85 print "<p>",&text('features_efeatures', "$gconfig{'webprefix'}/config.cgi?$module_name",
86 "<tt>$config{'sendmail_features'}</tt>"),"<p>\n";
90 &ui_print_footer("", $text{'index_return'});