mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-05-01 07:51:09 -05:00
force encrypted pastes to use the captcha. fixes #425
This commit is contained in:
parent
9f3f7b326c
commit
0490766273
@ -523,6 +523,10 @@ class Main extends CI_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
function post_encrypted()
|
function post_encrypted()
|
||||||
|
{
|
||||||
|
$this->_valid_authentication();
|
||||||
|
|
||||||
|
if ($this->_valid_captcha($this->input->post('captcha')))
|
||||||
{
|
{
|
||||||
$this->load->model('pastes');
|
$this->load->model('pastes');
|
||||||
$_POST['private'] = 1;
|
$_POST['private'] = 1;
|
||||||
@ -530,6 +534,11 @@ class Main extends CI_Controller
|
|||||||
$ret_url = $this->pastes->createPaste();
|
$ret_url = $this->pastes->createPaste();
|
||||||
echo $ret_url;
|
echo $ret_url;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo 'E_CAPTCHA';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function raw()
|
function raw()
|
||||||
{
|
{
|
||||||
@ -752,8 +761,12 @@ class Main extends CI_Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (config_item('enable_captcha') && $this->session->userdata('is_human') === null)
|
if (config_item('enable_captcha') && $this->session->userdata('is_human') === null)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (isset($this->form_validation))
|
||||||
{
|
{
|
||||||
$this->form_validation->set_message('_valid_captcha', lang('captcha'));
|
$this->form_validation->set_message('_valid_captcha', lang('captcha'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->use_recaptcha)
|
if ($this->use_recaptcha)
|
||||||
{
|
{
|
||||||
|
@ -173,11 +173,13 @@ ST.crypto = function() {
|
|||||||
'code': encrypted,
|
'code': encrypted,
|
||||||
'lang': $('#lang').val(),
|
'lang': $('#lang').val(),
|
||||||
'expire': $('#expire').val(),
|
'expire': $('#expire').val(),
|
||||||
|
'captcha': $('#captcha').val(),
|
||||||
'reply': $('input[name=reply]').val()
|
'reply': $('input[name=reply]').val()
|
||||||
},
|
},
|
||||||
function(redirect_url) {
|
function(redirect_url) {
|
||||||
if (redirect_url.indexOf('invalid') > -1) {
|
if (redirect_url.indexOf('E_CAPTCHA') > -1) {
|
||||||
$('#create_encrypted').parent().html('<p>' + redirect_url + '#' + key + '</p>');
|
$('.content .container .message').remove();
|
||||||
|
$('.content .container').prepend('<div class="message error"><div class="container">The captcha is incorrect.</div></div>');
|
||||||
} else {
|
} else {
|
||||||
window.location.href = base_url + redirect_url + '#' + key;
|
window.location.href = base_url + redirect_url + '#' + key;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user