2 # originally by kevin lenzo.
6 if (&IsParam("useStrict")) { use strict; }
10 my ($ret, $f, $o) = "";
11 my @ind = split //, $flags;
13 $userHandle ||= "default";
15 if ($userHandle ne "default") {
16 &DEBUG("isFlag: userHandle == '$userHandle'.");
19 foreach $f (split //, $userList{$userHandle}{'flags'}) {
21 next unless ($f eq $o);
31 my ($nick, $lnuh) = @_;
32 # my ($n,$u,$h) = ($lnuh =~ /^(\S+)!(\S+)\@(\S+)$/);
34 $userHandle = "default";
36 ### FIXME: THIS NEEDS TO BE FIXED TO RECOGNISE HOSTMASKS!!!
38 foreach $user (keys %userList) {
39 ### Hack for time being.
41 if ($user =~ /^\Q$nick\E$/i) {
42 &DEBUG("vU: setting uH => '$user'.");
48 $userinlist = $user if ($user =~ /^\Q$nick\E$/);
51 foreach $m (keys %{$userList{$user}{'mask'}}) {
54 $m =~ s/([\@\(\)\[\]])/\\$1/g;
56 next unless ($lnuh =~ /^$m$/i);
62 last if ($userHandle ne "");
65 if ($userinlist and $userHandle eq "") {
66 &DEBUG("vUser: user is in list but wrong host.");
67 $userHandle = $userinlist;
70 # $talkWho{$talkchannel} = $orig{who};
71 # $talkWho = $orig{who};
73 $talkWho{$talkchannel} = $who if (defined $talkchannel);
80 # returns true if arg1 encrypts to arg2
81 my ($plain, $encrypted) = @_;
82 if ($encrypted eq "") {
83 ($plain, $encrypted) = split(/\s+/, $plain, 2);
85 return 0 unless ($plain ne "" and $encrypted ne "");
87 # MD5 // DES. Bobby Billingsley++.
88 my $salt = substr($encrypted, 0, 2);
89 if ($encrypted =~ /^\$\d\$(\w\w)\$/) {
93 return ($encrypted eq crypt($plain, $salt));
96 # mainly for dcc chat... hrm.
100 if (&IsFlag($flag) eq $flag) {
103 &status("DCC CHAT: <$who> $message -- not enough flags.");
104 &performStrictReply("error: you do not have enough flags for that. ($flag required)");