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/zms/captcha.metaobj.xml

    r362 r438  
    426426        temp_handler_available = False  
    427427 
     428 
    428429def captcha_getContent(zms_context): 
    429430        if (zms_context.attr_captcha.getObjProperty('captchaService', zms_context.REQUEST) == 'static_pics'): 
    430431                temp_result = zms_context.dt_html(zms_context.getMetaobjAttr('ZMSCaptchaLib', 'captcha_renderDisplay')['custom'], zms_context.REQUEST) 
    431432        elif (temp_handler_available): 
    432                 temp_handler = C_Handler_Captcha(zms_context) 
    433                 temp_result = temp_handler.GetCaptchaContent() 
     433                try: 
     434                        temp_handler = C_Handler_Captcha(zms_context) 
     435                        temp_result = temp_handler.GetCaptchaContent() 
     436                except: 
     437                        temp_result = zms_context.getLangStr('captchaHandlerNotAvailable', zms_context.REQUEST.get('lang', zms_context.getPrimaryLanguage())) 
    434438        else: 
    435439                temp_result = zms_context.getLangStr('captchaHandlerNotAvailable', zms_context.REQUEST.get('lang', zms_context.getPrimaryLanguage())) 
     
    455459                temp_result = zms_context.dt_html(zms_context.getMetaobjAttr('ZMSCaptchaLib', 'captcha_staticValidation')['custom'], zms_context.REQUEST) 
    456460        elif(temp_handler_available): 
    457                 temp_handler = C_Handler_Captcha(zms_context) 
    458                 temp_result = temp_handler.IsCodeValid() 
     461                try: 
     462                        temp_handler = C_Handler_Captcha(zms_context) 
     463                        temp_result = temp_handler.IsCodeValid() 
     464                except: 
     465                        temp_result = zms_context.getLangStr('captchaHandlerNotAvailable', zms_context.REQUEST.get('lang', zms_context.getPrimaryLanguage())) 
    459466        else: 
    460467                temp_result = zms_context.getLangStr('captchaHandlerNotAvailable', zms_context.REQUEST.get('lang', zms_context.getPrimaryLanguage())) 
     
    536543<item key="name"><![CDATA[CaptchaLib]]></item> 
    537544<item key="package"><![CDATA[com.zms.captcha]]></item> 
    538 <item key="revision"><![CDATA[1.1.0]]></item> 
     545<item key="revision"><![CDATA[1.1.1]]></item> 
    539546<item key="type"><![CDATA[ZMSLibrary]]></item> 
    540547</dictionary> 
     
    567574<item key="name"><![CDATA[com.zms.captcha]]></item> 
    568575<item key="package"></item> 
    569 <item key="revision"><![CDATA[1.1.0]]></item> 
     576<item key="revision"><![CDATA[1.1.1]]></item> 
    570577<item key="type"><![CDATA[ZMSPackage]]></item> 
    571578</dictionary> 
Note: See TracChangeset for help on using the changeset viewer.