summaryrefslogtreecommitdiff
path: root/src/controllers
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2011-09-22 20:36:17 -0700
committerLuke Shumaker <lukeshu@sbcglobal.net>2011-09-22 20:36:17 -0700
commitd9043d59d9109a0fb8350b9829806b7cab910425 (patch)
tree699ccc284e3e9a6105987fa3b31f332c2329e6e2 /src/controllers
parent98f65a9b001382720d16b34c18256c20410a627c (diff)
parentdb3cb85d0992dd49ca2fdf33ea35c0cad60e312f (diff)
Merge branch 'master' of https://git.gitorious.org/messagemanager/messagemanager
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) {