From 0d2b5deec12b9d07966d8734823614349a54859f Mon Sep 17 00:00:00 2001 From: josch Date: Wed, 24 Oct 2007 10:03:04 +0000 Subject: [PATCH] added redirect and infobox git-svn-id: http://yolanda.mister-muffin.de/svn@131 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/index.pl | 14 ++++++++++++++ trunk/login.pl | 7 +++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/trunk/index.pl b/trunk/index.pl index 570e465..87a69ee 100644 --- a/trunk/index.pl +++ b/trunk/index.pl @@ -4,6 +4,7 @@ require "functions.pl"; #create or resume session CGI::Session->name($session_name); +$query = new CGI; my $session = new CGI::Session; %page = (); @@ -14,6 +15,19 @@ $page->{locale} = $locale; $page->{stylesheet} = $stylesheet; $page->{frontpage} = ['']; +if($query->param('information')) +{ + + $page->{'message'}->{'type'} = "information"; + $page->{'message'}->{'text'} = $query->param('information'); +} +elsif($query->param('error')) +{ + + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = $query->param('error'); +} + fill_tagcloud; #print xml http header along with session cookie diff --git a/trunk/login.pl b/trunk/login.pl index 8b8e072..30d38b0 100644 --- a/trunk/login.pl +++ b/trunk/login.pl @@ -30,8 +30,7 @@ if($query->param('action')) $sth = $dbh->prepare(qq{update users set sid = ? where username = ? }); $sth->execute($session->id, $query->param('user')); $sth->finish(); - print $session->header(); - print "logged in"; + print $query->redirect("index.pl?information=information_logged_in"); } else { @@ -86,8 +85,6 @@ if($query->param('action')) { #we are verified!! my $verified_url = $vident->url; - print $session->header(); - print "success $verified_url"; #check if this openid user already is in database my $sth = $dbh->prepare(qq{select 1 from users where username = ? limit 1 }); @@ -106,6 +103,8 @@ if($query->param('action')) $sth->execute($verified_url, $session->id); $sth->finish(); } + + print $query->redirect("index.pl?information=information_logged_in"); } else {