cfmgrv3 init...2

This commit is contained in:
최준흠git config git config --helpgit config --global user.name 최준흠 2023-06-19 22:47:55 +09:00
parent fc94b9eab2
commit 27696ac2bb
3 changed files with 17 additions and 0 deletions

View File

@ -6,6 +6,7 @@ use App\Models\Cloudflare\API\AccountModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Libraries\Log\Log;
class AccountController extends APIController
{
@ -59,8 +60,13 @@ class AccountController extends APIController
$entity = $this->_model->getEntity($uid);
$zoneApi = new \App\Libraries\Cloudflare\API\Zone($entity, false);
$zoneApi->reload();
$message = __FUNCTION__ . " 완료하였습니다.";
Log::save("{$this->_viewDatas['title']} {$message}");
return alert_CommonHelper("{$this->_viewDatas['title']} " . __FUNCTION__ . " 완료하였습니다.", session()->get(RETURN_URL));
} catch (\Exception $e) {
$message = "{$entity->getTitle()} " . __FUNCTION__ . " 실패하였습니다.";
Log::add("warning", $e->getMessage());
Log::save("{$this->_viewDatas['title']} {$message}", false);
return alert_CommonHelper($e->getMessage(), 'back');
}
}

View File

@ -6,6 +6,7 @@ use App\Models\Cloudflare\API\AuthModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Libraries\Log\Log;
class AuthController extends APIController
{
@ -91,8 +92,13 @@ class AuthController extends APIController
$entity = $this->_model->getEntity($uid);
$accountApi = new \App\Libraries\Cloudflare\API\Account($entity);
$accountApi->reload();
$message = __FUNCTION__ . " 완료하였습니다.";
Log::save("{$this->_viewDatas['title']} {$message}");
return alert_CommonHelper("{$this->_viewDatas['title']} " . __FUNCTION__ . " 완료하였습니다.", session()->get(RETURN_URL));
} catch (\Exception $e) {
$message = "{$entity->getTitle()} " . __FUNCTION__ . " 실패하였습니다.";
Log::add("warning", $e->getMessage());
Log::save("{$this->_viewDatas['title']} {$message}", false);
return alert_CommonHelper($e->getMessage(), 'back');
}
}

View File

@ -161,8 +161,13 @@ class ZoneController extends APIController
//Firewall Reload
// $firewallApi = new \App\Libraries\Cloudflare\API\Firewall($entity);
// $firewallApi->reload();
$message = __FUNCTION__ . " 완료하였습니다.";
Log::save("{$this->_viewDatas['title']} {$message}");
return alert_CommonHelper("{$this->_viewDatas['title']} " . __FUNCTION__ . " 완료하였습니다.", session()->get(RETURN_URL));
} catch (\Exception $e) {
$message = "{$entity->getTitle()} " . __FUNCTION__ . " 실패하였습니다.";
Log::add("warning", $e->getMessage());
Log::save("{$this->_viewDatas['title']} {$message}", false);
return alert_CommonHelper($e->getMessage(), 'back');
}
}