]> ruin.nu Git - NDIRC.git/commitdiff
updated addUser
authorMichael Andreen <harv@ruin.nu>
Fri, 7 Sep 2007 10:12:21 +0000 (12:12 +0200)
committerMichael Andreen <harv@ruin.nu>
Fri, 7 Sep 2007 10:12:21 +0000 (12:12 +0200)
Usermgm.pm

index 16ef53844296fa1ddcca53938b70a832083a6500..e24ee550f195e1460b4ffd676856cccc57b507ae 100644 (file)
@@ -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";