Handle hostnames with upper-case letters
[webmin.git] / acl / cert_form.cgi
1 #!/usr/local/bin/perl
2 # cert_form.cgi
3
4 require './acl-lib.pl';
5 &ui_print_header(undef, $text{'cert_title'}, "", undef, undef, undef, undef, undef, undef,
6         "language=VBSCRIPT onload='postLoad()'");
7 eval "use Net::SSLeay";
8
9 print "<p>$text{'cert_msg'}<p>\n";
10 if ($ENV{'SSL_USER'}) {
11         print &text('cert_already', "<tt>$ENV{'SSL_USER'}</tt>"),
12               "<p>\n";
13         }
14
15 if ($ENV{'HTTP_USER_AGENT'} =~ /Mozilla/i) {
16         # Output a form that works for netscape and mozilla
17         print "<form action=cert_issue.cgi>\n";
18         print "<table border>\n";
19         print "<tr $tb> <td><b>$text{'cert_header'}</b></td> </tr>\n";
20         print "<tr $cb> <td><table>\n";
21
22         print "<tr> <td><b>$text{'cert_cn'}</b></td>\n";
23         print "<td><input name=commonName size=30></td> </tr>\n";
24
25         print "<tr> <td><b>$text{'cert_email'}</b></td>\n";
26         print "<td><input name=emailAddress size=30></td> </tr>\n";
27
28         print "<tr> <td><b>$text{'cert_ou'}</b></td>\n";
29         print "<td><input name=organizationalUnitName size=30></td> </tr>\n";
30
31         print "<tr> <td><b>$text{'cert_o'}</b></td>\n";
32         print "<td><input name=organizationName size=30></td> </tr>\n";
33
34         print "<tr> <td><b>$text{'cert_sp'}</b></td>\n";
35         print "<td><input name=stateOrProvinceName size=15></td> </tr>\n";
36
37         print "<tr> <td><b>$text{'cert_c'}</b></td>\n";
38         print "<td><input name=countryName size=2></td> </tr>\n";
39
40         print "<tr> <td><b>$text{'cert_key'}</b></td>\n";
41         print "<td><keygen name=key></td> </tr>\n";
42
43         print "</table></td></tr></table>\n";
44         print "<input type=submit value='$text{'cert_issue'}'>\n";
45         print "</form>\n";
46         }
47 else {
48         # Unsupported browser!
49         print "<p><b>",&text('cert_ebrowser',
50                              "<tt>$ENV{'HTTP_USER_AGENT'}</tt>"),"</b><p>\n";
51         }
52
53 &ui_print_footer("", $text{'index_return'});
54