From 465ecac0071248002623b59a8d11da50c296fa82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Thu, 9 May 2024 16:38:35 +0900 Subject: [PATCH] vhost init...2 --- app/Controllers/Front/BoardController.php | 11 +++---- app/Helpers/Board_helper.php | 36 ++++++++++++++++------- app/Views/front/user/login.php | 2 +- app/Views/front/user/login_v1.php | 2 +- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index 84174e3..cfd2552 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -124,15 +124,12 @@ class BoardController extends FrontController parent::index_setCondition(); } //Download관련 - public function download_process($field, $entity): array + public function download_process($field, $entity) { - $entity = parent::download_process($field, $entity); + //Category 확인 + $this->setCategory($this->request->getVar('category')); //권한체크 $this->isRole('download'); - list($filename, $uploaded_filename) = explode(DEFAULTS['DELIMITER_FILE'], $entity->$field); - if (!is_file(PATHS['UPLOAD'] . "/" . $uploaded_filename)) { - throw new \Exception("파일이 확인되지 않습니다.\n" . PATHS['UPLOAD'] . "/" . $uploaded_filename); - } - return array($filename, $uploaded_filename); + return parent::download_process($field, $entity); } } diff --git a/app/Helpers/Board_helper.php b/app/Helpers/Board_helper.php index b8d6a91..13bd108 100644 --- a/app/Helpers/Board_helper.php +++ b/app/Helpers/Board_helper.php @@ -129,16 +129,30 @@ function getFieldIndex_Row_BoardHelper($field, $entity, array $viewDatas): strin for ($i = 1; $i < $entity->getHierarchy_Depth(); $i++) { $depth .= "    "; } - $reply = anchor( - current_url() . '/reply/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), - ICONS['REPLY'], - ["target" => "_self"] - ); - $view = anchor( - current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), - $value, - ["target" => "_self"] - ); + $reply = ""; + if (isRole_CommonHelper( + $viewDatas['currentRoles'], + $viewDatas['currentCategory'], + 'isreply' + )) { + $reply = anchor( + current_url() . '/reply/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category'], + ICONS['REPLY'], + ["target" => "_self"] + ); + } + $view = $value; + if (isRole_CommonHelper( + $viewDatas['currentRoles'], + $viewDatas['currentCategory'], + 'isread' + )) { + $view = anchor( + current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category'], + $value, + ["target" => "_self"] + ); + } return sprintf("%s%s %s", $depth, $reply, $view); break; case 'board_file': @@ -147,7 +161,7 @@ function getFieldIndex_Row_BoardHelper($field, $entity, array $viewDatas): strin base_url() . $viewDatas['control'] . "/board/download/{$field}/{$entity->getPrimaryKey()}" . - '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), + '?category=' . $viewDatas['category'], $field ); break; diff --git a/app/Views/front/user/login.php b/app/Views/front/user/login.php index f8cf366..1f01f65 100644 --- a/app/Views/front/user/login.php +++ b/app/Views/front/user/login.php @@ -1,4 +1,4 @@ -extend('layouts/front_simple') ?> +extend('layouts/main') ?> section('content') ?> diff --git a/app/Views/front/user/login_v1.php b/app/Views/front/user/login_v1.php index 68dd65d..0124bd9 100644 --- a/app/Views/front/user/login_v1.php +++ b/app/Views/front/user/login_v1.php @@ -1,4 +1,4 @@ -extend('layouts/front_simple') ?> +extend('layouts/main') ?> section('content') ?>