Changeset 5656 for WAeUP_SRP/trunk


Ignore:
Timestamp:
23 Jan 2011, 21:48:44 (14 years ago)
Author:
Henrik Bettermann
Message:

Log failed logins.

Location:
WAeUP_SRP/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTool.py

    r5655 r5656  
    5252import csv,re,os,sys
    5353import md5
     54import base64
    5455from shutil import copy2,copy
    5556from Products.AdvancedQuery import Eq, Between, Le,In
     
    596597        return getattr(student_entry,"password","not set")
    597598    ###)
     599   
     600    security.declarePublic('getCredentialFromAuthHeader') ###(
     601    def getCredentialFromAuthHeader(self,request):
     602        return base64.b64decode(request._auth.replace('Basic ',''))
     603    ###)
    598604
    599605    security.declarePublic('checkPassword') ###(
  • WAeUP_SRP/trunk/skins/cps_custom/logged_in.py

    r5655 r5656  
    1919        pass
    2020import DateTime
    21 import os
     21import os 
    2222current = DateTime.DateTime()
    2323import logging
     
    3838member = mtool.getAuthenticatedMember()
    3939member_id = str(member)
     40
     41cred = context.waeup_tool.getCredentialFromAuthHeader(request)
    4042
    4143if context.isStaff():
     
    300302#Anonymous
    301303else:
     304    logger.info('failed login with %s' % cred)
    302305    response.expireCookie('__ac', path='/')
    303306    return context.user_logged_in_failed()
Note: See TracChangeset for help on using the changeset viewer.