Ignore:
Timestamp:
02.03.2009 15:03:09 (3 years ago)
Author:
chris
Message:
  • bug fixed if PIL is not available
File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMESS/captcha/trunk/com/zms/captcha/c_captcha_basic.py

    r362 r438  
    11from com.zms.captcha.CaptchasDotNet import CaptchasDotNet 
    2 from com.zms.captcha.PILCaptcha import * 
     2try: 
     3        from com.zms.captcha.PILCaptcha import * 
     4        noPIL = False 
     5except: 
     6        noPIL = True 
    37from com.zms.captcha.reCaptcha import * 
    48 
     
    5963        def __init__(self, zms_context): 
    6064                C_Captcha_Basic.__init__(self, zms_context) 
    61                  
     65 
    6266                self.id = 'PILCaptcha' 
    6367         
    6468        def GetContent(self): 
     69                if noPIL: 
     70                        raise Exception 
     71 
    6572                temp_img = generateImage(self.zms_context.temp_folder,  
    6673                                                                                                                        self.zms_context.attr_captcha.getObjProperty('pilcaptchaCharCount', self.zms_context.REQUEST),  
     
    7683         
    7784        def IsCodeValid(self): 
     85                if noPIL: 
     86                        raise Exception 
     87         
    7888                if (self.zms_context.REQUEST.SESSION['sess_captcha'] == self.zms_context.REQUEST.form.get('captcha_password', '')): 
    7989                        temp_result = (True, '') 
Note: See TracChangeset for help on using the changeset viewer.