Commit: 818dc7c1eabda38eac49ba8caf90f3689cbcba3c Author: Hannes Magnusson <[email protected]> Thu, 28 Mar 2013 21:38:49 -0700 Parents: 6f460457742ea8ccf4fc4b69aaf40c7fc9b6ea92 Branches: master
Link: http://git.php.net/?p=web/wiki.git;a=commitdiff;h=818dc7c1eabda38eac49ba8caf90f3689cbcba3c Log: Add a stupid spam check question Changed paths: M dokuwiki/inc/auth.php M dokuwiki/inc/html.php Diff: diff --git a/dokuwiki/inc/auth.php b/dokuwiki/inc/auth.php index e0f58e5..ed5b594 100644 --- a/dokuwiki/inc/auth.php +++ b/dokuwiki/inc/auth.php @@ -711,6 +711,7 @@ function register(){ if( empty($_POST['login']) || empty($_POST['fullname']) || + empty($_POST['spam']) || empty($_POST['email']) ){ msg($lang['regmissing'],-1); return false; @@ -735,6 +736,13 @@ function register(){ return false; } + // make sure the secret spam box was filled out correctly + if($_POST['spam'] != "hello") { + msg("That wasn't the answer we were expecting",-1); + return false; + } + + //okay try to create the user if(!$auth->triggerUserMod('create', array($_POST['login'],$pass,$_POST['fullname'],$_POST['email']))){ msg($lang['reguexists'],-1); diff --git a/dokuwiki/inc/html.php b/dokuwiki/inc/html.php index 1a2d7da..04b3f6e 100644 --- a/dokuwiki/inc/html.php +++ b/dokuwiki/inc/html.php @@ -1258,6 +1258,7 @@ function html_register(){ } $form->addElement(form_makeTextField('fullname', $_POST['fullname'], $lang['fullname'], '', 'block', array('size'=>'50'))); $form->addElement(form_makeTextField('email', $_POST['email'], $lang['email'], '', 'block', array('size'=>'50'))); + $form->addElement(form_makeTextField('spam', $_POST['spam'], "Please write 'hello' into this box", '', 'block', array('size'=>'50'))); $form->addElement(form_makeButton('submit', '', $lang['btn_register'])); $form->endFieldset(); html_form('register', $form); -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
