X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=covop.pl;h=a07c47f39fa095f66cd6b1c42e34044ecf4380d0;hb=6a442a1f778230dccf47632b30ed9c7db3d6b3d2;hp=0d670892e7dd5d012f597645dbbaed7f406fbcc1;hpb=354c2fb813a139fb08476b6d0e7f30308091038a;p=ndwebbie.git diff --git a/covop.pl b/covop.pl index 0d67089..a07c47f 100644 --- a/covop.pl +++ b/covop.pl @@ -19,26 +19,24 @@ use strict; use warnings FATAL => 'all'; -no warnings qw(uninitialized); $ND::TEMPLATE->param(TITLE => 'CovOp Targets'); our $BODY; our $DBH; -our $LOG; die "You don't have access" unless isMember(); my $show = q{AND ((planet_status IS NULL OR NOT planet_status IN ('Friendly','NAP')) AND (relationship IS NULL OR NOT relationship IN ('Friendly','NAP')))}; -$show = '' if param('show') eq 'all'; -if (param('covop') =~ /^(\d+)$/){ +$show = '' if defined param('show') && param('show') eq 'all'; +if (defined param('covop') && param('covop') =~ /^(\d+)$/){ my $update = $DBH->prepare('UPDATE covop_targets SET covop_by = ?, last_covop = tick() WHERE planet = ? '); $update->execute($ND::UID,$1); } my $list = ''; my $where = ''; -if (param('list') eq 'distwhores'){ +if (defined param('list') && param('list') eq 'distwhores'){ $list = '&list=distwhores'; $where = qq{WHERE dists > 0 $show ORDER BY dists DESC,COALESCE(sec_centres::float/structures*100,0)ASC}