| Next: Yawns::Mailer | Previous: Yawns::Formatters::Textile | [Table of Contents] |
Yawns::IP - A module for working with an IP blacklist.
#!/usr/bin/perl -w
use Yawns::IP;
use strict;
#
# Test to see if the lookback address is blocked.
#
my $ip = Yawns::IP->new();
my $blocked = $ip->lookup( '127.0.0.1' );
This module will allow an IP address to be looked up in the site-wide comment-posting blacklist.
The blacklist is cached in memory to provide fast lookups.
We only use the blacklist to decide whether anonymous commentors may post - if a user is logged in then we don't lookup their IP address in the cache.
Create a new instance of this object.
Return the results of an IP address lookup, if the in-memory cache of IP addresses is not found then we query the database for all blacklisted IP addresses.
Clean our cached blacklist details.
Steve Kemp
http://www.steve.org.uk/
Copyright (c) 2005,2006 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.