X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Usermgm.pm;h=e24ee550f195e1460b4ffd676856cccc57b507ae;hb=f442c3c5bb7d67583c875ffbb5aeecc137d6928c;hp=4dde13ad5c0356862e3e8a4bf3c770b0347aa1aa;hpb=0037f3ea50d01fe17985b479bc9f5d7a3ae03381;p=NDIRC.git diff --git a/Usermgm.pm b/Usermgm.pm index 4dde13a..e24ee55 100644 --- a/Usermgm.pm +++ b/Usermgm.pm @@ -28,8 +28,16 @@ our @ISA = qw/Exporter/; our @EXPORT = qw/addUser whois flags flag laston addPoints chattrG setHost setPNick deactivateUser getShips/; sub addUser { - my ($nick,$pnick) = @_; - DB(); + my ($msg, $command) = @_; + + my ($nick,$pnick); + if(defined $msg && $msg =~ /^(\w+)(?: ([^.\s]+))?$/){ + $nick = $1; + $pnick = $2; + }else{ + $ND::server->command("notice $ND::nick syntax: .$command nick [pnick] | nick must be alphanum characters, if no pnick is given then it will be set to nick"); + return; + } if (hc()){ $pnick = $nick unless $pnick; my $host = "$pnick.users.netgamers.org"; @@ -302,8 +310,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);