Changeset 304
- Timestamp:
- 21.11.2008 15:12:22 (3 years ago)
- Location:
- CMESS/forum/branches/captcha
- Files:
-
- 1 edited
- 1 copied
-
. (copied) (copied from CMESS/forum/trunk)
-
org/cmess/forum/zms/zmsforum.metaobj.xml (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CMESS/forum/branches/captcha/org/cmess/forum/zms/zmsforum.metaobj.xml
r277 r304 91 91 <item key="repetitive" type="int">0</item> 92 92 <item key="type"><![CDATA[boolean]]></item> 93 </dictionary> 94 </item> 95 <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> 93 106 </dictionary> 94 107 </item> … … 733 746 - zfmEmail value 734 747 - zfmBody text 748 - captcha content 735 749 </dtml-comment> 736 750 … … 768 782 <input type="file" name="zfmFile" size="19"> 769 783 </div> 784 <div class="field"> 785 %s 786 </div> 770 787 </fieldset> 771 788 <input type="submit" name="btn" value="<dtml-var "getLangStr('zfBtnSend', lang)">"> … … 1044 1061 <item key="name"><![CDATA[Forum]]></item> 1045 1062 <item key="package"><![CDATA[org.cmess.forum]]></item> 1046 <item key="revision"><![CDATA[1. 0.0]]></item>1063 <item key="revision"><![CDATA[1.1.0]]></item> 1047 1064 <item key="type"><![CDATA[ZMSObject]]></item> 1048 1065 </dictionary> … … 1192 1209 return temp_result 1193 1210 1211 def 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: 1216 temp_result = (True, '') 1217 1218 return temp_result 1219 1194 1220 def checkNewEmail(): 1195 1221 temp_err = [] … … 1212 1238 temp_err.extend(temp_email_err) 1213 1239 1240 temp_captcha_err = checkCaptcha() 1241 if (not temp_captcha_err[0]): 1242 temp_err.append(temp_captcha_err[1]) 1243 1214 1244 return (len(temp_err) > 0) and temp_err or None 1245 1246 def 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: 1251 temp_captcha_content = '' 1252 1253 return temp_captcha_content 1215 1254 1216 1255 def handleDisplayHelp(): … … 1246 1285 'AW: ' + temp_msg[0]['zfmSubject'], 1247 1286 REQUEST.get('zfmAuthor', REQUEST.cookies.get('__ac_author', '')), 1248 REQUEST.get('zfmEmail', REQUEST.cookies.get('__ac_email', '')), temp_text )1287 REQUEST.get('zfmEmail', REQUEST.cookies.get('__ac_email', '')), temp_text, getCaptchaContent()) 1249 1288 else: 1250 1289 temp_err_list, temp_result = processError(context.getLangStr('zfErrMsgNotFound', temp_lang), handleDisplayOverview) … … 1253 1292 'insertReply', context.getLangStr('zfReplyMessage', temp_lang), 1254 1293 REQUEST.form.get('zfmSubject', ''), REQUEST.form.get('zfmAuthor', ''), 1255 REQUEST.form.get('zfmEmail', ''), REQUEST.form.get('zfmBody', '') )1294 REQUEST.form.get('zfmEmail', ''), REQUEST.form.get('zfmBody', ''), getCaptchaContent()) 1256 1295 else: 1257 1296 temp_err_list, temp_result = processError(context.getLangStr('zfErrParams', temp_lang), handleDisplayMessage) … … 1326 1365 context.getLangStr('zfInsertTopic', temp_lang), REQUEST.form.get('zfmSubject', ''), 1327 1366 REQUEST.form.get('zfmAuthor', ''), REQUEST.form.get('zfmEmail', ''), 1328 REQUEST.form.get('zfmBody', '')) 1367 REQUEST.form.get('zfmBody', ''), getCaptchaContent()) 1368 elif (REQUEST.form.has_key('captcha_new')): 1369 temp_err_list = None 1370 temp_result = (context.getObjProperty('newMessageForm', REQUEST))%('', 'insertNew', 1371 context.getLangStr('zfInsertTopic', temp_lang), REQUEST.form.get('zfmSubject', ''), 1372 REQUEST.form.get('zfmAuthor', ''), REQUEST.form.get('zfmEmail', ''), 1373 REQUEST.form.get('zfmBody', ''), getCaptchaContent()) 1329 1374 else: 1330 1375 temp_err_list = None 1331 1376 temp_result = (context.getObjProperty('newMessageForm', REQUEST))%('', 'insertNew', 1332 context.getLangStr('zfInsertTopic', temp_lang), '', '', '', '' )1377 context.getLangStr('zfInsertTopic', temp_lang), '', '', '', '', getCaptchaContent()) 1333 1378 1334 1379 return (temp_err_list, temp_result) … … 2186 2231 </dictionary> 2187 2232 </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> 2188 2265 </list> 2189 2266 </item> … … 2207 2284 <item key="name"><![CDATA[Library]]></item> 2208 2285 <item key="package"><![CDATA[org.cmess.forum]]></item> 2209 <item key="revision"><![CDATA[1. 0.0]]></item>2286 <item key="revision"><![CDATA[1.1.0]]></item> 2210 2287 <item key="type"><![CDATA[ZMSLibrary]]></item> 2211 2288 </dictionary> … … 2765 2842 <item key="name"><![CDATA[org.cmess.forum]]></item> 2766 2843 <item key="package"></item> 2767 <item key="revision"><![CDATA[1. 0.0]]></item>2844 <item key="revision"><![CDATA[1.1.0]]></item> 2768 2845 <item key="type"><![CDATA[ZMSPackage]]></item> 2769 2846 </dictionary>
Note: See TracChangeset
for help on using the changeset viewer.
