Changeset 983
- Timestamp:
- 01/18/09 11:43:10 (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
-
common/external_libs/recaptchalib.php (added)
-
config.php.sample (modified) (1 diff)
-
www/controllers/account_validator.php (modified) (1 diff)
-
www/controllers/register.php (modified) (3 diffs)
-
www/views/register.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/config.php.sample
r982 r983 147 147 define("IA_LOG_SQL_QUERY_EXPLAIN", false); 148 148 149 // CAPTHCA Keys 150 define("IA_CAPTCHA_PUBLIC_KEY", "6LesuwQAAAAAAPHgdh9Hem1KJfvd5Ng1yRoIweio"); 151 define("IA_CAPTCHA_PRIVATE_KEY", "6LesuwQAAAAAAF3FUPWFGQD1xPITFagjqWUO9Urs"); 152 149 153 ?> -
trunk/www/controllers/account_validator.php
r852 r983 5 5 // validates registration input data (wrapper for validate_data) 6 6 function validate_register_data($data) { 7 return validate_user_data($data, true, null); 7 $errors = validate_user_data($data, true, null); 8 9 $resp = recaptcha_check_answer(IA_CAPTCHA_PRIVATE_KEY, 10 $_SERVER["REMOTE_ADDR"], 11 $data['recaptcha_challenge_field'], 12 $data['recaptcha_response_field']); 13 if (!$resp->is_valid) { 14 $errors['captcha'] = "Cuvintele introduse de tine sunt incorecte"; 15 } 16 return $errors; 8 17 } 9 18 -
trunk/www/controllers/register.php
r852 r983 3 3 require_once(IA_ROOT_DIR."common/db/user.php"); 4 4 require_once(IA_ROOT_DIR."common/db/smf.php"); 5 require_once(IA_ROOT_DIR."common/external_libs/recaptchalib.php"); 5 6 require_once(IA_ROOT_DIR."www/controllers/account_validator.php"); 6 7 … … 27 28 $data['newsletter'] = (request('newsletter') ? 1 : 0); 28 29 $data['tnc'] = (request('tnc') ? 1 : 0); 30 $data['recaptcha_challenge_field'] = request('recaptcha_challenge_field'); 31 $data['recaptcha_response_field'] = request('recaptcha_response_field'); 32 29 33 $errors = validate_register_data($data); 30 34 … … 52 56 $data['tnc'] = 1; 53 57 } 58 $data['captcha'] = recaptcha_get_html(IA_CAPTCHA_PUBLIC_KEY); 54 59 55 60 // attach form is displayed for the first time or a validation error occured -
trunk/www/views/register.php
r934 r983 75 75 </fieldset> 76 76 77 <fieldset> 78 <legend>Captcha</legend> 79 <ul class="form"> 80 <li> 81 <script> 82 var RecaptchaOptions = { 83 theme : 'clean', 84 }; 85 </script> 86 87 <label>Scrieti cuvintele de mai jos:</label> 88 <?= ferr_span('captcha') ?> 89 <?= fval('captcha', false) ?> 90 <span class="fieldHelp">Prin completarea acestei casute ajutati la transcrierea cartilor in format electronic</span> 91 </li> 92 </ul> 93 </fieldset> 94 77 95 <ul class="form clear"> 78 96 <li>
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)