diff --git a/application/controllers/Cis/Auth.php b/application/controllers/Cis/Auth.php new file mode 100644 index 000000000..e2308cab2 --- /dev/null +++ b/application/controllers/Cis/Auth.php @@ -0,0 +1,78 @@ +load->helper('form'); + $this->load->helper('hlp_authentication'); + + // Loads phrases system + $this->loadPhrases([ + 'global' + ]); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * @return void + */ + public function login() + { + $this->load->library('form_validation'); + + $this->form_validation->set_rules('username', 'Username', 'required|trim|callback_validation'); + $this->form_validation->set_rules('password', 'Password', 'required|trim'); + + + if ($this->form_validation->run()) + { + redirect($this->authlib->getLandingPage('/CisVue/Dashboard')); + } + else + { + $this->load->view('Cis/Login'); + } + } + + /** + * @return boolean + */ + public function validation() + { + $username = $this->input->post('username'); + $password = $this->input->post('password'); + + $this->load->library('AuthLib', [false]); // without authentication otherwise loooooop! + + $login = $this->authlib->loginLDAP($username, $password); + if (isSuccess($login)) + return true; + $this->form_validation->set_message('validation', 'Incorrect username/password.'); + return false; + } + + /** + * @return void + */ + public function logout() + { + $this->load->library('AuthLib'); + $this->authlib->logout(); + redirect('/Cis/Auth/login', 'refresh'); + } + +} diff --git a/application/controllers/components/CisVue.php b/application/controllers/components/CisVue.php index b1a33ff69..dc172db76 100644 --- a/application/controllers/components/CisVue.php +++ b/application/controllers/components/CisVue.php @@ -3,12 +3,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); /** - * This controller operates between (interface) the JS (GUI) and the FilterCmptLib (back-end) - * Provides data to the ajax get calls about the filter component - * Listens to ajax post calls to change the filter data - * This controller works with JSON calls on the HTTP GET or POST and the output is always JSON - * NOTE: extends the FHC_Controller instead of the Auth_Controller because the FilterCmpt has its - * own permissions check + * */ class CisVue extends Auth_Controller { diff --git a/application/views/Cis/Login.php b/application/views/Cis/Login.php new file mode 100644 index 000000000..68490e67e --- /dev/null +++ b/application/views/Cis/Login.php @@ -0,0 +1,42 @@ + 'FH-Complete', + 'bootstrap5' => true, + 'fontawesome6' => true + ); + + $this->load->view('templates/FHC-Header', $includesArray); +?> + +
+
+
+ +

+ +

+ +
+ + ', '
'); ?> + +
+ 'username', 'class' => 'form-control', 'placeholder' => 'Username', 'required' => true]); ?> +
+ +
+ 'password', 'class' => 'form-control', 'placeholder' => 'Password', 'required' => true]); ?> +
+ +
+ 'submit', 'class' => 'btn btn-primary'], 'Log in'); ?> +
+ +

Forgot Password?

+ +
+
+ + +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/application/views/templates/CISHMVC-Header.php b/application/views/templates/CISHMVC-Header.php index f9302d902..2acf5f414 100644 --- a/application/views/templates/CISHMVC-Header.php +++ b/application/views/templates/CISHMVC-Header.php @@ -20,7 +20,7 @@
  • Profil
  • Ampeln
  • -
  • Logout
  • +
  • Logout