[Dashboard] Redirect to Login if user isn't logged in
这个提交包含在:
父节点
f0b97c148a
当前提交
3a36b38b82
共有 2 个文件被更改,包括 13 次插入 和 2 次删除
|
|
@ -4,13 +4,24 @@ class Dashboard extends CI_Controller {
|
|||
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
// 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');
|
||||
|
||||
// Check if users logged in
|
||||
|
||||
if($this->user_model->validate_session() == 0) {
|
||||
// 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();
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ class User extends CI_Controller {
|
|||
if ($this->form_validation->run() == FALSE)
|
||||
{
|
||||
$data['page_title'] = "Login";
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('interface_assets/mini_header', $data);
|
||||
$this->load->view('user/login');
|
||||
$this->load->view('interface_assets/footer');
|
||||
|
||||
|
|
|
|||
正在加载…
在新工单中引用