X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Usermgm.pm;fp=Usermgm.pm;h=a38e595b77fba09411b5811b82c9f27112b3426a;hb=e053b73d5ae0ca68e4f40463450fe2fae0ae737a;hp=16a45285243016c4d52d92d9fd832d6c87424d85;hpb=04c0624b174ff51ccd6f1847d342e79a98bfa29b;p=NDIRC.git diff --git a/Usermgm.pm b/Usermgm.pm index 16a4528..a38e595 100644 --- a/Usermgm.pm +++ b/Usermgm.pm @@ -25,7 +25,7 @@ require Exporter; our @ISA = qw/Exporter/; -our @EXPORT = qw/addPoints setHost setPNick/; +our @EXPORT = qw/addPoints setPNick/; sub addPoints { my ($msg, $t) = @_; @@ -75,39 +75,6 @@ sub addPoints { } } -sub setHost { - my ($msg, $command) = @_; - - my ($nick, $host); - if(defined $msg && $msg =~ /^(\S+) (\S+)$/){ - $nick = $1; - $host = $2; - }else{ - $ND::server->command("notice $ND::nick syntax: .sethost nick host | % can be used for wildcards \%arro% will match barrow"); - return; - } - if (hc()){ - my $f = $ND::DBH->prepare("SELECT uid,username FROM users WHERE username ILIKE ?"); - $f->execute($nick); - my ($uid,$nick) = $f->fetchrow(); - if ($f->rows == 1){ - my ($username,$hostname) = $ND::DBH->selectrow_array("SELECT username, hostmask FROM users WHERE hostmask ILIKE ? AND NOT (username ILIKE ?)",undef,$host,$nick); - if ((not defined $username) && $ND::DBH->do("UPDATE users SET hostmask = ? WHERE uid = ?",undef,$host,$uid) > 0){ - $ND::server->command("msg $ND::target Updated $ND::B$nick${ND::B}'s host to: $ND::B$host$ND::B"); - }elsif(defined $username){ - $ND::server->command("msg $ND::target $ND::B$username$ND::B already exists with host: $ND::B$hostname$ND::B."); - }else{ - $ND::server->command("msg $ND::target Couldn't update $ND::B$username${ND::B}'s host"); - } - }elsif ($f->rows == 0){ - $ND::server->command("msg $ND::target No hit, maybe spelling mistake, or add % as wildcard"); - }else{ - $ND::server->command("msg $ND::target More than 1 user matched, please refine the search"); - } - $f->finish; - } -} - sub setPNick { my ($msg, $command) = @_;