From eebf9d005b37b401b2d8cacc7f0c9b2bf9233c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Tue, 7 May 2024 13:42:33 +0900 Subject: [PATCH] vhost init...1 --- app/Controllers/Front/BoardController.php | 48 ++++------------------ app/Helpers/Board_helper.php | 2 +- app/Views/front/billing/card/update.php | 4 +- app/Views/front/billing/deposit/update.php | 4 +- app/Views/front/billing/index.php | 4 +- app/Views/front/billing/view.php | 4 +- app/Views/front/board/index.php | 12 +++--- app/Views/front/board/insert.php | 4 +- app/Views/front/board/reply.php | 4 +- app/Views/front/board/update.php | 4 +- app/Views/front/board/view.php | 4 +- app/Views/front/order/index.php | 4 +- app/Views/front/order/view.php | 4 +- app/Views/front/product/index.php | 4 +- app/Views/front/product/view.php | 4 +- app/Views/front/user/index.php | 4 +- app/Views/front/user/insert.php | 4 +- app/Views/front/user/update.php | 4 +- 18 files changed, 45 insertions(+), 77 deletions(-) diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index 1c19550..bcba7ef 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -18,8 +18,6 @@ class BoardController extends FrontController $this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title'); $this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])]; helper($this->_viewDatas['className']); - // echo var_export($this->_viewDatas['layout'], true); - // exit; } public function getFields(string $action = ""): array { @@ -46,28 +44,17 @@ class BoardController extends FrontController return parent::getFieldBatchFilters(); } - //권한체크 - protected function isRole($action) - { - $this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다."); - parent::isRole($action); - } - //Insert관련 protected function insert_form_process() { //권한체크 - $this->isRole('insert'); + $this->isRole('isaccess'); parent::insert_form_process(); - $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [ - 'category_uid' => $this->_category, - 'category' => $this->_category - ]]; } protected function insert_process() { //권한체크 - $this->isRole('insert'); + $this->isRole('iswrite'); return parent::insert_process(); } //Update관련 @@ -77,13 +64,7 @@ class BoardController extends FrontController if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->user_uid != $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) { throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다."); } - //권한체크 - $this->isRole('update'); - $entity = parent::update_form_process($entity); - $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [ - 'category' => $this->_category - ]]; - return $entity; + return parent::update_form_process($entity); } protected function update_process($entity) { @@ -97,13 +78,8 @@ class BoardController extends FrontController protected function reply_form_process($entity) { //권한체크 - $this->isRole('reply'); - $entity = parent::reply_form_process($entity); - $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [ - 'category_uid' => $entity->category_uid, - 'category' => $this->_category - ]]; - return $entity; + $this->isRole('isreply'); + return parent::reply_form_process($entity); } //Delete 관련 protected function delete_process($entity) @@ -121,11 +97,7 @@ class BoardController extends FrontController $this->isRole('view'); //조회수 올리기 $entity = $this->_model->addViewCount($entity); - $entity = parent::view_process($entity); - $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [ - 'category' => $this->_category - ]]; - return $entity; + return parent::view_process($entity); } //Index관련 protected function index_process() @@ -133,14 +105,11 @@ class BoardController extends FrontController //권한체크 $this->isRole('index'); parent::index_process(); - $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [ - 'category' => $this->_category - ]]; } //Category 및 Status 조건추가 protected function index_setCondition() { - $this->_model->where("category_uid", $this->_viewDatas['category']->getPrimaryKey()); + $this->_model->where("category_uid", $this->getCurrentCategory()->getPrimaryKey()); $this->_model->where("status", DEFAULTS['STATUS']); parent::index_setCondition(); } @@ -149,12 +118,11 @@ class BoardController extends FrontController { $entity = parent::download_process($field, $entity); //권한체크 - $this->isRole('download', $entity); + $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 c4625bc..21d1f5c 100644 --- a/app/Helpers/Board_helper.php +++ b/app/Helpers/Board_helper.php @@ -107,7 +107,7 @@ function getFieldIndex_Column_BoardHelper($field, array $viewDatas) $value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC"; $viewDatas['uri']->addQuery('order_field', $field); $viewDatas['uri']->addQuery('order_value', $value); - $columnData = anchor($viewDatas['uri'], $label); + $columnData = anchor((string)$viewDatas['uri'], $label); switch ($field) { case 'title': case 'name': diff --git a/app/Views/front/billing/card/update.php b/app/Views/front/billing/card/update.php index b88ab95..f3c02ff 100644 --- a/app/Views/front/billing/card/update.php +++ b/app/Views/front/billing/card/update.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -30,6 +30,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/billing/deposit/update.php b/app/Views/front/billing/deposit/update.php index 0c7fd65..0802109 100644 --- a/app/Views/front/billing/deposit/update.php +++ b/app/Views/front/billing/deposit/update.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -44,6 +44,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/billing/index.php b/app/Views/front/billing/index.php index b5ba845..1546f03 100644 --- a/app/Views/front/billing/index.php +++ b/app/Views/front/billing/index.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
include('templates/front/index_head') ?>
@@ -29,6 +29,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/billing/view.php b/app/Views/front/billing/view.php index 9041b6c..763ace0 100644 --- a/app/Views/front/billing/view.php +++ b/app/Views/front/billing/view.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -37,6 +37,6 @@
주문정보
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/board/index.php b/app/Views/front/board/index.php index 40dc696..711f5a7 100644 --- a/app/Views/front/board/index.php +++ b/app/Views/front/board/index.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
include('templates/front/index_head') ?>
@@ -20,7 +20,7 @@ @@ -41,12 +41,12 @@
user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?> - getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?> + getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?> @@ -31,7 +31,7 @@ user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?> - getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?> + getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
- - getPrimaryKey(), '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?> + + getPrimaryKey(), '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/board/insert.php b/app/Views/front/board/insert.php index 9b5d077..54367f0 100644 --- a/app/Views/front/board/insert.php +++ b/app/Views/front/board/insert.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -19,6 +19,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/board/reply.php b/app/Views/front/board/reply.php index ba39997..7c8e4af 100644 --- a/app/Views/front/board/reply.php +++ b/app/Views/front/board/reply.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -19,6 +19,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/board/update.php b/app/Views/front/board/update.php index 964ebe4..87409a7 100644 --- a/app/Views/front/board/update.php +++ b/app/Views/front/board/update.php @@ -2,7 +2,7 @@ section('content') ?>
> -
head) ?>
+
head) ?>
@@ -19,6 +19,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/board/view.php b/app/Views/front/board/view.php index af22457..58e2833 100644 --- a/app/Views/front/board/view.php +++ b/app/Views/front/board/view.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -16,6 +16,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/order/index.php b/app/Views/front/order/index.php index 7ee5e07..1955463 100644 --- a/app/Views/front/order/index.php +++ b/app/Views/front/order/index.php @@ -3,7 +3,7 @@
-
head) ?>
+
head) ?>
@@ -76,7 +76,7 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/order/view.php b/app/Views/front/order/view.php index cc92a5c..6dae013 100644 --- a/app/Views/front/order/view.php +++ b/app/Views/front/order/view.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -16,6 +16,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/product/index.php b/app/Views/front/product/index.php index 746c840..e7c178c 100644 --- a/app/Views/front/product/index.php +++ b/app/Views/front/product/index.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
include('templates/front/index_head_product') ?>
@@ -34,6 +34,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/product/view.php b/app/Views/front/product/view.php index ae54358..b74fa12 100644 --- a/app/Views/front/product/view.php +++ b/app/Views/front/product/view.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -70,6 +70,6 @@ 이제품은 현재[status) ?>]입니다. -
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/index.php b/app/Views/front/user/index.php index 2b83e63..66ba655 100644 --- a/app/Views/front/user/index.php +++ b/app/Views/front/user/index.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
include('templates/front/index_head') ?>
@@ -36,6 +36,6 @@ -
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/insert.php b/app/Views/front/user/insert.php index 947afee..a659e28 100644 --- a/app/Views/front/user/insert.php +++ b/app/Views/front/user/insert.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -19,6 +19,6 @@
-
tail) ?>
+
tail) ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/update.php b/app/Views/front/user/update.php index 38175fb..e133998 100644 --- a/app/Views/front/user/update.php +++ b/app/Views/front/user/update.php @@ -2,7 +2,7 @@ section('content') ?>
-
head) ?>
+
head) ?>
@@ -19,6 +19,6 @@
-
head) ?>
+
head) ?>
endSection() ?> \ No newline at end of file