diff --git a/BaseController.php b/BaseController.php new file mode 100644 index 0000000..99f0bdc --- /dev/null +++ b/BaseController.php @@ -0,0 +1,53 @@ +session = \Config\Services::session(); + $this->validation = \Config\Services::validation(); + } +} diff --git a/Login.php b/Login.php new file mode 100644 index 0000000..29a23ab --- /dev/null +++ b/Login.php @@ -0,0 +1,37 @@ +MitgliederModel = new MitgliederModel(); + } + + public function index() + { + helper('form'); + + + if (isset($_POST['username']) and isset($_POST['password']) and $this->validation->run($_POST, 'login') === true) { + $known_login = $this->MitgliederModel->login(); + + if (($known_login != NULL) && (password_verify($_POST['password'], $known_login['password']))) { + session()->set('logged_in', true); + session()->set('username', $_POST['username']); + return redirect()->to(base_url('/Projekte')); + } + } else { + $data['error'] = $this->validation->getErrors(); + } + + echo view('templates/header'); + echo view('login', $data); + echo view('templates/footer'); + } +} diff --git a/Mitglieder.php b/Mitglieder.php new file mode 100644 index 0000000..1af6787 --- /dev/null +++ b/Mitglieder.php @@ -0,0 +1,131 @@ +
Noch nicht registriert? Registrierung
+