Ignore:
Timestamp:
26/03/13 12:43:48 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22698: [CEDA Site Python Port] MyCEDA Login needs to be more user-friendly
 http://team.ceda.ac.uk/trac/ceda/ticket/22698

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/dj_security/trunk/dj_security/middleware.py

    r8740 r8741  
    8181     
    8282    def process_response(self, request, response): 
    83         LOGGER.debug("responding to request.path: %s" % (request.path))  
    84         session = getattr(request, 'session', None) 
    85          
    86         if not session:         
    87             return response 
    88          
    89         if request.GET.get('r') and getattr(request, 'session', None): 
    90             request.session['r'] = request.GET.get('r') 
    91          
    92         if request.path.endswith('account/register/') or request.path.endswith('accounts/profile/'): 
    93             return _encode_authenticated_response(request, response) 
    94          
    95         return response 
    96          
     83        return response                 
    9784     
    9885def _calculate_remote_ip(url_path):    
     
    143130                                      request.path])) 
    144131 
    145 def _encode_authenticated_response(request, response): 
    146     def_r = _get_path_to_host(request) 
    147     remote_url = request.session.get('r', def_r) 
     132def _encode_authenticated_response(request, response, redirect_to, user): 
     133    #def_r = _get_path_to_host(request) 
     134    #remote_url = request.session.get('r', def_r) 
    148135     
    149     if not remote_url: 
    150         raise DJSException('Missing url where redirect logged in user') 
     136    #if not redirect_to: 
     137    #    raise DJSException('Missing url where redirect logged in user') 
    151138     
    152     remote_ip = _calculate_remote_ip(base64.b64decode(remote_url)) 
     139    remote_ip = _calculate_remote_ip(redirect_to) 
    153140    LOGGER.info("responding to remote_ip: %s" % (remote_ip))       
    154     user = get_user_byuserkey(request.session[SESSION_KEY]) 
     141    #user = get_user_byuserkey(request.session[SESSION_KEY]) 
    155142     
    156143    '''   
Note: See TracChangeset for help on using the changeset viewer.