X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=index.pl;fp=index.pl;h=e1067c4f436bc4dc3615e3bc9bb31772f94cd8fb;hb=8d1ec9372fa9786009022fca3503ef3c79974f3e;hp=a78dff374b50b103745d6fd5069ac0bf8b2dc6d1;hpb=2bd98fbbe41b817e4c9172215b2d226429120fdb;p=ndwebbie.git diff --git a/index.pl b/index.pl index a78dff3..e1067c4 100755 --- a/index.pl +++ b/index.pl @@ -31,12 +31,9 @@ my $cgi = new CGI; chdir $ENV{'DOCUMENT_ROOT'}; our $DBH = undef; -our $UID = undef; -our $PLANET = undef; -our $TEMPLATE = undef; -our $TICK = undef; +our $USER = $ENV{'REMOTE_USER'}; -$ND::TEMPLATE = HTML::Template->new(filename => 'templates/skel.tmpl'); +our $TEMPLATE = HTML::Template->new(filename => 'templates/skel.tmpl'); for my $file ("db.pl","include.pl"){ unless (my $return = do $file){ @@ -46,10 +43,10 @@ for my $file ("db.pl","include.pl"){ } } -($UID,$PLANET) = $DBH->selectrow_array('SELECT uid,planet FROM users WHERE username = ?' +our ($UID,$PLANET) = $DBH->selectrow_array('SELECT uid,planet FROM users WHERE username = ?' ,undef,$ENV{'REMOTE_USER'}); -($TICK) = $DBH->selectrow_array('SELECT tick()',undef); +our ($TICK) = $DBH->selectrow_array('SELECT tick()',undef); my $query = $DBH->prepare('SELECT groupname,attack,gid from groupmembers NATURAL JOIN groups WHERE uid = ?'); @@ -112,6 +109,7 @@ print $output; $DBH->disconnect; $DBH = undef; $UID = undef; +$USER = undef; $PLANET = undef; $TEMPLATE = undef; $TICK = undef;