added redirect and infobox

git-svn-id: http://yolanda.mister-muffin.de/svn@131 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-10-24 10:03:04 +00:00
parent deb06fbb74
commit 0d2b5deec1
2 changed files with 17 additions and 4 deletions

View file

@ -4,6 +4,7 @@ require "functions.pl";
#create or resume session #create or resume session
CGI::Session->name($session_name); CGI::Session->name($session_name);
$query = new CGI;
my $session = new CGI::Session; my $session = new CGI::Session;
%page = (); %page = ();
@ -14,6 +15,19 @@ $page->{locale} = $locale;
$page->{stylesheet} = $stylesheet; $page->{stylesheet} = $stylesheet;
$page->{frontpage} = ['']; $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; fill_tagcloud;
#print xml http header along with session cookie #print xml http header along with session cookie

View file

@ -30,8 +30,7 @@ if($query->param('action'))
$sth = $dbh->prepare(qq{update users set sid = ? where username = ? }); $sth = $dbh->prepare(qq{update users set sid = ? where username = ? });
$sth->execute($session->id, $query->param('user')); $sth->execute($session->id, $query->param('user'));
$sth->finish(); $sth->finish();
print $session->header(); print $query->redirect("index.pl?information=information_logged_in");
print "logged in";
} }
else else
{ {
@ -86,8 +85,6 @@ if($query->param('action'))
{ {
#we are verified!! #we are verified!!
my $verified_url = $vident->url; my $verified_url = $vident->url;
print $session->header();
print "success $verified_url";
#check if this openid user already is in database #check if this openid user already is in database
my $sth = $dbh->prepare(qq{select 1 from users where username = ? limit 1 }); 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->execute($verified_url, $session->id);
$sth->finish(); $sth->finish();
} }
print $query->redirect("index.pl?information=information_logged_in");
} }
else else
{ {