diff --git a/dokuwiki/inc/auth.php b/dokuwiki/inc/auth.php index b793f5d1..8c813557 100644 --- a/dokuwiki/inc/auth.php +++ b/dokuwiki/inc/auth.php @@ -921,11 +921,12 @@ function register() { // gather input $login = trim($auth->cleanUser($INPUT->post->str('login'))); $fullname = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('fullname'))); + $spam = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('spam'))); $email = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('email'))); $pass = $INPUT->post->str('pass'); $passchk = $INPUT->post->str('passchk'); - if(empty($login) || empty($fullname) || empty($email)) { + if(empty($login) || empty($fullname) || empty($email) || empty($spam)) { msg($lang['regmissing'], -1); return false; } @@ -945,6 +946,12 @@ function register() { msg($lang['regbadmail'], -1); return false; } + // make sure the secret spam box was filled out correctly + if($spam != "php-webmaster@lists.php.net") { + msg("That wasn't the answer we were expecting",-1); + return false; + } + //okay try to create the user if(!$auth->triggerUserMod('create', array($login, $pass, $fullname, $email))) { diff --git a/dokuwiki/inc/html.php b/dokuwiki/inc/html.php index 7f473cdb..55e9b037 100644 --- a/dokuwiki/inc/html.php +++ b/dokuwiki/inc/html.php @@ -1325,6 +1325,7 @@ function html_register(){ } $form->addElement(form_makeTextField('fullname', $INPUT->post->str('fullname'), $lang['fullname'], '', 'block', $base_attrs)); $form->addElement(form_makeField('email','email', $INPUT->post->str('email'), $lang['email'], '', 'block', $email_attrs)); + $form->addElement(form_makeTextField('spam', $_POST['spam'], "Which email address do you have to mail now?", '', 'block', array('size'=>'50'))); $form->addElement(form_makeButton('submit', '', $lang['btn_register'])); $form->endFieldset(); html_form('register', $form);