This commit is contained in:
Claude 2012-08-30 23:13:09 +02:00
parent 22e9e548fe
commit 59e6a12d82
4 changed files with 11 additions and 2 deletions

View File

@ -72,6 +72,7 @@ $config['per_page'] = 10;
**/ **/
$config['private_only'] = false; $config['private_only'] = false;
$config['enable_captcha'] = false; $config['enable_captcha'] = false;
//spamadmin: accessible via /spamadmin (only active when user + pass is set)
$config['spamadmin_user'] = 'a'; $config['spamadmin_user'] = 'a';
$config['spamadmin_pass'] = 'a'; $config['spamadmin_pass'] = 'a';

View File

@ -146,6 +146,11 @@ class Main extends CI_Controller
'constraint' => 16, 'constraint' => 16,
'default' => 0, 'default' => 0,
) , ) ,
'spam_attempts' => array(
'type' => 'INT',
'constraint' => 6,
'default' => 0,
) ,
); );
$this->dbforge->add_field($fields); $this->dbforge->add_field($fields);
$this->dbforge->add_key('ip_address', true); $this->dbforge->add_key('ip_address', true);

View File

@ -58,6 +58,9 @@ class Spamadmin extends CI_Controller
//fill data //fill data
$data = $this->pastes->getSpamLists('spamadmin/' . $ip_address, $seg = 3, $ip_address); $data = $this->pastes->getSpamLists('spamadmin/' . $ip_address, $seg = 3, $ip_address);
$data['ip_address'] = $ip_address; $data['ip_address'] = $ip_address;
$ip = explode('.', $ip_address);
$ip_firstpart = $ip[0] . '.' . $ip[1] . '.';
$data['ip_range'] = $ip_firstpart . '*.*';
//view //view
$this->load->view('spam_detail', $data); $this->load->view('spam_detail', $data);

View File

@ -12,8 +12,8 @@
<a href="<?php echo site_url('spamadmin/' . $ip_address . '/confirm'); ?>">Remove all pastes below</a> <a href="<?php echo site_url('spamadmin/' . $ip_address . '/confirm'); ?>">Remove all pastes below</a>
</div> </div>
<?php } ?> <?php } ?>
<label for="block_ip">Block IP <label for="block_ip">Block IP range
<span class="instruction">(<?php echo $ip_address; ?>)</span> <span class="instruction">(<?php echo $ip_range; ?>)</span>
</label> </label>
<div class="text_beside"> <div class="text_beside">
<input type="checkbox" id="block_ip" name="block_ip" value="1" checked="checked" /> <input type="checkbox" id="block_ip" name="block_ip" value="1" checked="checked" />