44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers\Admin\Cloudflare;
|
|
|
|
use App\Helpers\Cloudflare\AuthHelper;
|
|
use App\Services\Cloudflare\AuthService;
|
|
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);
|
|
}
|
|
}
|