autofill check

This commit is contained in:
Claude 2012-10-20 20:38:43 +02:00
parent d8a13996ec
commit 806b84b379
2 changed files with 21 additions and 0 deletions

View File

@ -19,6 +19,7 @@
* - _valid_captcha() * - _valid_captcha()
* - _valid_ip() * - _valid_ip()
* - _blockwords_check() * - _blockwords_check()
* - _autofill_check()
* - _valid_authentication() * - _valid_authentication()
* - get_cm_js() * - get_cm_js()
* - error_404() * - error_404()
@ -340,6 +341,11 @@ class Main extends CI_Controller
'label' => 'No blocked words', 'label' => 'No blocked words',
'rules' => 'callback__blockwords_check', 'rules' => 'callback__blockwords_check',
) , ) ,
array(
'field' => 'email',
'label' => 'Field must remain empty',
'rules' => 'callback__autofill_check',
) ,
); );
//form validation //form validation
@ -643,6 +649,16 @@ class Main extends CI_Controller
return true; 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() function _valid_authentication()
{ {

View File

@ -116,6 +116,11 @@
</div> </div>
<?php } ?> <?php } ?>
<?php
$set = array('name' => 'email', 'hidden' => 'hidden');
echo form_input($set);
?>
<div><button type="submit" value="submit" name="submit">Create</button></div> <div><button type="submit" value="submit" name="submit">Create</button></div>
<div class="spacer"></div> <div class="spacer"></div>
</form> </form>