X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND.pm;h=befe1b9560b8d2acfaa769b36ab2a7e230c26564;hb=b3ea6d7f8b9879d759da59d8e445e35fabf16f79;hp=70000c8094192ea30107bc00295b976982b0d4fd;hpb=0a5d682ce0185df2588004b2b965159abdb5ef2a;p=ndwebbie.git diff --git a/ND.pm b/ND.pm index 70000c8..befe1b9 100755 --- a/ND.pm +++ b/ND.pm @@ -49,20 +49,20 @@ sub handler { if ($ENV{'SCRIPT_NAME'} =~ /(\w+)(\.(pl|php|pm))?$/){ $ND::PAGE = $1 unless $1 eq 'index' and $3 eq 'pl'; } + $ND::PAGE = '' unless defined $ND::PAGE; page(); return Apache2::Const::OK; } sub page { our $DBH = ND::DB::DB(); - our $USER = $ENV{'REMOTE_USER'}; my $error = ''; chdir '/var/www/ndawn/code'; our $TEMPLATE = HTML::Template->new(filename => 'templates/skel.tmpl', global_vars => 1, cache => 1); - our ($UID,$PLANET) = $DBH->selectrow_array('SELECT uid,planet FROM users WHERE username = ?' + our ($UID,$PLANET,$USER) = $DBH->selectrow_array('SELECT uid,planet,username FROM users WHERE username ILIKE ?' ,undef,$ENV{'REMOTE_USER'}); our ($TICK) = $DBH->selectrow_array('SELECT tick()',undef);