[Auth] Changed Roles either Administrator or Operator

This is the first step in changes to the AUTH system it will have two roles

- Admin - who can access all the admin tools plus log qsos
- Operator - who can just access the main Cloudlog functions and their own logbooks and locations
pull/1281/head
Peter Goodhall 2021-11-08 15:28:16 +00:00
rodzic 3a36b38b82
commit 0ffe57dc63
3 zmienionych plików z 11 dodań i 19 usunięć

Wyświetl plik

@ -74,12 +74,9 @@ $config['hamqth_password'] = "";
$config['use_auth'] = true; $config['use_auth'] = true;
$config['auth_table'] = "users"; $config['auth_table'] = "users";
$config['auth_mode'] = "0"; $config['auth_mode'] = "3";
$config['auth_level'][0] = "Anonymous"; $config['auth_level'][3] = "Operator";
$config['auth_level'][1] = "Viewer";
$config['auth_level'][2] = "Editor";
$config['auth_level'][3] = "API User";
$config['auth_level'][99] = "Administrator"; $config['auth_level'][99] = "Administrator";
/* /*

Wyświetl plik

@ -17,15 +17,13 @@ class Logbook extends CI_Controller {
function index() function index()
{ {
$this->load->model('user_model');
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { // Check if users logged in
if($this->user_model->validate_session()) { $this->load->model('user_model');
$this->user_model->clear_session(); if($this->user_model->validate_session() == 0) {
show_error('Access denied<p>Click <a href="'.site_url('user/login').'">here</a> to log in as another user', 403); // user is not logged in
} else { redirect('user/login');
redirect('user/login'); }
}
}
$this->load->model('logbook_model'); $this->load->model('logbook_model');

Wyświetl plik

@ -74,12 +74,9 @@ $config['hamqth_password'] = "";
$config['use_auth'] = true; $config['use_auth'] = true;
$config['auth_table'] = "users"; $config['auth_table'] = "users";
$config['auth_mode'] = "0"; $config['auth_mode'] = "3";
$config['auth_level'][0] = "Anonymous"; $config['auth_level'][3] = "Operator";
$config['auth_level'][1] = "Viewer";
$config['auth_level'][2] = "Editor";
$config['auth_level'][3] = "API User";
$config['auth_level'][99] = "Administrator"; $config['auth_level'][99] = "Administrator";
/* /*