[system] / trunk / webwork-modperl / lib / WeBWorK / Login.pm Repository:
ViewVC logotype

Diff of /trunk/webwork-modperl/lib/WeBWorK/Login.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 322 Revision 323
7# changes. 7# changes.
8 8
9package WeBWorK::Login; 9package WeBWorK::Login;
10 10
11use WeBWorK::ContentGenerator; 11use WeBWorK::ContentGenerator;
12use Apache::Constants qw(:common);
13use CGI qw(-comple :html :form);
12 14
13our @ISA = qw(WeBWorK::ContentGenerator); 15our @ISA = qw(WeBWorK::ContentGenerator);
14 16
15sub go($) { 17sub go($) {
16 my $self = shift; 18 my $self = shift;
20 my $user = $r->param("user"); 22 my $user = $r->param("user");
21 my $key = $r->param("key"); 23 my $key = $r->param("key");
22 my $passwd = $r->param("passwd"); 24 my $passwd = $r->param("passwd");
23 my $course = $course_env->{"courseName"}; 25 my $course = $course_env->{"courseName"};
24 26
25 27 $self->header; return OK if $r->header_only;
26 $r->content_type("text/html"); 28 $self->top("Login page");
27 $r->send_http_header; 29
28 print '<html><head><title>WeBWorK Login Page</title></head><body>',
29 '<h1>WeBWorK Login Page</h1>';
30
31 # WeBWorK::Authen::verify will set the note "authen_error" 30 # WeBWorK::Authen::verify will set the note "authen_error"
32 # if invalid authentication is found. If this is done, it's a signal to 31 # if invalid authentication is found. If this is done, it's a signal to
33 # us to yell at the user for doing that, since Authen isn't a content- 32 # us to yell at the user for doing that, since Authen isn't a content-
34 # generating module. 33 # generating module.
35 if ($r->notes("authen_error")) { 34 if ($r->notes("authen_error")) {
36 print '<font color="red"><b>',$r->notes("authen_error"),"</b></font><br>"; 35 print '<font color="red"><b>',$r->notes("authen_error"),"</b></font><br>";
37 } 36 }
38 37
39 # $self->print_form_data(""," = ","<br>\n"); 38 # $self->print_form_data(""," = ","<br>\n");
40 39
41 print "Please enter your username and password for <b>", 40 print p("Please enter your username and password for ",
42 $course, 41 b($course),
43 "</b> below: <p>", 42 " below:");
43
44 print startform({-method=>"POST", -action=>$r->uri});
45
44 '<form method="POST" action="',$r->uri,'">'; 46 # '<form method="POST" action="',$r->uri,'">';
45 47
46 # write out the form data posted to the requested URI 48 # write out the form data posted to the requested URI
47 $self->print_form_data('<input type="hidden" name="','" value="',"\">\n",qr/^(user|passwd|key)$/); 49 $self->print_form_data('<input type="hidden" name="','" value="',"\"/>\n",qr/^(user|passwd|key)$/);
48 50
51 print
52 table({-border => 0},
53 Tr([
54 td([
55 "Username:",
56 input({-type=>"textfield", -name=>"user", -value=>"$user"}),br,
57 ]),
58 td([
59 "Password:",
60 input({-type=>"password", -name=>"passwd", -value=>"$passwd"}) . i("(Will not be echoed)"),
61 ]),
62 ])
63 )
64 ;
65
66 print input({-type=>"submit", -value=>"Continue"});
49 print '<table border="0"><tr><td>Username:</td><td><input type="textfield" name="user" value="',$user,'"><br></td></tr>', 67# print '<table border="0"><tr><td>Username:</td><td><input type="textfield" name="user" value="',$user,'"><br></td></tr>',
50 '<tr><td>Password:</td><td><input type="password" name="passwd" value="',$passwd,'"><i>(Will not be echoed)</i></tr></table>', 68# '<tr><td>Password:</td><td><input type="password" name="passwd" value="',$passwd,'"><i>(Will not be echoed)</i></tr></table>',
51 '<input type="submit" value="Continue">', 69# '<input type="submit" value="Continue">',
52 '</form></body></html>'; 70 print endform;
71 print '</body></html>';
53 72
54 return OK; 73 return OK;
55} 74}
56 75
571; 761;

Legend:
Removed from v.322  
changed lines
  Added in v.323

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9