diff --git a/htdocs/application/controllers/main.php b/htdocs/application/controllers/main.php index d88c650..a70bdfe 100755 --- a/htdocs/application/controllers/main.php +++ b/htdocs/application/controllers/main.php @@ -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) diff --git a/htdocs/application/controllers/spamadmin.php b/htdocs/application/controllers/spamadmin.php index 755efa7..f46a3b3 100755 --- a/htdocs/application/controllers/spamadmin.php +++ b/htdocs/application/controllers/spamadmin.php @@ -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()