mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
kill session on page reload if maintenance is enabled
This commit is contained in:
@@ -397,13 +397,29 @@ class User_Model extends CI_Model {
|
||||
$user_type = $this->session->userdata('user_type');
|
||||
$user_hash = $this->session->userdata('user_hash');
|
||||
|
||||
if($this->_auth($user_id."-".$user_type, $user_hash)) {
|
||||
// Freshen the session
|
||||
$this->update_session($user_id);
|
||||
return 1;
|
||||
} else {
|
||||
$this->clear_session();
|
||||
return 0;
|
||||
if(ENVIRONMENT != 'maintenance') {
|
||||
if($this->_auth($user_id."-".$user_type, $user_hash)) {
|
||||
// Freshen the session
|
||||
$this->update_session($user_id);
|
||||
return 1;
|
||||
} else {
|
||||
$this->clear_session();
|
||||
return 0;
|
||||
}
|
||||
} else { // handle the maintenance mode and kick out user on page reload if not an admin
|
||||
if($user_type == '99') {
|
||||
if($this->_auth($user_id."-".$user_type, $user_hash)) {
|
||||
// Freshen the session
|
||||
$this->update_session($user_id);
|
||||
return 1;
|
||||
} else {
|
||||
$this->clear_session();
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->clear_session();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user