[Dashboard] Removed extra login session check and migration check as its called by auto load

Removed extra login session check and migration check as its called by auto load this speeds up page load time and reduces SQL queries down to  44 for the page which is still too many
pull/1407/head
Peter Goodhall 2022-02-16 22:27:44 +00:00
rodzic 88e90d7e50
commit 91548afea7
1 zmienionych plików z 1 dodań i 15 usunięć

Wyświetl plik

@ -8,11 +8,7 @@ class Dashboard extends CI_Controller {
if(ENVIRONMENT == 'development') {
$this->output->enable_profiler(TRUE);
}
// Check our version and run any migrations
$this->load->library('Migration');
$this->migration->current();
// Database connections
$this->load->model('logbook_model');
$this->load->model('user_model');
@ -23,16 +19,6 @@ class Dashboard extends CI_Controller {
// user is not logged in
redirect('user/login');
}
if(!$this->user_model->authorize($this->config->item('auth_mode'))) {
if($this->user_model->validate_session()) {
$this->user_model->clear_session();
show_error('Access denied<p>Click <a href="'.site_url('user/login').'">here</a> to log in as another user', 403);
} else {
redirect('user/login');
}
}
// Calculate Lat/Lng from Locator to use on Maps
if($this->session->userdata('user_locator')) {