mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
captcha check
This commit is contained in:
parent
570f50bd21
commit
0b040a42d9
@ -338,26 +338,26 @@ class Main extends CI_Controller
|
|||||||
if (!$this->input->post('submit'))
|
if (!$this->input->post('submit'))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$this->db_session->userdata('expire'))
|
if (!$this->session->userdata('expire'))
|
||||||
{
|
{
|
||||||
$default_expiration = config_item('default_expiration');
|
$default_expiration = config_item('default_expiration');
|
||||||
$this->db_session->set_userdata('expire', $default_expiration);
|
$this->session->set_userdata('expire', $default_expiration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->db_session->userdata('snipurl'))
|
if (!$this->session->userdata('snipurl'))
|
||||||
{
|
{
|
||||||
$shorturl_selected = config_item('shorturl_selected');
|
$shorturl_selected = config_item('shorturl_selected');
|
||||||
$this->db_session->set_userdata('snipurl', $shorturl_selected);
|
$this->session->set_userdata('snipurl', $shorturl_selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->db_session->flashdata('settings_changed'))
|
if ($this->session->flashdata('settings_changed'))
|
||||||
{
|
{
|
||||||
$data['status_message'] = 'Settings successfully changed';
|
$data['status_message'] = 'Settings successfully changed';
|
||||||
}
|
}
|
||||||
$data['name_set'] = $this->db_session->userdata('name');
|
$data['name_set'] = $this->session->userdata('name');
|
||||||
$data['expire_set'] = $this->db_session->userdata('expire');
|
$data['expire_set'] = $this->session->userdata('expire');
|
||||||
$data['private_set'] = $this->db_session->userdata('private');
|
$data['private_set'] = $this->session->userdata('private');
|
||||||
$data['snipurl_set'] = $this->db_session->userdata('snipurl');
|
$data['snipurl_set'] = $this->session->userdata('snipurl');
|
||||||
$data['paste_set'] = $paste;
|
$data['paste_set'] = $paste;
|
||||||
$data['title_set'] = $title;
|
$data['title_set'] = $title;
|
||||||
$data['reply'] = $reply;
|
$data['reply'] = $reply;
|
||||||
@ -463,7 +463,7 @@ class Main extends CI_Controller
|
|||||||
'snipurl' => $this->input->post('snipurl') ,
|
'snipurl' => $this->input->post('snipurl') ,
|
||||||
'private' => $this->input->post('private') ,
|
'private' => $this->input->post('private') ,
|
||||||
);
|
);
|
||||||
$this->db_session->set_userdata($user_data);
|
$this->session->set_userdata($user_data);
|
||||||
}
|
}
|
||||||
redirect($this->pastes->createPaste());
|
redirect($this->pastes->createPaste());
|
||||||
}
|
}
|
||||||
@ -614,7 +614,7 @@ class Main extends CI_Controller
|
|||||||
if ($check)
|
if ($check)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->db_session->userdata('view_raw'))
|
if ($this->session->userdata('view_raw'))
|
||||||
{
|
{
|
||||||
redirect('view/raw/' . $this->uri->segment(2));
|
redirect('view/raw/' . $this->uri->segment(2));
|
||||||
}
|
}
|
||||||
@ -668,7 +668,7 @@ class Main extends CI_Controller
|
|||||||
$word = $str;
|
$word = $str;
|
||||||
|
|
||||||
//save
|
//save
|
||||||
$this->db_session->set_userdata(array(
|
$this->session->set_userdata(array(
|
||||||
'captcha' => $word
|
'captcha' => $word
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -688,7 +688,7 @@ class Main extends CI_Controller
|
|||||||
function _valid_captcha($text)
|
function _valid_captcha($text)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (config_item('enable_captcha') && $this->db_session->userdata('is_human') === false)
|
if (config_item('enable_captcha') && $this->session->userdata('is_human') === null)
|
||||||
{
|
{
|
||||||
$this->form_validation->set_message('_valid_captcha', lang('captcha'));
|
$this->form_validation->set_message('_valid_captcha', lang('captcha'));
|
||||||
|
|
||||||
@ -697,7 +697,7 @@ class Main extends CI_Controller
|
|||||||
|
|
||||||
if ($this->_valid_recaptcha())
|
if ($this->_valid_recaptcha())
|
||||||
{
|
{
|
||||||
$this->db_session->set_userdata('is_human', true);
|
$this->session->set_userdata('is_human', true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -708,9 +708,9 @@ class Main extends CI_Controller
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strtolower($text) == strtolower($this->db_session->userdata('captcha')))
|
if (strtolower($text) == strtolower($this->session->userdata('captcha')))
|
||||||
{
|
{
|
||||||
$this->db_session->set_userdata('is_human', true);
|
$this->session->set_userdata('is_human', true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -891,7 +891,7 @@ class Main extends CI_Controller
|
|||||||
|
|
||||||
if (!$this->auth_ldap->is_authenticated())
|
if (!$this->auth_ldap->is_authenticated())
|
||||||
{
|
{
|
||||||
$this->db_session->set_flashdata('tried_to', "/" . $this->uri->uri_string());
|
$this->session->set_flashdata('tried_to', "/" . $this->uri->uri_string());
|
||||||
redirect('/auth');
|
redirect('/auth');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
<input type="hidden" value="<?php echo $reply; ?>" name="reply" />
|
<input type="hidden" value="<?php echo $reply; ?>" name="reply" />
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if($this->config->item('enable_captcha') && $this->db_session->userdata('is_human') === false){ ?>
|
<?php if($this->config->item('enable_captcha') && $this->session->userdata('is_human') === null){ ?>
|
||||||
<div class="item_group">
|
<div class="item_group">
|
||||||
<div class="item item_captcha">
|
<div class="item item_captcha">
|
||||||
<label for="captcha"><?php echo lang('paste_spam'); ?>
|
<label for="captcha"><?php echo lang('paste_spam'); ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user