[LON-CAPA-cvs] cvs: modules /raeburn/register AuthRedirect.pm
raeburn
raeburn at source.lon-capa.org
Sun Mar 10 22:50:38 EDT 2013
raeburn Mon Mar 11 02:50:38 2013 EDT
Modified files:
/modules/raeburn/register AuthRedirect.pm
Log:
- Apache 2.
- xhtml
-------------- next part --------------
Index: modules/raeburn/register/AuthRedirect.pm
diff -u modules/raeburn/register/AuthRedirect.pm:1.4 modules/raeburn/register/AuthRedirect.pm:1.5
--- modules/raeburn/register/AuthRedirect.pm:1.4 Mon Mar 11 02:23:14 2013
+++ modules/raeburn/register/AuthRedirect.pm Mon Mar 11 02:50:38 2013
@@ -1,19 +1,21 @@
package Apache::LON::AuthRedirect;
-# $Id: AuthRedirect.pm,v 1.4 2013/03/11 02:23:14 raeburn Exp $
+# $Id: AuthRedirect.pm,v 1.5 2013/03/11 02:50:38 raeburn Exp $
use strict;
-use Apache::Constants qw(OK);
+use Apache::RequestRec();
+use Apache::Const qw(OK);
use CGI::Cookie;
+use HTML::Entities;
use Apache::LON::Login;
sub handler {
my $r = shift;
- my $authcheck = $r->notes('_AUTHFAIL');
- my $message = $r->notes('_RejectAuth');
- my $url = $r->notes('_ORIGURL');
- my $currurl = $r->notes('_CURRURL');
- my $token = $r->notes('_SESSTOKEN');
+ my $authcheck = $r->notes->get('_AUTHFAIL');
+ my $message = $r->notes->get('_RejectAuth');
+ my $url = $r->notes->get('_ORIGURL');
+ my $currurl = $r->notes->get('_CURRURL');
+ my $token = $r->notes->get('_SESSTOKEN');
my $redirecturl = $url;
if ($currurl eq "/update") {
$redirecturl = $currurl;
@@ -24,8 +26,8 @@
if ($redirecturl eq '/access') {
$redirecturl ="/update";
}
- my $cookiename = $r->notes('_COOKIESTUFF');
- my $user = $ENV{REMOTE_USER};
+ my $cookiename = $r->notes->get('_COOKIESTUFF');
+ my $user = $ENV{'REMOTE_USER'};
if ($authcheck) {
my $new_cookie = new CGI::Cookie (
-name => $cookiename,
@@ -41,7 +43,7 @@
$r->print($display);
return OK;
}
- my $session = $r->notes('_SESSCOOK');
+ my $session = $r->notes->get('_SESSCOOK');
my $new_cookie = new CGI::Cookie (
-name => $cookiename,
-value => { uri => $url, session => $session },
@@ -51,7 +53,9 @@
$r->content_type('text/html');
$r->no_cache(1);
$redirecturl =~ s/ /+/g;
- &print_html($r,$user,$redirecturl);
+ my $output = &print_html($r,$user,$redirecturl);
+ $r->send_http_header;
+ $r->print($output);
return OK;
}
@@ -60,32 +64,35 @@
my $response;
if (($user =~ /\@/) && ($redirecturl ne '/update')) {
$response .= <<"ENDONE";
- <br /><br/>
- <font face="arial,helv">Choose one of the following:<ul>
+ <br /><br />
+ Choose one of the following:<ul>
<li><a href="$redirecturl"><u>Continue</u></a> to the page you requested,</li>
<li><a href="/update"><u>Change password</u></a></li>
</ul>
ENDONE
} else {
+ my $linkurl = &HTML::Entities::encode($redirecturl,'&<>"');
$response .= <<"ENDTWO";
-<font face="arial,helv" size="+1">... heading to the page you requested!</font><br /><br /> <font face="arial,helv" size='2'><a href="$redirecturl"><u>Click here</u></a> if this page has <b>not</b> changed after a few seconds.
+<font size="+1">... heading to the page you requested!</font><br /><br /> <font size='2'><a href="$linkurl"><u>Click here</u></a> if this page has <b>not</b> changed after a few seconds.</font>
ENDTWO
- $r->header_out("Refresh"=>"2;url=$redirecturl");
+ $r->header_out("Refresh"=>"1;url=$redirecturl");
}
- $response .= '</font>';
- $r->send_http_header;
my $output = (<<"END");
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
-<title>>LON-CAPA support/registration log-in</title>
+<link type="text/css" rel="stylesheet" href="/css/registration.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<meta http-equiv="pragma" content="no-cache" />
+<title>LON-CAPA support/registration log-in</title>
END
&main_box(\$output);
$output .= <<"END";
-<font face='arial,helv' size='+1'><b>Authenticated</b></font>
+<font size='+1'><b>Authenticated</b></font>
$response
</td>
- <td align="right" valign="top" width="10"><img src="/images/login/lclogin_r1_c7.gif" width="10" height="10" border="0" alt=""></td>
+ <td align="right" valign="top" width="10"><img src="/images/login/lclogin_r1_c7.gif" width="10" height="10" border="0" alt="" /></td>
</tr>
END
&main_footer(\$output);
@@ -93,61 +100,43 @@
</body>
</html>
END
- $r->print($output);
- return OK;
+ return $output;
}
sub main_box {
my ($output) = @_;
$$output .= <<"END";
-<style type="text/css">
-<!--
- body {font-family: arial,verdana, sans-serif; }
- a:link {text-decoration: none; color: #000000; }
- a:visited {text-decoration: none; color: #000000; }
- a:active {text-decoration: none; color: #000000; }
- a:hover {text-decoration: underline; color: #000000; }
--->
-</style>
</head>
-<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
-<div align="center">
- <br />
- <br />
-</div>
+<body>
<br />
<div align="center">
-<table width="720" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFF99">
+<table class="LC_loginbox">
<tr>
- <td align="left" valign="top" width="12" nowrap><img name="login_r1_c1" src="/images/login/lclogin_r1_c1.gif" width="12" height="10" border="0" alt=""></td>
- <td width="450" nowrap valign="top">
- <table border="0" cellpadding="0" cellspacing="0" width="450" bgcolor="#FFFF99">
+ <td align="left" valign="top" width="12"><img name="login_r1_c1" src="/images/login/lclogin_r1_c1.gif" width="12" height="10" border="0" alt="" /></td>
+ <td width="450" valign="top">
+ <table class="LC_loginbox_left">
<tr>
- <td width="15" rowspan="2" nowrap><spacer type="block" width="15"></td>
- <td width="266" align="left" nowrap><img src="/images/login/lonlogos.gif" width="74" height="50" align="left"><br /><font size="-1">The Learning<i>Online</i> Network with CAPA</font></td>
- </td>
- <td width="15" nowrap><spacer type="block" width="15"></td>
- <td width="130" align="left" nowrap><img src="/images/login/student.jpg" rowspan="2" width="130" height="85"></td>
- <td width="24" rowspan="2" nowrap><spacer type="block" width="20"></td>
+ <td width="15"> </td>
+ <td width="74" align="left"><img src="/images/login/lonlogos.gif" width="74" height="50" align="left" alt="logo" /></td>
+ <td width="15"> </td>
+ <td width="320" align="left"><font size="-1"><span style="white-space: nowrap;">The Learning<i>Online</i> Network with CAPA</span></font></td>
+ <td width="26"> </td>
</tr>
<tr>
- <td colspan="5" bgcolor="#FFFF99" width="450" height="8"><img src="/images/login/login_red_horiz.gif" width="450" height="8"></td>
- <td align="right" valign="top">
- </td>
- </tr>
- </table>
+ <td colspan="5" width="450" height="8"><img src="/images/login/login_red_horiz.gif" width="450" height="8" alt="" /></td>
+ </tr>
+ </table>
+ <br />
END
}
sub main_footer {
my $output= shift;
$$output .= <<"END_OF_FOOT";
-</table>
-<table width="720" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFF99">
<tr>
- <td align="left" valign="bottom" width="10"><img src="/images/login/lclogin_r9_c1.gif" width="12" height="10" border="0" alt=""></td>
- <td width="696" nowrap><spacer type="block" width="696"></td>
- <td align="right" valign="bottom" width="10"><img src="/images/login/lclogin_r9_c7.gif" width="12" height="10" border="0" alt=""></td>
+ <td align="left" valign="bottom" width="10"><img src="/images/login/lclogin_r9_c1.gif" width="10" height="10" border="0" alt="" /></td>
+ <td width="698"> </td>
+ <td align="right" valign="bottom" width="10"><img src="/images/login/lclogin_r9_c7.gif" width="12" height="10" border="0" alt="" /></td>
</tr>
</table>
</div>
More information about the LON-CAPA-cvs
mailing list