mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
ip_address instead of session_id
This commit is contained in:
parent
0116204a40
commit
0523752675
@ -121,9 +121,9 @@ class Main extends CI_Controller
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 8,
|
||||
) ,
|
||||
'session_id' => array(
|
||||
'ip_address' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 40,
|
||||
'constraint' => 16,
|
||||
'null' => TRUE,
|
||||
) ,
|
||||
);
|
||||
@ -133,7 +133,7 @@ class Main extends CI_Controller
|
||||
$this->dbforge->add_key('private');
|
||||
$this->dbforge->add_key('replyto');
|
||||
$this->dbforge->add_key('created');
|
||||
$this->dbforge->add_key('session_id');
|
||||
$this->dbforge->add_key('ip_address');
|
||||
$this->dbforge->create_table('pastes', true);
|
||||
}
|
||||
|
||||
@ -154,12 +154,13 @@ class Main extends CI_Controller
|
||||
|
||||
//check if field session_id exists
|
||||
|
||||
if (!$this->db->field_exists('session_id', 'pastes'))
|
||||
if (!$this->db->field_exists('ip_address', 'pastes'))
|
||||
{
|
||||
$this->load->dbforge();
|
||||
$fields = array(
|
||||
'session_id' => array(
|
||||
'ip_address' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 40,
|
||||
'constraint' => 16,
|
||||
'null' => TRUE,
|
||||
) ,
|
||||
);
|
||||
|
@ -154,7 +154,7 @@ class Pastes extends CI_Model
|
||||
$data['snipurl'] = false;
|
||||
}
|
||||
}
|
||||
$data['session_id'] = $this->input->cookie('ci_session');
|
||||
$data['ip_address'] = $this->input->ip_address();
|
||||
$this->db->insert('pastes', $data);
|
||||
return 'view/' . $data['pid'];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user