Changeset 438
- Timestamp:
- 02.03.2009 15:03:09 (3 years ago)
- Location:
- CMESS/captcha/trunk/com/zms/captcha
- Files:
-
- 3 edited
-
README.txt (modified) (1 diff)
-
c_captcha_basic.py (modified) (3 diffs)
-
zms/captcha.metaobj.xml (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CMESS/captcha/trunk/com/zms/captcha/README.txt
r362 r438 25 25 HISTORY 26 26 27 v1.1.1.200903021501 28 - bug fixed if PIL is not available 29 27 30 v1.1.0.200901211350 28 31 - added ReCaptcha-service -
CMESS/captcha/trunk/com/zms/captcha/c_captcha_basic.py
r362 r438 1 1 from com.zms.captcha.CaptchasDotNet import CaptchasDotNet 2 from com.zms.captcha.PILCaptcha import * 2 try: 3 from com.zms.captcha.PILCaptcha import * 4 noPIL = False 5 except: 6 noPIL = True 3 7 from com.zms.captcha.reCaptcha import * 4 8 … … 59 63 def __init__(self, zms_context): 60 64 C_Captcha_Basic.__init__(self, zms_context) 61 65 62 66 self.id = 'PILCaptcha' 63 67 64 68 def GetContent(self): 69 if noPIL: 70 raise Exception 71 65 72 temp_img = generateImage(self.zms_context.temp_folder, 66 73 self.zms_context.attr_captcha.getObjProperty('pilcaptchaCharCount', self.zms_context.REQUEST), … … 76 83 77 84 def IsCodeValid(self): 85 if noPIL: 86 raise Exception 87 78 88 if (self.zms_context.REQUEST.SESSION['sess_captcha'] == self.zms_context.REQUEST.form.get('captcha_password', '')): 79 89 temp_result = (True, '') -
CMESS/captcha/trunk/com/zms/captcha/zms/captcha.metaobj.xml
r362 r438 426 426 temp_handler_available = False 427 427 428 428 429 def captcha_getContent(zms_context): 429 430 if (zms_context.attr_captcha.getObjProperty('captchaService', zms_context.REQUEST) == 'static_pics'): 430 431 temp_result = zms_context.dt_html(zms_context.getMetaobjAttr('ZMSCaptchaLib', 'captcha_renderDisplay')['custom'], zms_context.REQUEST) 431 432 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())) 434 438 else: 435 439 temp_result = zms_context.getLangStr('captchaHandlerNotAvailable', zms_context.REQUEST.get('lang', zms_context.getPrimaryLanguage())) … … 455 459 temp_result = zms_context.dt_html(zms_context.getMetaobjAttr('ZMSCaptchaLib', 'captcha_staticValidation')['custom'], zms_context.REQUEST) 456 460 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())) 459 466 else: 460 467 temp_result = zms_context.getLangStr('captchaHandlerNotAvailable', zms_context.REQUEST.get('lang', zms_context.getPrimaryLanguage())) … … 536 543 <item key="name"><![CDATA[CaptchaLib]]></item> 537 544 <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> 539 546 <item key="type"><![CDATA[ZMSLibrary]]></item> 540 547 </dictionary> … … 567 574 <item key="name"><![CDATA[com.zms.captcha]]></item> 568 575 <item key="package"></item> 569 <item key="revision"><![CDATA[1.1. 0]]></item>576 <item key="revision"><![CDATA[1.1.1]]></item> 570 577 <item key="type"><![CDATA[ZMSPackage]]></item> 571 578 </dictionary>
Note: See TracChangeset
for help on using the changeset viewer.
