mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
blocked ips list
This commit is contained in:
parent
e686aa5205
commit
a4d19153db
@ -146,7 +146,10 @@ class Main extends CI_Controller
|
||||
'constraint' => 16,
|
||||
'default' => 0,
|
||||
) ,
|
||||
//todo
|
||||
'blocked_at' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 10,
|
||||
) ,
|
||||
'spam_attempts' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 6,
|
||||
|
@ -74,8 +74,10 @@ class Spamadmin extends CI_Controller
|
||||
|
||||
function blocked_ips()
|
||||
{
|
||||
$this->load->model('pastes');
|
||||
$data = $this->pastes->getSpamLists();
|
||||
$this->load->view('list_ips', $data);
|
||||
$this->db->select('ip_address');
|
||||
$this->db->order_by('blocked_at');
|
||||
$query = $this->db->get('blocked_ips');
|
||||
$data['blocked_ips'] = $query->result_array();
|
||||
$this->load->view('list_blocked_ips', $data);
|
||||
}
|
||||
}
|
||||
|
42
htdocs/application/views/list_blocked_ips.php
Executable file
42
htdocs/application/views/list_blocked_ips.php
Executable file
@ -0,0 +1,42 @@
|
||||
<?php $this->load->view('defaults/header');?>
|
||||
<h1><a href="<?php echo site_url('spamadmin'); ?>">Spamadmin</a> - blocked IPs</h1>
|
||||
|
||||
<?php
|
||||
function checkNum($num){
|
||||
return ($num%2) ? TRUE : FALSE;
|
||||
}
|
||||
$n = 0;
|
||||
if(!empty($blocked_ips)){ ?>
|
||||
<table class="recent">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="title">IP address</th>
|
||||
<th class="time">When</th>
|
||||
<th class="time">Spam attempts</th>
|
||||
<th class="name">Unblock IP</th>
|
||||
</tr>
|
||||
<?php foreach($blocked_ips as $ip){
|
||||
if(checkNum($n) == TRUE) {
|
||||
$eo = "even";
|
||||
} else {
|
||||
$eo = "odd";
|
||||
}
|
||||
$n++;
|
||||
?>
|
||||
|
||||
<tr class="<?php echo $eo; ?>">
|
||||
<td class="first"><?php echo $ip['ip_address']; ?></td>
|
||||
<td><?php $p = explode(",", timespan($ip['blocked_at'], time())); echo $p[0]; ?> ago.</td>
|
||||
<td><?php echo '43'; ?></td>
|
||||
<td><a href="<?php echo site_url('spamadmin/blocked_ips/unblock/' . $ip['ip_address']) ?>">Unblock</a></td>
|
||||
</tr>
|
||||
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } else { ?>
|
||||
<p>There have been no pastes :(</p>
|
||||
<?php }?>
|
||||
<?php echo $pages; ?>
|
||||
<div class="spacer"></div>
|
||||
<?php $this->load->view('defaults/footer');?>
|
Loading…
x
Reference in New Issue
Block a user