home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_28_2.lzh
/
module
/
auto
/
oper.plm
< prev
next >
Wrap
Text File
|
1998-10-15
|
6KB
|
191 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- $_ if 0; # -*- perl -*-
# $Id: oper.plm,v 2.13 1998/07/31 09:47:34 hasegawa Exp $
# copyright (c)1997-1998 pupu_j <hasegawa@agusa.nuie.nagoya-u.ac.jp>
package auto_oper;
$_ = 'auto_oper';
sub ss_privmsg {
local($serverno, $prefix, $cmd, @params) = @_;
local($userno, $nick, $reply);
$userno = $'userno[$serverno];
$nick = &'prefix($prefix);
foreach $req (&'property($userno, 'request')) {
next unless $params[1] eq $req;
if (!($params[0] =~ /^[\#\&\+]/)) {
$reply = &'property($userno, 'private');
&privmsg($serverno, $nick, $reply);
} elsif (!&'exist($'nameslist{$serverno, $params[0]}, "\@$'nick[$serverno]")) {
$reply = &'property($userno, 'notoper');
&privmsg($serverno, $params[0], $reply);
} elsif (&'exist($'nameslist{$serverno, $params[0]}, "\@$nick")) {
$reply = &'property($userno, 'oper');
&privmsg($serverno, $params[0], $reply);
} elsif (&'exist($'nameslist{$serverno, $params[0]}, $nick, "\+$nick")) {
if (&checkmask($userno, $prefix, $params[0])) {
$reply = &'property($userno, 'message');
&privmsg($serverno, $params[0], $reply);
&'s_print($serverno, '', 'MODE', $params[0], '+o', $nick);
} else {
$reply = &'property($userno, 'deny');
&privmsg($serverno, $params[0], $reply);
}
} else {
$reply = &'property($userno, 'out');
&privmsg($serverno, $nick, $reply);
}
last;
}
return ($prefix, $cmd, @params);
}
sub privmsg {
local($serverno, $to, $msg) = @_;
if ($msg) {
&'s_print($serverno, '', 'PRIVMSG', $to, $msg);
foreach $cno (&'array($'clientlist)) {
next unless $'avail[$cno];
next unless $'server[$cno] == $serverno;
&'c_print($cno, &'user($cno), 'PRIVMSG', $to, $msg);
}
}
}
sub checkmask {
local($userno, $prefix, $chan) = @_;
local($user, $chlist, $list);
foreach $mask (&'property($userno, 'mask')) {
($user, $chlist) = split(/\s+/, $mask);
$list = '';
foreach $vchan (split(/\,/, $chlist || '')) {
$list = &'add($list, &'real($vchan));
}
if ($chan =~ /^[\#\&\+]/) {
next unless (!$list || &'exist($list, $chan));
} else {
next unless (!$list || &'exist($list, '*'));
}
if ($user =~ /^\-/) {
$regex = &'regex(substr($user, 1));
return 0 if $prefix =~ /$regex/i;
}
if ($user =~ /^\+/) {
$regex = &'regex(substr($user, 1));
} else {
$regex = &'regex($user);
}
return 1 if $prefix =~ /$regex/i;
}
return 0;
}
__END__
--><HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">
<LINK REV="made" HREF="mailto:hasegawa@agusa.nuie.nagoya-u.ac.jp">
<TITLE>auto/oper.plm</TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3>$BL>A0(B</H3>
auto/oper.plm - $BFCDj$NH/8@$r$7$??M$r%A%c%s%M%k%*%Z%l!<%?$K$9$k(B
<HR><H3>$B@bL@(B</H3>
$BFCDj$N%a%C%;!<%8$rH/8@$7$??M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
<HR><H3>$B%W%m%Q%F%#(B</H3>
<DL>
<DT> auto.oper.request* $B%a%C%;!<%8(B
</DT>
<DD> $B%A%c%s%M%k%*%Z%l!<%?$rMW5a$9$k%a%C%;!<%8$r;XDj$7$^$9!#(B
$B$3$3$G;XDj$7$?%a%C%;!<%8$rH/8@$7$??M$r(B
$B%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
</DD>
<DT> auto.oper.mask* $B%f!<%6%^%9%/(B
</DT>
<DD> $B%A%c%s%M%k%*%Z%l!<%?$rMW5a$7$??M$,$3$3$G;XDj$7$?$b$N$K%^%C%A$7$?$i!"(B
$B$=$N?M$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#(B
</DD>
</DL>
<HR><H3>$B@_DjNc(B</H3>
<PRE>
+ auto/oper.plm
auto.oper.request: $B$W$i$`$J$k$H(B
auto.oper.message: $B$O!A$$!y(B
auto.oper.deny: $B$J$k$H$O$"$2$i$l$^$;$s$o!#(B
auto.oper.oper: $B$b$&$J$k$H;}$C$F$^$9$h!#(B
auto.oper.notoper: $B$4$a$s$J$5$$!#$J$k$H;}$C$F$J$$$s$G$9!#(B
auto.oper.private: $B$J$k$H$,$[$7$$%A%c%s%M%k$G8@$C$F$/$@$5$$$M!#(B
auto.oper.out: $B$($C!"$I$3$K$$$k$s$G$9$+(B?
auto.oper.mask: +*!*@*
</PRE>
$B!V$W$i$`$J$k$H!W$HH/8@$7$??M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
$B$9$Y$F$N%f!<%6$r%A%c%s%M%k%*%Z%l!<%?$K$9$k$3$H$r5v2D$7$F$$$k$N$G!"(B
$BC/$,$I$N%A%c%s%M%k$GMW5a$7$F$-$F$b!"$=$N?M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
$B2?$i$+$NM}M3$G%A%c%s%M%k%*%Z%l!<%?$K$G$-$J$$$H$-$O!"(B
$B$=$l$>$l$NM}M3$K1~$8$?%a%C%;!<%8$rH/8@$7$^$9!#(B
<PRE>
+ auto/oper.plm
auto.oper.request: $B$J$k$H(B
auto.oper.request: $B$J$k$H$/$l(B
auto.oper.request: $B$J$k$H$/$@$5$$(B
auto.oper.request: $B$J$k$H$A$g$&$@$$(B
auto.oper.mask: -*!*@*.com
auto.oper.mask: +*!*@* #$B$^$I$+(B:*.jp
auto.oper.mask: +*!*@*.jp
</PRE>
$B%A%c%s%M%k%*%Z%l!<%?$NMW5a$,(B4$B<oN`$"$kNc$G$9!#(B
$B$3$N$&$A$N$I$l$+$rH/8@$7$??M$r%A%c%s%M%k%*%Z%l!<%?$K$7$^$9!#(B
$B$^$?!"%A%c%s%M%k%*%Z%l!<%?$rMW5a$7$F$-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