diff --git a/trunk/include.pl b/trunk/include.pl index 0e8bb5e..5418ed9 100644 --- a/trunk/include.pl +++ b/trunk/include.pl @@ -6,3 +6,5 @@ $database = 'gnutube'; $host = 'localhost'; $user = 'root'; $pass = ''; +$session_name = 'sid'; +1; diff --git a/trunk/index.pl b/trunk/index.pl index f0fb12e..8a061bf 100644 --- a/trunk/index.pl +++ b/trunk/index.pl @@ -1,14 +1,10 @@ -#!/usr/bin/perl require "/var/www/perl/include.pl"; require "/var/www/perl/functions.pl"; #create or resume session -CGI::Session->name("SID"); +CGI::Session->name($session_name); my $session = new CGI::Session; -#store session param -$session->param('auth', 'true'); - #read xml $page = XMLin('/var/www/perl/index.xml', ForceArray => 1, KeyAttr => {} ); diff --git a/trunk/login.pl b/trunk/login.pl new file mode 100644 index 0000000..7690174 --- /dev/null +++ b/trunk/login.pl @@ -0,0 +1,26 @@ +require "/var/www/perl/include.pl"; + +CGI::Session->name($session_name); +my $session = new CGI::Session; + +#fill %querystring with everything that was passed via GET +@parts = split( /\&/, $ENV{ "QUERY_STRING" } ); +foreach $part (@parts) { + ( $name, $value ) = split( /\=/, $part ); + $queryString{ $name } = $value; +} + +if($queryString{ "action" }) { + if($queryString{ "action" } eq "login") { + $session->param('auth', 'true'); + print $session->header(); + print "logged in"; + } elsif($queryString{ "action" } eq "logout") { + $session->param('auth', 'false'); + print $session->header(); + print "logged out"; + } +} else { + print $session->header(); + print "incorrect query string"; +} diff --git a/trunk/xsl/xhtml.xsl b/trunk/xsl/xhtml.xsl index 74956f4..5b261d8 100755 --- a/trunk/xsl/xhtml.xsl +++ b/trunk/xsl/xhtml.xsl @@ -65,7 +65,9 @@
- + + + open id logo