diff --git a/config.inc.php.example b/config.inc.php.example index 648f03d..ce7bcde 100644 --- a/config.inc.php.example +++ b/config.inc.php.example @@ -84,6 +84,9 @@ $dbname = 'scuttle'; # filetypes : An array of bookmark extensions that Scuttle should # add system tags for. # reservedusers : An array of usernames that cannot be registered +# +# antispamQuestion: A question to avoid spam +# antispamAnswer: The answer to the question (users have to put exactly the same answer) ###################################################################### $sitename = 'SemanticScuttle'; @@ -118,5 +121,8 @@ $filetypes = array( ); $reservedusers = array('all', 'watchlist'); +$antispamQuestion = 'Put here the answer to 1 + 2 + 3'; +$antispamAnswer = '6'; + include_once('debug.inc.php'); ?> diff --git a/register.php b/register.php index 8549d05..956efba 100644 --- a/register.php +++ b/register.php @@ -44,6 +44,10 @@ if ($_POST['submitted']) { } elseif (!$userservice->isValidEmail($_POST['email'])) { $tplVars['error'] = T_('E-mail address is not valid. Please try again.'); + // Check if antispam answer is valid + } elseif (strcmp($antispamAnswer, $GLOBALS['antispamAnswer']) != 0) { + $tplVars['error'] = T_('Antispam answer is not valid. Please try again.'); + // Register details } elseif ($userservice->addUser($posteduser, $_POST['password'], $_POST['email'])) { // Log in with new username @@ -57,6 +61,7 @@ if ($_POST['submitted']) { } } +$tplVars['antispamQuestion'] = $GLOBALS['antispamQuestion']; $tplVars['loadjs'] = true; $tplVars['subtitle'] = T_('Register'); $tplVars['formaction'] = createURL('register'); diff --git a/templates/register.tpl.php b/templates/register.tpl.php index 7160535..7691a95 100644 --- a/templates/register.tpl.php +++ b/templates/register.tpl.php @@ -27,6 +27,15 @@ window.onload = function() { + +0) {?> + + + + + + + @@ -37,4 +46,4 @@ window.onload = function() { includeTemplate($GLOBALS['bottom_include']); -?> \ No newline at end of file +?>