diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 01:55:12 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 01:55:12 +0300 |
| commit | 6e749800d8a9f6b77bf50be92a70b7916c2804f3 (patch) | |
| tree | 3d6ba2eb67fa11f228b756e0f84ef8ecb3f6ff34 /public/app/controllers | |
| parent | 546daa78721e6abdbc89afcecc158118c2239865 (diff) | |
| download | classroom-6e749800d8a9f6b77bf50be92a70b7916c2804f3.tar.gz classroom-6e749800d8a9f6b77bf50be92a70b7916c2804f3.tar.bz2 classroom-6e749800d8a9f6b77bf50be92a70b7916c2804f3.zip | |
hotfixes and optimizations
Diffstat (limited to 'public/app/controllers')
| -rw-r--r-- | public/app/controllers/Auth.php | 1 | ||||
| -rw-r--r-- | public/app/controllers/admin/Course_admin.php | 6 | ||||
| -rw-r--r-- | public/app/controllers/cms/Course.php | 8 |
3 files changed, 15 insertions, 0 deletions
diff --git a/public/app/controllers/Auth.php b/public/app/controllers/Auth.php index 32ff07a..4a6b9ed 100644 --- a/public/app/controllers/Auth.php +++ b/public/app/controllers/Auth.php @@ -227,6 +227,7 @@ class Auth { unset($_COOKIE['cluser']); setcookie('cluser', '', -1, '/'); return true; + } else { return false; } diff --git a/public/app/controllers/admin/Course_admin.php b/public/app/controllers/admin/Course_admin.php index f68ead2..fcf38c9 100644 --- a/public/app/controllers/admin/Course_admin.php +++ b/public/app/controllers/admin/Course_admin.php @@ -174,6 +174,9 @@ class Course_admin { // set lesson's media files; NOTE: lesson_media table // ERROR: self::create_medias_for_lesson($post['media'], $id, $post['privilege_id']); self::create_medias_for_lesson($post['media'], $id); + + // recache media + Cache_service::files_attributes(PROXY_IGNORE_CACHE); } return true; @@ -229,6 +232,9 @@ class Course_admin { // update lesson's media files // ERROR: self::create_medias_for_lesson($post['media'], $post['id'], $post['privilege_id']); self::create_medias_for_lesson($post['media'], $post['id']); + + // recache media + Cache_service::files_attributes(PROXY_IGNORE_CACHE); } return true; diff --git a/public/app/controllers/cms/Course.php b/public/app/controllers/cms/Course.php index c795ab9..47eac5f 100644 --- a/public/app/controllers/cms/Course.php +++ b/public/app/controllers/cms/Course.php @@ -68,6 +68,12 @@ class Course { Render::file($real_path, $media_type); } + } else { + Render::view('error/404', [ + 'error_code' => 403, + 'moto' => 'Forbidden', + 'message' => '' + ]); } } @@ -85,7 +91,9 @@ class Course { $medias = Cache_service::files_attributes(); foreach($medias as $key => $medi) { + if ($medi['path'] == $path) { + return $medi; } } |
