Ignore:
Timestamp:
26.11.2008 10:45:44 (3 years ago)
Author:
mike
Message:

zms forum uses captchas to verify human interaction

Location:
CMESS/forum/branches/captcha/cmess
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • CMESS/forum/branches/captcha/cmess/forum/zms/zmsforum.metaobj.xml

    r304 r315  
    9494</item> 
    9595<item type="dictionary"><dictionary> 
    96 <item key="id"><![CDATA[zfEnableCaptcha]]></item> 
    97 <item key="keys" type="list"><list> 
    98 <item><![CDATA[captcha.net]]></item> 
    99 </list> 
    100 </item> 
    101 <item key="mandatory" type="int">0</item> 
    102 <item key="multilang" type="int">1</item> 
    103 <item key="name"><![CDATA[Captcha?]]></item> 
    104 <item key="repetitive" type="int">0</item> 
    105 <item key="type"><![CDATA[select]]></item> 
     96<item key="id"><![CDATA[attr_captcha]]></item> 
     97<item key="mandatory" type="int">1</item> 
     98<item key="multilang" type="int">0</item> 
     99<item key="name"><![CDATA[Captcha]]></item> 
     100<item key="repetitive" type="int">0</item> 
     101<item key="type"><![CDATA[attr_captcha]]></item> 
    106102</dictionary> 
    107103</item> 
     
    12101206 
    12111207def checkCaptcha(): 
    1212         temp_captcha_mode = context.getObjProperty('zfEnableCaptcha', REQUEST) 
    1213         if ((temp_captcha_mode is not None) and (len(temp_captcha_mode) > 0)): 
    1214                 temp_result = context.ZMSForum_isCaptchaValid(temp_captcha_mode, REQUEST) 
    1215         else: 
     1208        try: 
     1209                temp_captcha_enabled = context.attr_captcha.getObjProperty('captchaEnabled', REQUEST) 
     1210                if (temp_captcha_enabled): 
     1211                        temp_result = context.captcha_isValid(context) 
     1212                else: 
     1213                        temp_result = (True, '') 
     1214        except: 
    12161215                temp_result = (True, '') 
    12171216                 
     
    12451244 
    12461245def getCaptchaContent(): 
    1247         temp_captcha_mode = context.getObjProperty('zfEnableCaptcha', REQUEST) 
    1248         if ((temp_captcha_mode is not None) and (len(temp_captcha_mode) > 0)): 
    1249                 temp_captcha_content = context.ZMSForum_getCaptchaContent(temp_captcha_mode) 
    1250         else: 
     1246        try: 
     1247                temp_captcha_enabled = context.attr_captcha.getObjProperty('captchaEnabled', REQUEST) 
     1248                if (temp_captcha_enabled): 
     1249                        temp_captcha_content = context.captcha_getContent(context) 
     1250                else: 
     1251                        temp_captcha_content = '' 
     1252        except: 
    12511253                temp_captcha_content = '' 
    1252                  
     1254         
    12531255        return temp_captcha_content 
    12541256 
     
    22312233</dictionary> 
    22322234</item> 
    2233 <item type="dictionary"><dictionary> 
    2234 <item key="custom"><![CDATA[from org.cmess.forum.c_handler_captcha import C_Handler_Captcha  
    2235  
    2236 def ZMSForum_getCaptchaContent(captcha_mode): 
    2237   temp_handler = C_Handler_Captcha(captcha_mode) 
    2238   temp_result = temp_handler.GetCaptchaContent() 
    2239    
    2240   return temp_result]]></item> 
    2241 <item key="id"><![CDATA[ZMSForum_getCaptchaContent]]></item> 
    2242 <item key="mandatory" type="int">0</item> 
    2243 <item key="multilang" type="int">0</item> 
    2244 <item key="name"><![CDATA[ZMSForum_getCaptchaContent]]></item> 
    2245 <item key="repetitive" type="int">0</item> 
    2246 <item key="type"><![CDATA[External Method]]></item> 
    2247 </dictionary> 
    2248 </item> 
    2249 <item type="dictionary"><dictionary> 
    2250 <item key="custom"><![CDATA[from org.cmess.forum.c_handler_captcha import C_Handler_Captcha  
    2251  
    2252 def ZMSForum_isCaptchaValid(captcha_mode, REQUEST): 
    2253   temp_handler = C_Handler_Captcha(captcha_mode) 
    2254   temp_result = temp_handler.IsCodeValid(REQUEST) 
    2255    
    2256   return temp_result]]></item> 
    2257 <item key="id"><![CDATA[ZMSForum_isCaptchaValid]]></item> 
    2258 <item key="mandatory" type="int">0</item> 
    2259 <item key="multilang" type="int">0</item> 
    2260 <item key="name"><![CDATA[ZMSForum_isCaptchaValid]]></item> 
    2261 <item key="repetitive" type="int">0</item> 
    2262 <item key="type"><![CDATA[External Method]]></item> 
    2263 </dictionary> 
    2264 </item> 
    22652235</list> 
    22662236</item> 
Note: See TracChangeset for help on using the changeset viewer.