diff --git a/htdocs/application/controllers/main.php b/htdocs/application/controllers/main.php index 9a83d30..57dff20 100755 --- a/htdocs/application/controllers/main.php +++ b/htdocs/application/controllers/main.php @@ -19,6 +19,7 @@ * - _valid_captcha() * - _valid_ip() * - _blockwords_check() + * - _autofill_check() * - _valid_authentication() * - get_cm_js() * - error_404() @@ -340,6 +341,11 @@ class Main extends CI_Controller 'label' => 'No blocked words', 'rules' => 'callback__blockwords_check', ) , + array( + 'field' => 'email', + 'label' => 'Field must remain empty', + 'rules' => 'callback__autofill_check', + ) , ); //form validation @@ -643,6 +649,16 @@ class Main extends CI_Controller return true; } + function _autofill_check() + { + + //setup message + $this->form_validation->set_message('_autofill_check', 'Go away, robot!'); + + //check + return !$this->input->post('email'); + } + function _valid_authentication() { diff --git a/htdocs/application/views/defaults/paste_form.php b/htdocs/application/views/defaults/paste_form.php index e419cab..dcbf47c 100644 --- a/htdocs/application/views/defaults/paste_form.php +++ b/htdocs/application/views/defaults/paste_form.php @@ -116,6 +116,11 @@ + 'email', 'hidden' => 'hidden'); + echo form_input($set); +?> +