From 503db6bf51120be14f2b16643462dfd2a39a9bc0 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Fri, 7 Sep 2007 12:06:55 +0200 Subject: [PATCH] updated deactivateUser and allow -user as command name --- Misc.pm | 2 +- Usermgm.pm | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Misc.pm b/Misc.pm index b3a1b31..96483e1 100644 --- a/Misc.pm +++ b/Misc.pm @@ -64,7 +64,7 @@ sub addCommand { sub parseCommand { my ($msg,$channel) = @_; - if ($msg =~ /^(\w+)(?: (.+))?$/){ + if ($msg =~ /^(\S+)(?: (.+))?$/){ my $c = $1; my $args = $2; my @k = keys %commands; diff --git a/Usermgm.pm b/Usermgm.pm index 4dde13a..16ef538 100644 --- a/Usermgm.pm +++ b/Usermgm.pm @@ -302,8 +302,15 @@ sub setPNick { } sub deactivateUser { - my ($nick) = @_; - DB(); + my ($msg, $command) = @_; + + my $nick; + if(defined $msg && $msg =~ /^(\S+)$/){ + $nick = $1; + }else{ + $ND::server->command("notice $ND::nick syntax: .$command user"); + return; + } if (hc()){ my $f = $ND::DBH->prepare("SELECT uid,username FROM users WHERE username ILIKE ?"); $f->execute($nick); -- 2.39.2