4 BEGIN { push(@INC, ".."); };
8 #$ENV{'MINISERV_INTERNAL'} || die "Can only be called by miniserv.pl";
11 if ($gconfig{'loginbanner'} && $ENV{'HTTP_COOKIE'} !~ /banner=1/ &&
13 # Show pre-login HTML page
14 print "Set-Cookie: banner=1; path=/\r\n";
17 open(BANNER, $gconfig{'loginbanner'});
25 $sec = uc($ENV{'HTTPS'}) eq 'ON' ? "; secure" : "";
26 &get_miniserv_config(\%miniserv);
27 print "Set-Cookie: banner=0; path=/$sec\r\n" if ($gconfig{'loginbanner'});
28 print "Set-Cookie: testing=1; path=/$sec\r\n";
29 &ui_print_unbuffered_header(undef, undef, undef, undef, undef, 1, 1, undef,
30 undef, "onLoad='document.forms[0].answer.focus()'");
33 if (defined($in{'failed'})) {
34 print "<h3>$text{'session_failed'}</h3><p>\n";
36 elsif ($in{'logout'}) {
37 print "<h3>$text{'session_logout'}</h3><p>\n";
39 elsif ($in{'timed_out'}) {
40 print "<h3>",&text('session_timed_out', int($in{'timed_out'}/60)),"</h3><p>\n";
43 print "$text{'pam_prefix'}\n";
44 print "<form action=$gconfig{'webprefix'}/pam_login.cgi method=post>\n";
45 print "<input type=hidden name=cid value='","e_escape($in{'cid'}),"'>\n";
47 print "<table border width=40%>\n";
48 print "<tr $tb> <td><b>$text{'pam_header'}</b></td> </tr>\n";
49 print "<tr $cb> <td align=center><table cellpadding=3>\n";
50 if ($gconfig{'realname'}) {
51 $host = &get_system_hostname();
54 $host = $ENV{'HTTP_HOST'};
56 $host = &html_escape($host);
61 print "<tr> <td colspan=2 align=center>",
62 &html_escape($in{'message'}),"</td> </tr>\n";
63 print "<input type=hidden name=message value=1>\n";
67 print "<tr> <td colspan=2 align=center>",
68 &text($gconfig{'nohostname'} ? 'pam_mesg2' : 'pam_mesg',
69 "<tt>$host</tt>"),"</td> </tr>\n";
71 $pass = "type=password" if ($in{'password'});
72 print "<tr> <td><b>",&html_escape($in{'question'}),"</b></td>\n";
73 print "<td><input name=answer $pass size=20></td> </tr>\n";
76 print "<tr> <td colspan=2 align=center>\n";
77 print "<input type=submit value='$text{'pam_login'}'>\n";
78 print "<input type=reset value='$text{'session_clear'}'>\n";
79 if (!$in{'initial'}) {
80 print "<input type=submit name=restart value='$text{'pam_restart'}'>\n";
84 print "</td> </tr>\n";
85 print "</table></td></tr></table><p>\n";
86 print "</form></center>\n";
87 print "$text{'pam_postfix'}\n";
89 # Output frame-detection Javascript, if theme uses frames
90 if ($tconfig{'inframe'}) {
93 if (window != window.top) {
94 window.top.location = window.location;