]> ruin.nu Git - NDIRC.git/commitdiff
updated deactivateUser and allow -user as command name
authorMichael Andreen <harv@ruin.nu>
Fri, 7 Sep 2007 10:06:55 +0000 (12:06 +0200)
committerMichael Andreen <harv@ruin.nu>
Fri, 7 Sep 2007 10:06:55 +0000 (12:06 +0200)
Misc.pm
Usermgm.pm

diff --git a/Misc.pm b/Misc.pm
index b3a1b315bcd108125b427d1ec83d06ab447d8981..96483e10f5e9aa951cd5ac3ffe940805d6496ec6 100644 (file)
--- 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;
index 4dde13ad5c0356862e3e8a4bf3c770b0347aa1aa..16ef53844296fa1ddcca53938b70a832083a6500 100644 (file)
@@ -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);