Changeset 12617 for extensions/CryptograPHP/include/register.inc.php
- Timestamp:
- Nov 13, 2011, 12:34:07 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/CryptograPHP/include/register.inc.php
r11370 r12617 1 1 <?php 2 3 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 $cryptinstall = CRYPTO_PATH.'cryptographp/cryptographp.fct.php';6 include($cryptinstall);7 3 8 4 add_event_handler('loc_end_page_header', 'add_crypto'); … … 11 7 function add_crypto() 12 8 { 13 global $template , $conf;9 global $template; 14 10 15 11 $template->set_prefilter('register', 'prefilter_crypto'); 16 $template->assign('CAPTCHA', dsp_crypt($conf['cryptographp_theme'][0].'.cfg.php',1));17 12 } 18 13 19 14 function prefilter_crypto($content, $smarty) 20 15 { 21 load_language('plugin.lang', CRYPTO_PATH);16 global $conf; 22 17 23 $search = ' <p class="bottomButtons">';18 $search = '#\<\/ul\>(.{0,10})\<\/fieldset\>(.{0,10})\<p class\=\"bottomButtons\"\>#is'; 24 19 $replace = ' 25 <fieldset>26 <legend>{\'Antibot test\'|@translate}</legend>27 <ul>28 20 <li> 29 21 <span class="property"> 30 <label> {$CAPTCHA}</label>22 <label><img id="captcha" src="'.CRYPTO_PATH.'securimage/securimage_show.php" alt="CAPTCHA Image"></label> 31 23 </span> 32 <input type="text" name="code"> 24 <b>{\''.($conf['cryptographp']['captcha_type']=='string'?'Enter code':'Solve equation').'\'|@translate} :</b><br> 25 <input type="text" name="captcha_code" size="'.($conf['cryptographp']['code_length']+1).'" maxlength="'.$conf['cryptographp']['code_length'].'" /> 26 <a href="#" onclick="document.getElementById(\'captcha\').src = \''.CRYPTO_PATH.'securimage/securimage_show.php?\' + Math.random(); return false"> 27 <img src="'.CRYPTO_PATH.'template/refresh.png"></a> 33 28 </li> 34 </ul> 35 </fieldset>' 36 ."\n".$search; 29 </ul> 37 30 38 return str_replace($search, $replace, $content); 31 </fieldset> 32 33 <p class="bottomButtons">'; 34 35 return preg_replace($search, $replace, $content); 39 36 } 40 37 41 38 function check_crypto($errors) 42 39 { 43 if (!chk_crypt($_POST['code'])) 40 include_once(CRYPTO_PATH.'securimage/securimage.php'); 41 $securimage = new Securimage(); 42 43 if ($securimage->check($_POST['captcha_code']) == false) 44 44 { 45 load_language('plugin.lang', CRYPTO_PATH);46 45 array_push($errors, l10n('Invalid Captcha')); 47 46 }
Note: See TracChangeset
for help on using the changeset viewer.