[system] / trunk / webwork2 / lib / WeBWorK / ContentGenerator / Login.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Login.pm

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

Revision 443 Revision 444
22sub body { 22sub body {
23 my $self = shift; 23 my $self = shift;
24 my $r = $self->{r}; 24 my $r = $self->{r};
25 my $course_env = $self->{courseEnvironment}; 25 my $course_env = $self->{courseEnvironment};
26 # get some stuff together 26 # get some stuff together
27 my $user = $r->param("user"); 27 my $user = $r->param("user") || "";
28 my $key = $r->param("key"); 28 my $key = $r->param("key");
29 my $passwd = $r->param("passwd"); 29 my $passwd = $r->param("passwd") || "";
30 my $course = $course_env->{"courseName"}; 30 my $course = $course_env->{"courseName"};
31 31
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 CGI->font({-color => 'red'}, CGI->b($r->notes("authen_error"))),CGI->br(); 37 print CGI::font({-color => 'red'}, CGI::b($r->notes("authen_error"))),CGI::br();
38 } 38 }
39 39
40 print CGI::p("This is a test.");
41
40 print p("Please enter your username and password for ",CGI->b($course)," below:"); 42 print CGI::p("Please enter your username and password for ",CGI::b($course)," below:");
41 print CGI->startform({-method=>"POST", -action=>$r->uri}); 43 print CGI::startform({-method=>"POST", -action=>$r->uri});
42 44
43 # write out the form data posted to the requested URI 45 # 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)$/); 46 print $self->print_form_data('<input type="hidden" name="','" value="',"\"/>\n",qr/^(user|passwd|key)$/);
45 47
46 print 48 print
47 CGI->table({-border => 0}, 49 CGI::table({-border => 0},
48 CGI->Tr([ 50 CGI::Tr([
49 CGI->td([ 51 CGI::td([
50 "Username:", 52 "Username:",
51 CGI->input({-type=>"textfield", -name=>"user", -value=>"$user"}),CGI->br(), 53 CGI::input({-type=>"textfield", -name=>"user", -value=>"$user"}),CGI::br(),
52 ]), 54 ]),
53 CGI->td([ 55 CGI::td([
54 "Password:", 56 "Password:",
55 CGI->input({-type=>"password", -name=>"passwd", -value=>"$passwd"}) . CGI->i("(Will not be echoed)"), 57 CGI::input({-type=>"password", -name=>"passwd", -value=>"$passwd"}) . CGI::i("(Will not be echoed)"),
56 ]), 58 ]),
57 ]) 59 ])
58 ) 60 )
59 ; 61 ;
60 62
61 print CGI->input({-type=>"submit", -value=>"Continue"}); 63 print CGI::input({-type=>"submit", -value=>"Continue"});
62 print CGI->endform(); 64 print CGI::endform();
63 65
64 return ""; 66 return "";
65} 67}
66 68
671; 691;

Legend:
Removed from v.443  
changed lines
  Added in v.444

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9