From: Michael Andreen Date: Wed, 20 May 2009 20:55:06 +0000 (+0200) Subject: Removing the last of the old files X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;h=5f3e2c69d303e9196a76dd10607b595cac6658a8;p=NDIRC.git Removing the last of the old files --- diff --git a/Access.pm b/Access.pm deleted file mode 100644 index c4ef05a..0000000 --- a/Access.pm +++ /dev/null @@ -1,69 +0,0 @@ -#************************************************************************** -# Copyright (C) 2006 by Michael Andreen * -# * -# This program is free software; you can redistribute it and/or modify * -# it under the terms of the GNU General Public License as published by * -# the Free Software Foundation; either version 2 of the License, or * -# (at your option) any later version. * -# * -# This program is distributed in the hope that it will be useful, * -# but WITHOUT ANY WARRANTY; without even the implied warranty of * -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# GNU General Public License for more details. * -# * -# You should have received a copy of the GNU General Public License * -# along with this program; if not, write to the * -# Free Software Foundation, Inc., * -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -#**************************************************************************/ -package NDIRC::Access; -use strict; -use warnings; -require Exporter; - -our @ISA = qw/Exporter/; - -our @EXPORT = qw/member officer dc bc ia hc scanner intel masterop masterinvite/; - -sub member { - return groupmember("HM"); -}; -sub officer { - return groupmember("HO"); -}; -sub dc { - return groupmember("HD"); -}; -sub bc { - return groupmember("HB"); -}; -sub ia { - return groupmember("HR"); -}; -sub hc { - return groupmember("H"); -}; -sub scanner { - return groupmember("HS"); -}; -sub intel { - return groupmember("HI"); -}; - -sub masterop { - return groupmember("HO"); -}; -sub masterinvite { - return groupmember("H"); -}; - -sub groupmember { - my ($groups) = @_; - $groups = join ",", map {"'$_'"} split //, $groups; - my $f = $ND::DBH->prepare("SELECT uid,username FROM users NATURAL JOIN groupmembers NATURAL JOIN groups WHERE flag IN ('T',$groups) AND lower(hostmask) = ?") or print $ND::DBH->errstr; - $f->execute(lc($ND::address)); - my $user = $f->fetchrow_hashref; - return $user; -}; - -1; diff --git a/Def.pm b/Def.pm deleted file mode 100644 index b8dc386..0000000 --- a/Def.pm +++ /dev/null @@ -1,84 +0,0 @@ -#************************************************************************** -# Copyright (C) 2006 by Michael Andreen * -# * -# This program is free software; you can redistribute it and/or modify * -# it under the terms of the GNU General Public License as published by * -# the Free Software Foundation; either version 2 of the License, or * -# (at your option) any later version. * -# * -# This program is distributed in the hope that it will be useful, * -# but WITHOUT ANY WARRANTY; without even the implied warranty of * -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# GNU General Public License for more details. * -# * -# You should have received a copy of the GNU General Public License * -# along with this program; if not, write to the * -# Free Software Foundation, Inc., * -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -#**************************************************************************/ -package NDIRC::Def; -use strict; -use warnings; -use ND::DB; -use ND::Include; -use NDIRC::Access; -use NDIRC::Misc; -use CGI qw/:standard/; -require Exporter; - -our @ISA = qw/Exporter/; - -our @EXPORT = qw/showCall - setDefPrio/; - -sub showCall { - my ($msg,$command) = @_; - my ($id); - if (defined $msg && $msg =~ /^(\d+)$/){ - $id = $1; - }else{ - $ND::server->command("notice $ND::nick Usage: $command callid"); - return; - } - if (dc()){ - my $f = $ND::DBH->prepare(<execute($id); - while (my @row = $f->fetchrow()){ - @row = map (valuecolor(0),@row); - $ND::server->command("notice $ND::nick (CALL $id) $row[0]: $row[1], $row[3] ($row[2]), $row[4] ($row[10]), $row[5], ETA: $row[11](/$row[6]), Amount: $row[7], $row[8], Type: $row[9]"); - } - } -} - -sub setDefPrio { - my ($msg,$command) = @_; - my ($min,$max); - if (defined $msg && $msg =~ /^(\d+)\D(\d+)$/){ - $min = $1; - $max = $2; - }else{ - $ND::server->command("notice $ND::nick Usage: $command Min Max"); - return; - } - if (hc()){ - $ND::DBH->begin_work; - my $update = $ND::DBH->prepare('UPDATE misc SET value = ? :: int WHERE id = ?'); - $update->execute($min,'DEFMIN'); - $update->execute($max,'DEFMAX'); - if ($ND::DBH->commit){ - $ND::server->command("msg $ND::target min def prio set to $ND::B$min$ND::B and max set to $ND::B$max"); - }else{ - $ND::server->command("msg $ND::target something went wrong"); - } - } -} - -1;