cfmgrv4/app/Controllers/Admin/Cloudflare/AuthController.php
2025-03-13 15:55:12 +09:00

47 lines
1.5 KiB
PHP

<?php
namespace App\Controllers\Admin\Cloudflare;
use App\Helpers\Cloudflare\AuthHelper;
use App\Services\Cloudflare\AuthService;
use App\Services\MyLogService;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class AuthController extends CloudflareController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = new AuthHelper();
}
protected function getService(): AuthService
{
if ($this->service === null) {
$this->service = new AuthService();
$this->class_name = $this->service->getClassName();
$this->class_path = $this->service->getClassPath();
}
return $this->service;
}
//생성
protected function create_init(string $action, $fields = []): void
{
$fields = [
'fields' => [$this->getService()->getModel()::TITLE, 'authkey', 'status'],
];
parent::create_init($action, fields: $fields);
}
//수정
protected function modify_init(string $action, $fields = []): void
{
$fields = [
'fields' => [$this->getService()->getModel()::TITLE, 'authkey', 'status'],
];
parent::modify_init($action, $fields);
}
}