Ignore:
Timestamp:
02/09/13 12:25:31 (6 years ago)
Author:
mnagni
Message:

Incomplete - # 22802: [CEDA Site Python Port] Login - no message is displayed when the user enters the wrong password
 http://team.ceda.ac.uk/trac/ceda/ticket/22802

Better cookie management

File:
1 edited

Legend:

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

    r8795 r8799  
    4040from dj_security_middleware.exception import DJMiddlewareException,\ 
    4141    MissingCookieException 
    42 from dj_security_middleware import _get_host_ip, security_filter, auth_tkt_name,\ 
    43     shared_secret, token_field_name, redirect_field_name, cookie_domain 
     42from dj_security_middleware import _get_host_ip, security_filter, \ 
     43auth_tkt_name, shared_secret, token_field_name, redirect_field_name, \ 
     44cookie_domain, login_service 
    4445 
    4546import socket 
     
    4748import re 
    4849import urllib 
    49  
    50 LOGIN_SERVICE_ERROR = 'No LOGIN_SETTING parameter is defined in the \ 
    51 application settings.py file. Please define a proper URL to the \ 
    52 authenticating service' 
    5350 
    5451DJ_SECURITY_SHAREDSECRET_ERROR = 'No SECURITY_SHAREDSECRET parameter \ 
     
    8582 
    8683    def process_request(self, request): 
     84        login_service()  
     85         
    8786        #Has to process a reset password request?  
    8887        if len(request.REQUEST.get(LOGOUT, '')) > 0: 
     
    103102            return 
    104103         
    105         if not getattr(settings, 'DJ_SECURITY_LOGIN_SERVICE', None): 
    106             raise DJMiddlewareException(LOGIN_SERVICE_ERROR)   
    107          
    108104        custom_auth = getattr(settings, 'DJ_SECURITY_AUTH_CHECK', None) 
    109105        if custom_auth: 
     
    122118            qs = {redirect_field_name():  
    123119                  urllib.quote_plus((_build_url(request)))}              
    124             url = '%s?%s' % (settings.DJ_SECURITY_LOGIN_SERVICE,  
     120            url = '%s?%s' % (login_service(),  
    125121                             urlencode(qs)) 
    126122            timestamp, userid, tokens, user_data = _is_authenticated(request) 
Note: See TracChangeset for help on using the changeset viewer.