| … | |
… | |
| 9 | |
9 | |
| 10 | use strict; |
10 | use strict; |
| 11 | use warnings; |
11 | use warnings; |
| 12 | use WeBWorK::ContentGenerator; |
12 | use WeBWorK::ContentGenerator; |
| 13 | use Apache::Constants qw(:common); |
13 | use Apache::Constants qw(:common); |
| 14 | use CGI qw(-comple :html :form); |
14 | use CGI qw(); |
| 15 | |
15 | |
| 16 | our @ISA = qw(WeBWorK::ContentGenerator); |
16 | our @ISA = qw(WeBWorK::ContentGenerator); |
| 17 | |
17 | |
| 18 | sub title { |
18 | sub title { |
| 19 | return "Login"; |
19 | return "Login"; |
| … | |
… | |
| 32 | # WeBWorK::Authen::verify will set the note "authen_error" |
32 | # WeBWorK::Authen::verify will set the note "authen_error" |
| 33 | # if invalid authentication is found. If this is done, it's a signal to |
33 | # if invalid authentication is found. If this is done, it's a signal to |
| 34 | # us to yell at the user for doing that, since Authen isn't a content- |
34 | # us to yell at the user for doing that, since Authen isn't a content- |
| 35 | # generating module. |
35 | # generating module. |
| 36 | if ($r->notes("authen_error")) { |
36 | if ($r->notes("authen_error")) { |
| 37 | print font({-color => 'red'}, b($r->notes("authen_error"))),br; |
37 | print CGI->font({-color => 'red'}, CGI->b($r->notes("authen_error"))),CGI->br(); |
| 38 | } |
38 | } |
| 39 | |
39 | |
| 40 | print p("Please enter your username and password for ",b($course)," below:"); |
40 | print p("Please enter your username and password for ",CGI->b($course)," below:"); |
| 41 | print startform({-method=>"POST", -action=>$r->uri}); |
41 | print CGI->startform({-method=>"POST", -action=>$r->uri}); |
| 42 | |
42 | |
| 43 | # write out the form data posted to the requested URI |
43 | # write out the form data posted to the requested URI |
| 44 | print $self->print_form_data('<input type="hidden" name="','" value="',"\"/>\n",qr/^(user|passwd|key)$/); |
44 | print $self->print_form_data('<input type="hidden" name="','" value="',"\"/>\n",qr/^(user|passwd|key)$/); |
| 45 | |
45 | |
| 46 | print |
46 | print |
| 47 | table({-border => 0}, |
47 | CGI->table({-border => 0}, |
| 48 | Tr([ |
48 | CGI->Tr([ |
| 49 | td([ |
49 | CGI->td([ |
| 50 | "Username:", |
50 | "Username:", |
| 51 | input({-type=>"textfield", -name=>"user", -value=>"$user"}),br, |
51 | CGI->input({-type=>"textfield", -name=>"user", -value=>"$user"}),CGI->br(), |
| 52 | ]), |
52 | ]), |
| 53 | td([ |
53 | CGI->td([ |
| 54 | "Password:", |
54 | "Password:", |
| 55 | input({-type=>"password", -name=>"passwd", -value=>"$passwd"}) . i("(Will not be echoed)"), |
55 | CGI->input({-type=>"password", -name=>"passwd", -value=>"$passwd"}) . CGI->i("(Will not be echoed)"), |
| 56 | ]), |
56 | ]), |
| 57 | ]) |
57 | ]) |
| 58 | ) |
58 | ) |
| 59 | ; |
59 | ; |
| 60 | |
60 | |
| 61 | print input({-type=>"submit", -value=>"Continue"}); |
61 | print CGI->input({-type=>"submit", -value=>"Continue"}); |
| 62 | print endform; |
62 | print CGI->endform(); |
| 63 | |
63 | |
| 64 | return ""; |
64 | return ""; |
| 65 | } |
65 | } |
| 66 | |
66 | |
| 67 | 1; |
67 | 1; |