diff options
Diffstat (limited to '')
| -rw-r--r-- | src/web/_model/apps/auth.php | 13 | ||||
| -rw-r--r-- | src/web/_model/apps/error.php (renamed from web/_model/apps/error.php) | 16 | ||||
| -rw-r--r-- | src/web/_model/apps/home.php (renamed from web/_model/apps/home.php) | 0 | ||||
| -rw-r--r-- | src/web/_model/cache.php (renamed from web/_model/cache.php) | 0 | ||||
| -rw-r--r-- | src/web/_model/format.php (renamed from web/_model/format.php) | 0 | ||||
| -rw-r--r-- | src/web/_model/main.php (renamed from web/_model/main.php) | 2 | ||||
| -rw-r--r-- | src/web/_model/request.php (renamed from web/_model/request.php) | 0 |
7 files changed, 20 insertions, 11 deletions
diff --git a/src/web/_model/apps/auth.php b/src/web/_model/apps/auth.php new file mode 100644 index 0000000..a1802de --- /dev/null +++ b/src/web/_model/apps/auth.php @@ -0,0 +1,13 @@ +<?php /* Copyright (c) 2024 Freya Murphy */ +class Auth_model extends Model { + + function __construct($load) { + parent::__construct($load); + } + + public function get_data(): array { + $data = parent::get_data(); + $data['title'] = lang('login'); + return $data; + } +} diff --git a/web/_model/apps/error.php b/src/web/_model/apps/error.php index ad72b28..58e3346 100644 --- a/web/_model/apps/error.php +++ b/src/web/_model/apps/error.php @@ -7,22 +7,18 @@ class Error_model extends Model { private function get_msg(&$data) { if (!array_key_exists('code', $_GET)) { + http_response_code(500); $data['msg'] = lang('error'); $data['title'] = '500'; } else { $code = $_GET['code']; + http_response_code($code); $data['title'] = $code; - switch ($code) { - case '404': - $data['msg'] = lang('error_404'); - break; - case '500': - $data['msg'] = lang('error_500'); - break; - default: - $data['msg'] = lang('error'); - break; + $msg = lang('error_' . $code, FALSE); + if (!$msg) { + $msg = lang('error'); } + $data['msg'] = $msg; } } diff --git a/web/_model/apps/home.php b/src/web/_model/apps/home.php index 82fbf26..82fbf26 100644 --- a/web/_model/apps/home.php +++ b/src/web/_model/apps/home.php diff --git a/web/_model/cache.php b/src/web/_model/cache.php index 6cf9924..6cf9924 100644 --- a/web/_model/cache.php +++ b/src/web/_model/cache.php diff --git a/web/_model/format.php b/src/web/_model/format.php index 52b51be..52b51be 100644 --- a/web/_model/format.php +++ b/src/web/_model/format.php diff --git a/web/_model/main.php b/src/web/_model/main.php index ab964fd..6d8b708 100644 --- a/web/_model/main.php +++ b/src/web/_model/main.php @@ -53,7 +53,7 @@ class Main_model { */ private function asset_stamp($path): int { $root = $GLOBALS['webroot']; - $path = $root . '/public/' . $path; + $path = $root . '/../public/' . $path; return filemtime($path); } diff --git a/web/_model/request.php b/src/web/_model/request.php index 4cce07a..4cce07a 100644 --- a/web/_model/request.php +++ b/src/web/_model/request.php |