X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=index.pl;h=ecb27a21cb7d38cdcbd384c4677d8a75156de78b;hb=8bd21c625add06fed135d3ce99208c7a94b44882;hp=11789fa70378bfd883ab1e16ec3edf2394f42351;hpb=5e38dff0cf8667720f7ae7f89302e0246ecf5624;p=ndwebbie.git diff --git a/index.pl b/index.pl index 11789fa..ecb27a2 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,13 +64,15 @@ 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|users)$/){ +if (param('page') =~ /^(main|check|motd|points|covop|top100|launchConfirmation|addintel|defrequest|raids|editRaid|calls|intel|users|alliances|memberIntel|resources)$/){ $page = $1; } our $XML = 0; $XML = 1 if param('xml') and $page =~ /^(raids)$/; +our $AJAX = 1; + my $type = 'text/html'; if ($XML){ $type = 'text/xml'; @@ -81,9 +84,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){ @@ -95,11 +98,13 @@ unless ($XML){ $TEMPLATE->param(isHC => isHC()); $TEMPLATE->param(isDC => isDC()); $TEMPLATE->param(isBC => isBC()); + $TEMPLATE->param(isIntel => isBC()); $TEMPLATE->param(isAttacker => $ATTACKER && (!isMember() || ((($TICK - $fleetupdate < 24) || isScanner()) && $PLANET))); if ($ATTACKER && (!isMember() || ((($TICK - $fleetupdate < 24) || isScanner()) && $PLANET))){ $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); @@ -115,7 +120,7 @@ $USER = undef; $PLANET = undef; $TEMPLATE = undef; $TICK = undef; -%GROUPS = undef; +undef %GROUPS; $ND::BODY = undef; exit;