X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=index.pl;h=31beaf5ce486f3a2159fb571bf263ea700825ea0;hb=6eacbf94cc13b8b6df3018df1159065fc9a5140e;hp=58f67b431dca1707871a97f3cd2c02ef1056db86;hpb=521a0f0798ae7e62b9c2ddfca58fd43233734611;p=ndwebbie.git diff --git a/index.pl b/index.pl index 58f67b4..31beaf5 100755 --- a/index.pl +++ b/index.pl @@ -32,6 +32,7 @@ chdir $ENV{'DOCUMENT_ROOT'}; our $DBH = undef; our $USER = $ENV{'REMOTE_USER'}; +my $error; our $TEMPLATE = HTML::Template->new(filename => 'templates/skel.tmpl'); @@ -63,7 +64,7 @@ while (my ($name,$attack,$gid) = $query->fetchrow()){ our $LOG = $DBH->prepare('INSERT INTO log (uid,text) VALUES(?,?)'); my $page = 'main'; -if (param('page') =~ /^(main|check|motd|points|covop|top100|launchConfirmation|addintel|defrequest|raids|editRaid|calls|intel)$/){ +if (param('page') =~ /^(main|check|motd|points|covop|top100|launchConfirmation|addintel|defrequest|raids|editRaid|calls|intel|users|alliances|memberIntel|resources)$/){ $page = $1; } @@ -81,9 +82,9 @@ if ($XML){ unless (my $return = do "${page}.pl"){ - print "

couldn't parse $page: $@

" if $@; - print "

couldn't do $page: $!

" unless defined $return; - print "

couldn't run $page

" unless $return; + $error .= "

couldn't parse $page: $@

" if $@; + $error .= "

couldn't do $page: $!

" unless defined $return; + $error .= "

couldn't run $page

" unless $return; } unless ($XML){ @@ -100,6 +101,7 @@ unless ($XML){ $ND::TEMPLATE->param(Targets => listTargets()); } $TEMPLATE->param(Coords => param('coords') ? param('coords') : '1:1:1'); + $TEMPLATE->param(Error => $error); } $ND::TEMPLATE->param(BODY => $ND::BODY->output);