summaryrefslogtreecommitdiff
path: root/src/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/controllers')
-rw-r--r--src/controllers/Users.class.php22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/controllers/Users.class.php b/src/controllers/Users.class.php
index fbce874..2461f65 100644
--- a/src/controllers/Users.class.php
+++ b/src/controllers/Users.class.php
@@ -60,6 +60,8 @@ class Users extends Controller {
// since there will never be a remainder to `users/new', we can
// use that parameter to pass in some data.
if (!isset($vars['errors'])) $vars['errors'] = array();
+ global $mm; $pm = $mm->pluginManager();
+ $vars['antispam_html'] = $pm->callHook('antispam_html');
$this->showView('users/new', $vars);
}
@@ -124,16 +126,14 @@ class Users extends Controller {
* explained.
*/
private function create_user() {
+ global $mm;
+ $db = $mm->database();
+ $pm = $mm->pluginManager();
+
$vars = array();
@$vars['username' ] = $_POST['auth_name'];
@$vars['password1'] = $_POST['auth_password' ];
@$vars['password2'] = $_POST['auth_password_verify'];
- @$recaptcha_response = $_POST['recaptcha_response_field'];
- @$recaptcha_challenge = $_POST['recaptcha_challenge_field'];
-
- global $mm; $db = $mm->database();
- $publickey = $db->getPluginConf('ReCaptcha', 'public_key');
- $privatekey = $db->getPluginConf('ReCaptcha', 'private_key');
$vars['errors'] = array();
if ($db->getUID($vars['username'])!==false)
@@ -147,14 +147,8 @@ class Users extends Controller {
if ($matches && $vars['password2'] == '') {
$vars['errors'][] = 'no pw';
}
- require_once('recaptchalib.php');
- $resp = recaptcha_check_answer($privatekey,
- $_SERVER['REMOTE_ADDR'],
- $recaptcha_challenge,
- $recaptcha_response);
- if (!$resp->is_valid) {
- $vars['errors'][] = 'recaptcha';
- $vars['recaptcha_error'] = $resp->error;
+ foreach ($pm->callHook('antispam_verify') as $plugin=>$valid) {
+ if (!$valid) $vars['errors'][] = 'plugin_'.$plugin;
}
if (count($vars['errors']) > 0) {