diff --git a/css/base.css b/css/base.css index e978591..32fbee3 100644 --- a/css/base.css +++ b/css/base.css @@ -641,3 +641,7 @@ input[type="file"] { .tooltip:hover .tooltiptext { visibility: visible; } + +#required_field { + display: none; +} diff --git a/functions/account_functions.php b/functions/account_functions.php index 6ac5e7e..accd32a 100644 --- a/functions/account_functions.php +++ b/functions/account_functions.php @@ -111,6 +111,7 @@ function signup_form($error_msg = '') + @@ -151,8 +152,18 @@ function signup_form($error_msg = '') return $form; } -function create_user($username, $email, $password, $verify_password, $role_id, $upload = null, $x = null, $y = null, $crop_width = null) +function create_user($username, $email, $password, $verify_password, $role_id, $upload = null, $x = null, $y = null, $crop_width = null, $honeypot) { + if (!empty($honeypot)) { + $error_msg = ' +
+ You are a bot. Leave now. +
+ '; + + return $error_msg; + } + if ($password != $verify_password) { $error_msg = '
diff --git a/user.php b/user.php index 4cfec19..cbb8e12 100644 --- a/user.php +++ b/user.php @@ -18,7 +18,8 @@ if (isset($_POST['form_id'])) { (!empty($_FILES) ? $_FILES : ''), (!empty($_POST['crop_x']) ? $_POST['crop_x'] : ''), (!empty($_POST['crop_y']) ? $_POST['crop_y'] : ''), - (!empty($_POST['crop_width']) ? $_POST['crop_width'] : '') + (!empty($_POST['crop_width']) ? $_POST['crop_width'] : ''), + $_POST['required_field'] ); if ($msg === true) {