Changeset 1247

Show
Ignore:
Timestamp:
09/05/06 07:26:11 (2 years ago)
Author:
wmark
Message:

TracRblPatch:

Whitelisting of IPs from being checked against RBL was implemented.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tracrblpatch/0.9/trac-0.9.6-rbl.patch

    r1075 r1247  
    44+++ trac/perm.py        (Arbeitskopie) 
    55@@ -18,7 +18,9 @@ 
    6   
     6 
    77 """Management of permissions.""" 
    8   
     8 
    99+import os 
    1010 from trac.core import * 
    1111+from trac import rbl 
    12   
    13   
     12 
     13 
    1414 __all__ = ['IPermissionRequestor', 'IPermissionStore', 
    1515@@ -225,6 +227,9 @@ 
     
    2121+               actions = filter((lambda x: not x.endswith(suffix)), actions) 
    2222         return [action for action in actions if not action.islower()] 
    23   
     23 
    2424     def get_all_permissions(self): 
    2525Index: trac/rbl.py 
     
    2727--- trac/rbl.py (Revision 0) 
    2828+++ trac/rbl.py (Revision 0) 
    29 @@ -0,0 +1,26 @@ 
     29@@ -0,0 +1,28 @@ 
    3030+import socket 
    3131+ 
     
    4545+    @param     config_get      Is typically env.config.get 
    4646+    """ 
     47+    if remote_ip in [rbl.strip() for rbl in config_get("trac", "rbl_whitelist").split(",") if not rbl.strip() == ""]: 
     48+       return False 
    4749+    rbls = [rbl.strip() for rbl in config_get("trac", "rbl").split(",") if not rbl.strip() == ""] 
    4850+    if len(rbls) > 0: 
     
    6365         os.environ['PYTHON_EGG_CACHE'] = req.subprocess_env['PYTHON_EGG_CACHE'] 
    6466+    os.environ['REMOTE_IP'] = req.connection.remote_ip 
    65   
     67 
    6668     mpr = ModPythonRequest(req, options) 
    6769     project_opts = dict_translate(options,