mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 04:51:08 -05:00
fix duplicate error
This commit is contained in:
parent
370b3e3f1d
commit
a2f3ec8677
@ -45,13 +45,18 @@ class Spamadmin extends CI_Controller
|
|||||||
$this->db->where('ip_address', $ip_address);
|
$this->db->where('ip_address', $ip_address);
|
||||||
$this->db->delete('pastes');
|
$this->db->delete('pastes');
|
||||||
|
|
||||||
//todo: catch duplicate error
|
|
||||||
|
|
||||||
if ($this->input->post('block_ip'))
|
if ($this->input->post('block_ip'))
|
||||||
{
|
{
|
||||||
$this->db->insert('blocked_ips', array(
|
$query = $this->db->get_where('blocked_ips', array(
|
||||||
'ip_address' => $ip_address
|
'ip_address' => $ip_address
|
||||||
));
|
));
|
||||||
|
|
||||||
|
if ($query->num_rows() == 0)
|
||||||
|
{
|
||||||
|
$this->db->insert('blocked_ips', array(
|
||||||
|
'ip_address' => $ip_address
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user