2 # originally by kevin lenzo.
6 if (&IsParam("useStrict")) { use strict; }
10 my ($ret, $f, $o) = "";
12 foreach $f (split //, $userList{$userHandle}{'flags'}) {
13 foreach $o ( split //, $flags ) {
14 next unless ($f eq $o);
25 my ($nick, $lnuh) = @_;
30 foreach $user (keys %userList) {
31 foreach $m (keys %{$userList{$user}{'mask'}}) {
34 $m =~ s/([\@\(\)\[\]])/\\$1/g;
36 next unless ($lnuh =~ /^$m$/i);
38 if ($user !~ /^\Q$nick\E$/i) {
39 &status("vU: host matched but diff nick ($nick != $user).");
46 last if ($userHandle ne "");
48 if ($user =~ /^\Q$nick\E$/i) {
49 &status("vU: nick matched but host is not in list ($lnuh).");
53 $userHandle ||= "default";
54 $talkWho{$talkchannel} = $who if (defined $talkchannel);
61 # returns true if arg1 encrypts to arg2
62 my ($plain, $encrypted) = @_;
63 if ($encrypted eq "") {
64 ($plain, $encrypted) = split(/\s+/, $plain, 2);
66 return 0 unless ($plain ne "" and $encrypted ne "");
68 # MD5 // DES. Bobby Billingsley++.
69 my $salt = substr($encrypted, 0, 2);
70 if ($encrypted =~ /^\$\d\$(\w\w)\$/) {
74 return ($encrypted eq crypt($plain, $salt));
77 # mainly for dcc chat... hrm.
81 if (&IsFlag($flag) eq $flag) {
84 &status("DCC CHAT: <$who> $message -- not enough flags.");
85 &performStrictReply("error: you do not have enough flags for that. ($flag required)");