diff --git a/application/config/migration.php b/application/config/migration.php index da99decf..7ccd0b37 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 101; +$config['migration_version'] = 102; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Welcome.php b/application/controllers/Welcome.php index 0e0be63e..4f434086 100644 --- a/application/controllers/Welcome.php +++ b/application/controllers/Welcome.php @@ -11,28 +11,33 @@ class Welcome extends CI_Controller { public function index() { - $data['page_title'] = "Welcome to Cloudlog Version 2.0"; - // load stations model - $this->load->model('stations'); - $data['CountAllStationLocations'] = $this->stations->CountAllStationLocations(); + if($this->config->item('option_version2_trigger') == "false") { + $data['page_title'] = "Welcome to Cloudlog Version 2.0"; - // load logbooks model - $this->load->model('logbooks_model'); - $data['NumberOfStationLogbooks'] = $this->logbooks_model->CountAllStationLogbooks(); - - // load api model - $this->load->model('api_model'); - $data['NumberOfAPIKeys'] = $this->api_model->CountKeysWithNoUserID(); - - // load note model - $this->load->model('note'); - $data['NumberOfNotes'] = $this->note->CountAllNotes(); - - // load views - $this->load->view('interface_assets/mini_header', $data); - $this->load->view('welcome/index'); - $this->load->view('interface_assets/footer'); + // load stations model + $this->load->model('stations'); + $data['CountAllStationLocations'] = $this->stations->CountAllStationLocations(); + + // load logbooks model + $this->load->model('logbooks_model'); + $data['NumberOfStationLogbooks'] = $this->logbooks_model->CountAllStationLogbooks(); + + // load api model + $this->load->model('api_model'); + $data['NumberOfAPIKeys'] = $this->api_model->CountKeysWithNoUserID(); + + // load note model + $this->load->model('note'); + $data['NumberOfNotes'] = $this->note->CountAllNotes(); + + // load views + $this->load->view('interface_assets/mini_header', $data); + $this->load->view('welcome/index'); + $this->load->view('interface_assets/footer'); + } else { + redirect('login'); + } } public function locationsclaim() { diff --git a/application/migrations/102_add_version_two_trigger_to_options.php b/application/migrations/102_add_version_two_trigger_to_options.php new file mode 100644 index 00000000..3b5307d9 --- /dev/null +++ b/application/migrations/102_add_version_two_trigger_to_options.php @@ -0,0 +1,25 @@ + "version2_trigger", 'option_value' => "false", 'autoload' => "yes"), + ); + + $this->db->insert_batch('options', $data); + } + + public function down() + { + // No option to down + } +} \ No newline at end of file diff --git a/application/views/welcome/index.php b/application/views/welcome/index.php index 72a5de18..f6b78040 100644 --- a/application/views/welcome/index.php +++ b/application/views/welcome/index.php @@ -1,3 +1,6 @@ +config->item('option_version2_trigger'); +?>

@@ -149,4 +152,9 @@

+ + + +

+ \ No newline at end of file