set user creation to use the generic captcha api
This commit is contained in:
parent
cbfab3ba5d
commit
62862994db
@ -5,8 +5,6 @@
|
||||
* Description: Allows people to sign up to the website
|
||||
*/
|
||||
|
||||
require_once "lib/recaptchalib.php";
|
||||
|
||||
class UserBlockBuildingEvent extends Event {
|
||||
var $parts = array();
|
||||
|
||||
@ -111,17 +109,9 @@ class UserPage extends SimpleExtension {
|
||||
}
|
||||
else {
|
||||
try {
|
||||
if(strlen($config->get_string('api_recaptcha_privkey')) > 0) {
|
||||
$resp = recaptcha_check_answer(
|
||||
$config->get_string('api_recaptcha_privkey'),
|
||||
$_SERVER["REMOTE_ADDR"],
|
||||
$_POST["recaptcha_challenge_field"],
|
||||
$_POST["recaptcha_response_field"]);
|
||||
|
||||
if(!$resp->is_valid) {
|
||||
if(!captcha_check()) {
|
||||
throw new UserCreationException("Error in captcha");
|
||||
}
|
||||
}
|
||||
|
||||
$uce = new UserCreationEvent($_POST['name'], $_POST['pass1'], $_POST['email']);
|
||||
send_event($uce);
|
||||
|
@ -48,8 +48,7 @@ class UserPageTheme extends Themelet {
|
||||
if(empty($tac)) {$html = "";}
|
||||
else {$html = "<p>$tac</p>";}
|
||||
|
||||
$rpk = $config->get_string("api_recaptcha_pubkey");
|
||||
$reca = empty($rpk) ? "" : "<tr><td colspan='2'>".recaptcha_get_html($rpk)."</td></tr>";
|
||||
$reca = captcha_get_html();
|
||||
|
||||
$html .= "
|
||||
<form action='".make_link("user_admin/create")."' method='POST'>
|
||||
|
Loading…
x
Reference in New Issue
Block a user