Changeset 8714 for mauRepo


Ignore:
Timestamp:
02/01/13 11:27:01 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22626: [CEDA Site Python Port] security middleware - add accountid to session info passed
 http://team.ceda.ac.uk/trac/ceda/ticket/22626

File:
1 edited

Legend:

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

    r8712 r8714  
    3535from django.db.utils import DatabaseError 
    3636from dj_security.exception import DSJOpenIDNotFoundError 
    37 from django.shortcuts import render_to_response 
    3837 
    3938from userdb_model.models import User 
     
    107106 
    108107def _encode_authenticated_response(request, response): 
    109     remote_ip = _calculate_remote_ip(base64.b64decode(request.session.get('r'))) 
     108    remote_ip = _calculate_remote_ip(base64.b64decode( 
     109                                      request.session.get('r'))) 
    110110    LOGGER.info("responding to remote_ip: %s" % (remote_ip))  
    111111    username = request.session.get('openid').openid 
     
    116116                username,  
    117117                remote_ip,  
    118                 user_data = '{"userkey": "%s"}' % (user.userkey))                
     118                user_data = '{"userkey": "%s", "accountid": "%s"}'  
     119                % (user.userkey, getattr("user", "accountid", "NotAssigned")))                
    119120    LOGGER.info("Created authTicket for %s from %s" % (username, remote_ip)) 
    120121    response.set_cookie('auth_tkt',  
Note: See TracChangeset for help on using the changeset viewer.