Mercurial > moin > 1.9
changeset 4162:b36478ce3a0e
Function documentation in MoinMoin.web.utils
author | Florian Krupicka <florian.krupicka@googlemail.com> |
---|---|
date | Wed, 11 Jun 2008 12:22:32 +0200 |
parents | 67f0fc696d97 |
children | d45b0bb15d2f |
files | MoinMoin/web/utils.py |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/web/utils.py Wed Jun 11 12:13:30 2008 +0200 +++ b/MoinMoin/web/utils.py Wed Jun 11 12:22:32 2008 +0200 @@ -45,6 +45,11 @@ return False def check_forbidden(request): + """ Simple action and host access checks + + Spider agents are checked against the called actions, + hosts against the blacklist. Raises Forbidden if triggered. + """ args = request.args action = args.get('action') if ((args or request.method != 'GET') and @@ -64,8 +69,11 @@ return False def check_surge_protect(request, kick=False): - """ check if someone requesting too much from us, - if kick_him is True, we unconditionally blacklist the current user/ip + """ Check for excessive requests + + Raises a SurgeProtection exception on wiki overuse. + + @param request: a moin request object """ limits = request.cfg.surge_action_limits if not limits: