Handle hostnames with upper-case letters
[webmin.git] / pserver / index.cgi.bak
1 #!/usr/local/bin/perl
2 # index.cgi
3 # Display a table of icons for cvs server options
4
5 require './pserver-lib.pl';
6 &ReadParse();
7
8 if (!$cvs_path) {
9         &header($text{'index_title'}, "", undef, 1, 1);
10         print "<hr>\n";
11         print "<p>",&text('index_ecvs', "<tt>$config{'cvs'}</tt>",
12                   "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
13         print "<hr>\n";
14         &footer("/", $text{'index'});
15         exit;
16         }
17
18 $out = `$config{'cvs'} -v`;
19 if ($out !~ /CVS[^0-9\.]*([0-9\.]+)/) {
20         &header($text{'index_title'}, "", undef, 1, 1);
21         print "<hr>\n";
22         print "<p>",&text('index_eversion', "<tt>$config{'cvs'} -v</tt>",
23                           "<tt>$out</tt>"),"<p>\n";
24         print "<hr>\n";
25         &footer("/", $text{'index'});
26         exit;
27         }
28 $ver = $1;
29
30 &header($text{'index_title'}, "", undef, 1, 1, undef,
31         &help_search_link("cvs", "man", "doc"), undef, undef,
32         &text('index_version', $ver));
33 print "<hr>\n";
34
35 if (!-d "$config{'cvsroot'}/CVSROOT") {
36         print "<p>",&text('index_eroot',
37                 "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
38         print "<hr>\n";
39         &footer("/", $text{'index'});
40         exit;
41         }
42
43 # Show configuration icons
44
45 # Check if run from inetd or xinetd
46 print "<hr>\n";
47 print "<table width=100%><tr>\n";
48 $inet = &check_inetd();
49 if (!$inet) {
50         print "<form action=setup.cgi>\n";
51         print "<td><input type=submit value='$text{'index_setup'}'></td>\n";
52         print "<td>$text{'index_setupdesc'}</td>\n";
53         print "</form>\n";
54         }
55 elsif (!$inet->{'active'}) {
56         print "<form action=setup.cgi>\n";
57         print "<td><input type=submit value='$text{'index_act'}'></td>\n";
58         print "<td>",&text('index_actdesc',
59                            "<tt>$inet->{'type'}</tt>"),"</td>\n";
60         print "</form>\n";
61         }
62 else {
63         print "<form action=setup.cgi>\n";
64         print "<td><input type=submit value='$text{'index_deact'}'></td>\n";
65         print "<td>",&text('index_deactdesc',
66                            "<tt>$inet->{'type'}</tt>"),"</td>\n";
67         print "</form>\n";
68         }
69 print "</tr></table>\n";
70
71 print "<hr>\n";
72 &footer("/", $text{'index'});
73