This commit is contained in:
Claude 2012-06-14 08:47:27 +02:00
parent b6288679dc
commit ae00c1a480
2 changed files with 12 additions and 27 deletions

View File

@ -120,6 +120,11 @@ class Main extends CI_Controller
'type' => 'VARCHAR',
'constraint' => 8,
) ,
'session_id' => array(
'type' => 'VARCHAR',
'constraint' => 40,
'null' => TRUE,
) ,
);
$this->dbforge->add_field($fields);
$this->dbforge->add_key('id', true);
@ -127,8 +132,14 @@ 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->create_table('pastes', true);
}
//check if field session_id exists
//todo
}
function _form_prep($lang = false, $title = '', $paste = '', $reply = false)

View File

@ -6,7 +6,7 @@
* - index()
* - lists()
* Classes list:
* - Main extends CI_Controller
* - Spamadmin extends CI_Controller
*/
class Spamadmin extends CI_Controller
@ -15,32 +15,6 @@ class Spamadmin extends CI_Controller
function __construct()
{
parent::__construct();
$this->load->model('languages');
if (!$this->db->table_exists('pid_ip'))
{
$this->load->dbforge();
$fields = array(
'id' => array(
'type' => 'INT',
'constraint' => 10,
'auto_increment' => TRUE,
) ,
'pid' => array(
'type' => 'VARCHAR',
'constraint' => 8,
) ,
'ip' => array(
'type' => 'VARCHAR',
'constraint' => 15,
) ,
);
$this->dbforge->add_field($fields);
$this->dbforge->add_key('id', true);
$this->dbforge->add_key('pid');
$this->dbforge->add_key('ip');
$this->dbforge->create_table('pid_ip', true);
}
}
function index()