GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CATALYST::CONTROLLER::RATELIMIT (3)

.ds Aq ’

NAME

Catalyst::Controller::RateLimit - Protect your site from robots

CONTENTS

VERSION

See $VERSION

SYNOPSIS

Protects your site from flood, robots and spam.



    package MyApp::Controller::Post;
    use parent qw/Catalyst::Controller::RateLimit Catalyst::Controller/;
        # Catalyst::Controller is not required, but i think, it will look better if you include it
    __PACKAGE__->config(
        rate_limit_backend_name => Cache::Memcached::Fast,
        # ^- Optional. Only if your module is not Cache::Memcached::Fast child, but has the same behavior.
        rate_limit => {
            default => [
                {
                    attempts => 30,
                    period => 3600,
                }, {
                    attempts => 5,
                    period => 60,
                }
            ]
        }
    );

    sub login_form : Local { #Only check
        my ( $self, $c ) = @_;
        my $is_overrated = $self->flood_control->is_user_overrated( $c->user->login || $c->request->address );
        if ( $is_overrated ) {
            $c->forward( show_captcha );
        }
        #...
    }

    sub login : Local { #Check and register attempt
        my ( $self, $c ) = @_;
        if ( $self->flood_control->register_attempt( $c->user->login || $c->request->address ) ) {
            # checking for CAPTCHA
        }
        #...
    }

    sub show_captcha : Local { # If user have reached his limits, it is called
        ... code to add captcha to page ...
    }



DESCRIPTION

Protects critical parts of your site from robots.

NOTES

METHODS

    new

    flood_control

Returns Algorithm::FloodControl object.

AUTHOR

Andrey Kostenko, <andrey at kostenko.name>

BUGS

Please report any bugs or feature requests to bug-catalyst-plugin-stoprobots at rt.cpan.org, or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Controller-RateLimit>. I will be notified, and then you’ll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.



    perldoc Catalyst::Controller::RateLimit



You can also look for information at:
o RT: CPAN’s request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Catalyst-Controller-RateLimit>

o AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/Catalyst-Controller-RateLimit>

o CPAN Ratings

<http://cpanratings.perl.org/d/Catalyst-Controller-RateLimit>

o Search CPAN

<http://search.cpan.org/dist/Catalyst-Controller-RateLimit>

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2008 Andrey Kostenko.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CATALYST::CONTROLLER::RATELIMIT (3) 2010-01-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.