• R/O
  • SSH
  • HTTPS

zerochplus: Commit


Commit MetaInfo

Revisão544 (tree)
Hora2015-01-14 23:21:52
Autoriroiro

Mensagem de Log

0ch_exdeny
・method=disable/host

Mudança Sumário

Diff

--- codes/0ch_exdeny.pl (revision 543)
+++ codes/0ch_exdeny.pl (revision 544)
@@ -91,6 +91,7 @@
9191 my ($host, $addr, $koyuu) = @_;
9292
9393 my $Sys = $this->{'SYS'};
94+ my $method = $this->{'METHOD'};
9495 my $addrb = unpack('B32', pack('C*', split(/\./, $addr)));
9596 my $flag = 0;
9697 my $adex = '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';
@@ -116,6 +117,11 @@
116117 next if (time >= $expires);
117118 }
118119
120+ # 規制方法指定
121+ if ($opt{'method'} && grep { $_ eq $opt{'method'} } qw(disable host)) {
122+ $method = $opt{'method'};
123+ }
124+
119125 # IPアドレス/CIDR
120126 if ($line =~ m|^($adex)(?:/([0-9]+))?$|) {
121127 my $leng = $2 || 32;
@@ -153,11 +159,11 @@
153159
154160 # 規制ユーザ
155161 if ($flag && $this->{'TYPE'} eq 'disable') {
156- if ($this->{'METHOD'} eq 'disable') {
162+ if ($method eq 'disable') {
157163 # 処理:書き込み不可
158164 return 4;
159165 }
160- elsif ($this->{'METHOD'} eq 'host') {
166+ elsif ($method eq 'host') {
161167 # 処理:ホスト表示
162168 return 2;
163169 }
@@ -167,11 +173,11 @@
167173 }
168174 # 限定ユーザ以外
169175 elsif (! $flag && $this->{'TYPE'} eq 'enable') {
170- if ($this->{'METHOD'} eq 'disable') {
176+ if ($method eq 'disable') {
171177 # 処理:書き込み不可
172178 return 4;
173179 }
174- elsif ($this->{'METHOD'} eq 'host') {
180+ elsif ($method eq 'host') {
175181 # 処理:ホスト表示
176182 return 2;
177183 }
Show on old repository browser