Changeset 1247
- Timestamp:
- 09/05/06 07:26:11 (2 years ago)
- Files:
-
- tracrblpatch/0.9/trac-0.9.6-rbl.patch (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tracrblpatch/0.9/trac-0.9.6-rbl.patch
r1075 r1247 4 4 +++ trac/perm.py (Arbeitskopie) 5 5 @@ -18,7 +18,9 @@ 6 6 7 7 """Management of permissions.""" 8 8 9 9 +import os 10 10 from trac.core import * 11 11 +from trac import rbl 12 13 12 13 14 14 __all__ = ['IPermissionRequestor', 'IPermissionStore', 15 15 @@ -225,6 +227,9 @@ … … 21 21 + actions = filter((lambda x: not x.endswith(suffix)), actions) 22 22 return [action for action in actions if not action.islower()] 23 23 24 24 def get_all_permissions(self): 25 25 Index: trac/rbl.py … … 27 27 --- trac/rbl.py (Revision 0) 28 28 +++ trac/rbl.py (Revision 0) 29 @@ -0,0 +1,2 6@@29 @@ -0,0 +1,28 @@ 30 30 +import socket 31 31 + … … 45 45 + @param config_get Is typically env.config.get 46 46 + """ 47 + if remote_ip in [rbl.strip() for rbl in config_get("trac", "rbl_whitelist").split(",") if not rbl.strip() == ""]: 48 + return False 47 49 + rbls = [rbl.strip() for rbl in config_get("trac", "rbl").split(",") if not rbl.strip() == ""] 48 50 + if len(rbls) > 0: … … 63 65 os.environ['PYTHON_EGG_CACHE'] = req.subprocess_env['PYTHON_EGG_CACHE'] 64 66 + os.environ['REMOTE_IP'] = req.connection.remote_ip 65 67 66 68 mpr = ModPythonRequest(req, options) 67 69 project_opts = dict_translate(options,
