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 &DEBUG("isFlag: userHandle == '$userHandle'.");
17 foreach $f (split //, $userList{$userHandle}{'flags'}) {
19 next unless ($f eq $o);
29 my ($nick, $lnuh) = @_;
30 # my ($n,$u,$h) = ($lnuh =~ /^(\S+)!(\S+)\@(\S+)$/);
32 $userHandle = "default";
34 ### FIXME: THIS NEEDS TO BE FIXED TO RECOGNISE HOSTMASKS!!!
36 foreach $user (keys %userList) {
37 ### Hack for time being.
39 if ($user =~ /^\Q$nick\E$/i) {
40 &DEBUG("vU: setting uH => '$user'.");
46 $userinlist = $user if ($user =~ /^\Q$nick\E$/);
49 foreach $m (keys %{$userList{$user}{'mask'}}) {
52 $m =~ s/([\@\(\)\[\]])/\\$1/g;
54 next unless ($lnuh =~ /^$m$/i);
55 &DEBUG("vUser: $lnuh matched masked ($m). Good!");
61 last if ($userHandle ne "");
64 if ($userinlist and $userHandle eq "") {
65 &DEBUG("vUser: user is in list but wrong host.");
66 $userHandle = $userinlist;
69 # $talkWho{$talkchannel} = $orig{who};
70 # $talkWho = $orig{who};
72 $talkWho{$talkchannel} = $who if (defined $talkchannel);
79 # returns true if arg1 encrypts to arg2
80 my ($plain, $encrypted) = @_;
81 if ($encrypted eq "") {
82 ($plain, $encrypted) = split(/\s+/, $plain, 2);
84 return 0 unless ($plain ne "" and $encrypted ne "");
86 # MD5 // DES. Bobby Billingsley++.
87 my $salt = substr($encrypted, 0, 2);
88 if ($encrypted =~ /^\$\d\$(\w\w)\$/) {
92 return ($encrypted eq crypt($plain, $salt));
95 # mainly for dcc chat... hrm.
99 if (&IsFlag($flag) eq $flag) {
102 &status("DCC CHAT: <$who> $message -- not enough flags.");
103 &performStrictReply("error: you do not have enough flags for that. ($flag required)");