From: Michael Andreen Date: Fri, 7 Sep 2007 10:06:55 +0000 (+0200) Subject: updated deactivateUser and allow -user as command name X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=commitdiff_plain;h=503db6bf51120be14f2b16643462dfd2a39a9bc0 updated deactivateUser and allow -user as command name --- 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);