mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
migration
This commit is contained in:
parent
2f9a21383b
commit
8725ea8911
@ -173,6 +173,36 @@ class Main extends CI_Controller
|
||||
);
|
||||
$this->dbforge->add_column('pastes', $fields);
|
||||
}
|
||||
|
||||
//todo: remove that after migration
|
||||
|
||||
if (!$this->db->field_exists('blocked_at', 'blocked_ips'))
|
||||
{
|
||||
$this->load->dbforge();
|
||||
$fields = array(
|
||||
'blocked_at' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 10,
|
||||
) ,
|
||||
);
|
||||
$this->dbforge->add_column('blocked_ips', $fields);
|
||||
}
|
||||
|
||||
if (!$this->db->field_exists('spam_attempts', 'blocked_ips'))
|
||||
{
|
||||
$this->load->dbforge();
|
||||
$fields = array(
|
||||
'spam_attempts' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 6,
|
||||
'default' => 0,
|
||||
) ,
|
||||
);
|
||||
$this->dbforge->add_column('blocked_ips', $fields);
|
||||
}
|
||||
|
||||
//end todo
|
||||
|
||||
}
|
||||
|
||||
function _form_prep($lang = false, $title = '', $paste = '', $reply = false)
|
||||
|
@ -76,7 +76,7 @@ class Spamadmin extends CI_Controller
|
||||
function blacklist()
|
||||
{
|
||||
$this->db->select('ip_address, blocked_at, spam_attempts');
|
||||
$this->db->order_by('blocked_at', 'desc');
|
||||
$this->db->order_by('blocked_at desc, ip_address asc');
|
||||
$query = $this->db->get('blocked_ips');
|
||||
$data['blocked_ips'] = $query->result_array();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user