OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-registry Date: 27-Nov-2005 00:32:54
Branch: HEAD Handle: 2005112623325300
Modified files:
openpkg-registry registry-ui.pl
Log:
HTTP redirection after login
Summary:
Revision Changes Path
1.28 +26 -17 openpkg-registry/registry-ui.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-registry/registry-ui.pl
============================================================================
$ cvs diff -u -r1.27 -r1.28 registry-ui.pl
--- openpkg-registry/registry-ui.pl 26 Nov 2005 23:31:48 -0000 1.27
+++ openpkg-registry/registry-ui.pl 26 Nov 2005 23:32:53 -0000 1.28
@@ -216,7 +216,10 @@
if ($requestedpage eq "login") {
my $out;
$out = '';
+ $out .= &viewhttplogin("association");
+ $out .= &viewhtmlhead(-menu);
$out .= &viewlogin();
+ $out .= &viewhtmltail();
print STDOUT &canvas($out);
}
elsif ($requestedpage eq "logout") {
@@ -340,6 +343,24 @@
return $cgi->header($header);
}
+sub viewhttplogin($)
+{
+ my ($page) = @_;
+ my ($header, $username);
+
+ $header = &httpheader();
+
+ $username = $cgi->param("username");
+ $header->{cookie} = $cgi->cookie(
+ -name => 'username',
+ -value => $username,
+ -expires => '+1h',
+ -path => '/'
+ );
+ $header->{redirect} = $cgi->redirect("?page=$page");
+ return $cgi->header($header);
+}
+
sub viewhtmlhead (;$)
{
my ($menu) = @_;
@@ -1046,24 +1067,12 @@
sub viewlogin()
{
- my ($header, $cookie, $redirect, $username);
- $header = {};
- $username = $cgi->param("username");
- $cookie = $cgi->cookie(
- -name => 'username',
- -value => $username,
- -expires => '+1h',
- -path => '/'
- );
- $redirect = $cgi->redirect(
- -uri => $myurl
- );
+ my ($html, $username);
- $header = {
- -redirect => $redirect,
- -cookie => $cookie
- };
- return $cgi->redirect($header);
+ $html = '';
+ $username = &identifyusername();
+ $html .= "Welcome, <b>$username</b><br>\n";
+ return $html;
}
sub viewlogoutform()
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]