mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
captcha configurable
This commit is contained in:
parent
f533a3d292
commit
5ecbb51bf7
@ -64,12 +64,14 @@ $config['backup_pass'] = '';
|
||||
$config['per_page'] = 10;
|
||||
|
||||
/**
|
||||
* Disable public pastes
|
||||
* Anti spam
|
||||
*
|
||||
* No recent pastes will be displayed.
|
||||
* private_only: No recent pastes will be displayed.
|
||||
* enable_captcha: Users must enter a captcha to post.
|
||||
*
|
||||
**/
|
||||
$config['private_only'] = false;
|
||||
$config['enable_captcha'] = false;
|
||||
|
||||
/**
|
||||
* Default language
|
||||
|
@ -424,9 +424,17 @@ class Main extends CI_Controller
|
||||
|
||||
function _valid_captcha($text)
|
||||
{
|
||||
$this->form_validation->set_message('_valid_captcha', 'The Captcha is incorrect');
|
||||
|
||||
if ($this->config->item('enable_captcha'))
|
||||
{
|
||||
$this->form_validation->set_message('_valid_captcha', 'The Captcha is incorrect.');
|
||||
return $text == $this->db_session->userdata('captcha');
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function get_cm_js()
|
||||
{
|
||||
|
@ -102,6 +102,7 @@
|
||||
<input type="hidden" value="<?php echo $reply; ?>" name="reply" />
|
||||
<?php } ?>
|
||||
|
||||
<?php if($this->config->item('enable_captcha')){ ?>
|
||||
<div class="item_group">
|
||||
<div class="item item_captcha">
|
||||
<label for="captcha">Spam Protection
|
||||
@ -111,6 +112,7 @@
|
||||
<input value="<?php if(isset($captcha_set)){ echo $captcha_set; }?>" type="text" id="captcha" name="captcha" tabindex="2" maxlength="32" />
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div><button type="submit" value="submit" name="submit">Create</button></div>
|
||||
<div class="spacer"></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user