[eluser]flash_back[/eluser]
yes, you are 100% right, as you can see in VBulletin v4 you have captcha’s for every single thread
but this way, robot (if it is not smart enough), he can (if get XHTML) spam one time and there is BAN, no second chance...
we have a line that says, if you fly high you fall down big time.. but on social network side, if you dont think like you fly high you will fall down!
---
code, all working except ci_session call's, simple and fast plug in
---
in main model that load all others:
// Alfa v0.1 security
if (!$this->db_session->userdata('sigurnosni_kod')):
$this->db_session->set_userdata('sigurnosni_kod', md5('xxx'.time().'xxx'));
endif;
// form_helper.php - at the end form_open function
$obj =& get_instance();
$form .= form_hidden('sigurnosni_kod', $obj->db_session->userdata('sigurnosni_kod'));
return $form; // two lines before that
// DB_driver.php // this f... me, put this in first line of query function!
if (preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql)):
$this->CI=& get_instance();
if ($this->CI->input->post('sigurnosni_kod')):
$sigurnosni_kod = $this->CI->input->post('sigurnosni_kod');
// if ($this->CI->load->library('db_session')): echo 'OK'; exit; else: echo 'sranje'; exit; endif;
$sigurnosni_kod_sesije = $this->CI->db_session->userdata('sigurnosni_kod');
if ($sigurnosni_kod != $sigurnosni_kod_sesije):
// this code is rejected like all POST parameters, set new one, second time and BAN user for a while!
$CI->db_session->set_userdata('sigurnosni_kod', md5('xxx'.time().'xxx'));
echo 'Sigurnosni zaštitni parametri nisu ispunjeni!'; exit;
else:
// code passed, refresh whit new one for next form

$CI->db_session->set_userdata('sigurnosni_kod', md5('xxx'.time().'xxx'));
endif;
else:
echo 'BOT, hacker, some error page, cant be user or BAN!'; exit;
endif;
endif;
---
if you can please help me, whit getting userdata call of db_session library and set_userdata too?!? this way just one time robot can enter just one time! I can make code to cache second one and ban IP or something for 1/2h! anyway, great for changing id of session / cookie too then little faster etc.. but this must go on