diff options
author | Freya Murphy <freya@freyacat.org> | 2024-12-23 11:13:27 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-12-23 11:13:27 -0500 |
commit | 5a2ba9c2e7605bb788bc406184547d22c6436867 (patch) | |
tree | cbd988d534e8a8593a31d70571222443f80da0b3 /src/web/_controller/apps/auth.php | |
parent | fix about modal (diff) | |
download | xssbook2-5a2ba9c2e7605bb788bc406184547d22c6436867.tar.gz xssbook2-5a2ba9c2e7605bb788bc406184547d22c6436867.tar.bz2 xssbook2-5a2ba9c2e7605bb788bc406184547d22c6436867.zip |
v2.1.0, refactor w/ crimson
Diffstat (limited to '')
-rw-r--r-- | src/web/_controller/apps/auth.php | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/web/_controller/apps/auth.php b/src/web/_controller/apps/auth.php deleted file mode 100644 index 1df74da..0000000 --- a/src/web/_controller/apps/auth.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php /* Copyright (c) 2024 Freya Murphy */ -class Auth_controller extends Controller { - - // the home model - private $auth_model; - - // the post controller - protected $post_controller; - - function __construct($load) { - parent::__construct($load); - $this->auth_model = $this->load->model('apps/auth'); - } - - public function index(): void { - if ($this->main->session) { - $this->redirect('/home'); - } else { - $this->redirect('/auth/login'); - } - } - - public function login(): void { - if ($this->main->session) { - $this->redirect('/home'); - } - - parent::index(); - $data = $this->auth_model->get_data(); - $this->view('head', $data); - $this->view('apps/auth/login', $data); - $this->view('footer', $data); - } - - public function logout(): void { - if ($this->main->session) { - $_SESSION['jwt'] = NULL; - } - $this->redirect('/auth/login'); - } - - public function update(): void { - if (!$this->is_ajax()) { - $this->error(400); - } - if (!isset($_POST['key']) || !isset($_POST['value'])) { - $this->error(400); - } - $key = $_POST['key']; - $value = $_POST['value']; - $_SESSION[$key] = $value; - } - -} - -?> |