Changeset 1117 for trunk/lib/OpenGuides.pm
- Timestamp:
- 08/03/07 20:16:51 (18 months ago)
- Files:
-
- 1 modified
-
trunk/lib/OpenGuides.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/OpenGuides.pm
r1105 r1117 177 177 parameter was passed.) 178 178 179 If you have specified the C<host_checker_module> option in your 180 C<wiki.conf>, this method will attempt to call the <blacklisted_host> 181 method of that module to determine whether the host requesting the node 182 has been blacklisted. If this method returns true, then the 183 C<blacklisted_host.tt> template will be used to display an error message. 184 185 The C<blacklisted_host> method will be passed a scalar containing the host's 186 IP address. 187 179 188 =cut 180 189 … … 191 200 192 201 my %tt_vars; 202 203 # If we can, check to see if requesting host is blacklisted. 204 my $host_checker = $config->host_checker_module; 205 my $is_blacklisted; 206 if ( $host_checker ) { 207 eval { 208 eval "require $host_checker"; 209 $is_blacklisted = $host_checker->blacklisted_host(CGI->new->remote_host); 210 }; 211 } 212 213 if ( $is_blacklisted ) { 214 my $output = OpenGuides::Template->output( 215 wiki => $self->wiki, 216 config => $config, 217 template => "blacklisted_host.tt", 218 vars => { 219 not_editable => 1, 220 }, 221 ); 222 return $output if $return_output; 223 print $output; 224 return; 225 } 193 226 194 227 $tt_vars{home_name} = $self->config->home_name;
