]> ruin.nu Git - NDIRC.git/blobdiff - Usermgm.pm
Converted the .+user command
[NDIRC.git] / Usermgm.pm
index 6771d65cf4dbd00a20912cfdaf5283b76f03f743..d3083f482ce1485a75c98e2b60709e5198b6cb12 100644 (file)
@@ -25,38 +25,8 @@ require Exporter;
 
 our @ISA = qw/Exporter/;
 
-our @EXPORT = qw/addUser whois flags flag laston addPoints chattrG setHost setPNick deactivateUser getShips getFleet/;
+our @EXPORT = qw/whois flags flag laston addPoints chattrG setHost setPNick deactivateUser getShips getFleet/;
 
-sub addUser {
-       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";
-               my ($username,$hostname,$p_nick) = $ND::DBH->selectrow_array(q{SELECT username, hostmask,pnick
-                       FROM users WHERE username ILIKE ? OR hostmask ILIKE ? OR pnick ILIKE ?}
-                       ,undef,$nick,$host,$pnick);
-               if ((not defined $username) && $ND::DBH->do("INSERT INTO users (username,hostmask,pnick,password) VALUES(?,?,?,'')"
-                               ,undef,$nick,$host,$pnick)){
-                       $ND::server->command("msg $ND::target Added $ND::B$nick(/$pnick)$ND::B with host: $ND::B$host$ND::B");
-               }elsif(defined $username){
-                       $ND::server->command("msg $ND::target $ND::B$username ($p_nick)$ND::B already exists with host: $ND::B$hostname$ND::B.");
-
-               }else{
-                       $ND::server->command("msg $ND::target Something went wrong when trying to add $ND::B$nick ($pnick)$ND::B with host: $ND::B$host$ND::B, ".$ND::DBH->errstr);
-               }
-       }else{
-               $ND::server->command("msg $ND::target Only HCs are allowed to add users");
-       }
-}
 sub whois {
        my ($msg, $command) = @_;