cfmgrv4 init...1

This commit is contained in:
최준흠 2024-09-27 19:44:50 +09:00
parent e7e8b0f2f9
commit bc83fa1fc0
4 changed files with 13 additions and 19 deletions

View File

@ -43,7 +43,7 @@ class RecordController extends CloudflareController
$this->getZoneModel()->where('status', DEFAULTS['STATUS']);
$options[$field] = [
DEFAULTS['EMPTY'] => lang($this->class_path . '.label.' . $field) . ' 선택',
$this->getZoneModel()->getFormFieldOption($field, $options),
...$this->getZoneModel()->getFormFieldOption($field, $options),
];
break;
default:

View File

@ -44,8 +44,10 @@ class ZoneController extends CloudflareController
$this->getAccountModel()->where('status', DEFAULTS['STATUS']);
$options[$field] = [
DEFAULTS['EMPTY'] => lang($this->class_path . '.label.' . $field) . ' 선택',
$this->getAccountModel()->getFormFieldOption($field, $options),
...$this->getAccountModel()->getFormFieldOption($field, $options),
];
// echo $this->getAccountModel()->getLastQuery();
// dd($options);
break;
default:
$options = parent::getFormFieldOption($field, $options);

View File

@ -15,7 +15,7 @@ class AuthController extends CommonController
'title' => '로그인',
'forms' => [
'attributes' => ['action' => 'post', 'class' => 'row g-3'],
'hiddens' => [RETURN_URL => session()->get(RETURN_URL)],
'hiddens' => [SESSION_NAMES['RETURN_URL'] => session()->get(SESSION_NAMES['RETURN_URL'])],
]
];
return view('auth/login', $viewDatas);
@ -38,10 +38,10 @@ class AuthController extends CommonController
'name' => $user->name,
'email' => $user->email,
'role' => $user->role,
ISLOGIN => true
SESSION_NAMES['ISLOGIN'] => true
];
session()->set($authData);
return redirect()->to($this->request->getVar(RETURN_URL) ? $this->request->getVar(RETURN_URL) : "/");
return redirect()->to($this->request->getVar(SESSION_NAMES['RETURN_URL']) ? $this->request->getVar(SESSION_NAMES['RETURN_URL']) : "/");
} else {
session()->setFlashdata('error', '암호가 맞지 않습니다.');
return redirect()->back()->withInput();
@ -51,7 +51,7 @@ class AuthController extends CommonController
public function logout()
{
//Session에 Login 정보 삭제
session()->set([ISLOGIN => false]);
session()->set([SESSION_NAMES['ISLOGIN'] => false]);
session_destroy();
return redirect()->route('/');
}

View File

@ -56,7 +56,7 @@ abstract class MVController extends CommonController
}
return $formDatas;
}
private function validateFormDatas(array $fields): void
final protected function validateFormDatas(array $fields): void
{
//변경할 값 확인 : Upload된 파일 검증시 $this->request->getVar()보다 먼처 체크필요
$this->validation = service('validation');
@ -73,9 +73,7 @@ abstract class MVController extends CommonController
{
$this->validateFormDatas($this->fields);
}
protected function create_form_process(): void
{
}
protected function create_form_process(): void {}
final protected function create_form_procedure(): RedirectResponse|string
{
try {
@ -92,9 +90,7 @@ abstract class MVController extends CommonController
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with(SESSION_NAMES['RETURN_MSG'], $e->getMessage());
}
}
protected function create_process(): void
{
}
protected function create_process(): void {}
final protected function create_procedure(): RedirectResponse
{
try {
@ -116,9 +112,7 @@ abstract class MVController extends CommonController
{
$this->validateFormDatas($this->fields);
}
protected function modify_form_process(): void
{
}
protected function modify_form_process(): void {}
final protected function modify_form_procedure(): RedirectResponse|string
{
try {
@ -135,9 +129,7 @@ abstract class MVController extends CommonController
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with(SESSION_NAMES['RETURN_MSG'], $e->getMessage());
}
}
protected function modify_process(): void
{
}
protected function modify_process(): void {}
final protected function modify_procedure(): RedirectResponse
{
try {