Changeset 1936


Ignore:
Timestamp:
09/19/2011 01:35:11 PM (8 months ago)
Author:
Xiping.Wang
Message:

[trunk] implement #321, we add a new configuration file for recaptcha keys.

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bookmarks/bookmarks.php

    r487 r1936  
    105105$templatename = 'bookmarks.tpl'; 
    106106if ($loggedon && isset($_POST['submitted'])) { 
     107 
     108  require_once(dirname(__file__) . "/includes/recaptchalib.php"); 
     109  require_once(dirname(__file__) . "../common/recaptcha.php"); 
     110  $privatekey = $recaptcha_private_key; 
     111  $resp = recaptcha_check_answer ($privatekey, 
     112                                  $_SERVER["REMOTE_ADDR"], 
     113                                  $_POST["recaptcha_challenge_field"], 
     114                                  $_POST["recaptcha_response_field"]); 
     115   
     116  if (!$resp->is_valid) { 
     117     $tplVars['error'] = "The reCAPTCHA wasn't entered correctly. Go back and try it again."; 
     118     $templatename = 'editbookmark.tpl'; 
     119     $saved = false; 
     120  }  else 
     121 
    107122    if (!$_POST['title'] || !$_POST['address']) { 
    108123        $tplVars['error'] = T_('Your bookmark must have a title and an address'); 
  • trunk/bookmarks/templates_omB/editbookmark.tpl.php

    r1932 r1936  
    6969    <td></td> 
    7070    <td> 
     71    <?php 
     72       require_once(dirname(__file__) . "/../includes/recaptchalib.php"); 
     73       require_once(dirname(__file__) . "/../../common/recaptcha.php"); 
     74       $publickey = $recaptcha_public_key; 
     75       echo recaptcha_get_html($publickey); 
     76    ?>   
     77    </td> 
     78    <td></td> 
     79</tr> 
     80<tr> 
     81    <td></td> 
     82    <td> 
    7183        <input type="submit" name="submitted" value="<?php echo $btnsubmit; ?>" /> 
    7284        <?php 
Note: See TracChangeset for help on using the changeset viewer.