Changeset 8755 for mauRepo


Ignore:
Timestamp:
28/03/13 17:18:27 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22689: [CEDA Site Python Port] Logout link
 http://team.ceda.ac.uk/trac/ceda/ticket/22689

File:
1 edited

Legend:

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

    r8752 r8755  
    6464AUTH_TKT = 'auth_tkt' 
    6565 
     66LOGOUT = 'logout' 
     67 
    6668class DJ_Security_Middleware(object): 
    6769    """ 
     
    7375    """     
    7476    def process_request(self, request): 
    75         if len(request.REQUEST.get('logout', '')) > 0: 
    76             request.GET.setlist('logout', ()) 
    77             response = HttpResponseRedirect(_build_url(request))                                 
    78             response.delete_cookie(AUTH_TKT) 
     77        if len(request.REQUEST.get(LOGOUT, '')) > 0: 
     78            response = HttpResponseRedirect(_build_url(request))             
     79            response.delete_cookie(AUTH_TKT,  
     80                                   domain=getattr(settings,  
     81                                                  'COOKIE_DOMAIN',  
     82                                                  'rl.ac.uk')) 
    7983            return response 
    8084 
Note: See TracChangeset for help on using the changeset viewer.