From 69deff0becc5a4dfa172621fd22163b415fb67d2 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Thu, 18 Jan 2007 21:19:59 +0000 Subject: [PATCH] intel class --- ND/Web/Pages/Check.pm | 1 - ND/Web/Pages/Intel.pm | 25 ++++++++++++------------- startup.pl | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ND/Web/Pages/Check.pm b/ND/Web/Pages/Check.pm index c37b792..8b5f621 100644 --- a/ND/Web/Pages/Check.pm +++ b/ND/Web/Pages/Check.pm @@ -31,7 +31,6 @@ $ND::Web::Page::PAGES{check} = __PACKAGE__; sub parse { my $self = shift; - #TODO: Improved apache conf needed if ($self->{URI} =~ m{^/.*/((\d+)(?: |:)(\d+)(?:(?: |:)(\d+))?(?: |:(\d+))?)$}){ param('coords',$1); } diff --git a/ND/Web/Pages/Intel.pm b/ND/Web/Pages/Intel.pm index 5a4a47c..8abce3e 100644 --- a/ND/Web/Pages/Intel.pm +++ b/ND/Web/Pages/Intel.pm @@ -25,28 +25,27 @@ use ND::Web::Include; use ND::Include; use CGI qw/:standard/; -$ND::PAGES{intel} = {parse => \&parse, process => \&process, render=> \&render}; +our @ISA = qw/ND::Web::XMLPage/; + +$ND::Web::Page::PAGES{intel} = __PACKAGE__; sub parse { - my ($uri) = @_; - if ($uri =~ m{^/.*/(\w+)$}){ - param('list',$1); + my $self = shift; + if ($self->{URI} =~ m{^/.*/((\d+)(?: |:)(\d+)(?: |:)(\d+))$}){ + param('coords',$1); } } -sub process { - -} +sub render_body { + my $self = shift; + my ($BODY) = @_; + $self->{TITLE} = 'Intel'; + my $DBH = $self->{DBH}; -sub render { - my ($DBH,$BODY) = @_; + return $self->noAccess unless $self->isIntel || $self->isHC; my $error; - $ND::TEMPLATE->param(TITLE => 'Intel'); - - return $ND::NOACCESS unless isIntel() || isHC(); - my $planet; if (defined param('coords') && param('coords') =~ /^(\d+)(?: |:)(\d+)(?: |:)(\d+)$/){ my $query = $DBH->prepare(q{SELECT x,y,z,coords(x,y,z),id, nick, alliance,alliance_id, planet_status,channel,ftid FROM current_planet_stats diff --git a/startup.pl b/startup.pl index b7920d5..46d3632 100644 --- a/startup.pl +++ b/startup.pl @@ -39,7 +39,7 @@ use ND::Web::Pages::Raids; use ND::Web::Pages::EditRaid; use ND::Web::Pages::Calls; use ND::Web::Pages::Users; -#use ND::Web::Pages::Intel; +use ND::Web::Pages::Intel; #use ND::Web::Pages::Alliances; #use ND::Web::Pages::MemberIntel; #use ND::Web::Pages::Resources; -- 2.39.2