cfmgrv4 init...4
This commit is contained in:
parent
dae5a78127
commit
910693e82d
@ -83,7 +83,7 @@ class UserController extends MVController
|
|||||||
if (!$access_code) {
|
if (!$access_code) {
|
||||||
throw new \Exception("구글 로그인 실패");
|
throw new \Exception("구글 로그인 실패");
|
||||||
}
|
}
|
||||||
$auth = new GoogleService();
|
$auth = new GoogleService(new GoogleSocket());
|
||||||
$auth->login($auth->checkUser($access_code));
|
$auth->login($auth->checkUser($access_code));
|
||||||
$this->message = "로그인 성공";
|
$this->message = "로그인 성공";
|
||||||
log_message("notice", __FUNCTION__ . $this->message);
|
log_message("notice", __FUNCTION__ . $this->message);
|
||||||
|
|||||||
@ -4,23 +4,22 @@ namespace App\Services\Auth;
|
|||||||
|
|
||||||
use App\Entities\UserEntity;
|
use App\Entities\UserEntity;
|
||||||
// use App\Libraries\MySocket\GoogleSocket\CURL;
|
// use App\Libraries\MySocket\GoogleSocket\CURL;
|
||||||
use App\Libraries\MySocket\GoogleSocket\API as GoogleSocket;
|
|
||||||
use App\Models\UserModel;
|
|
||||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||||
|
|
||||||
class GoogleService extends AuthService
|
class GoogleService extends AuthService
|
||||||
{
|
{
|
||||||
private ?UserModel $_model = null;
|
private $_mysocket = null;
|
||||||
private string $_access_code = "";
|
private string $_access_code = "";
|
||||||
public function __construct()
|
public function __construct(mixed $mySocket)
|
||||||
{
|
{
|
||||||
|
$this->_mysocket = $mySocket;
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMySocket(): GoogleSocket
|
public function getMySocket(string $access_code): mixed
|
||||||
{
|
{
|
||||||
if ($this->_mySocket === null) {
|
if ($this->_mySocket === null) {
|
||||||
$this->_mySocket = new GoogleSocket();
|
throw new \Exception("Socket 방식이 지정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
$this->_mySocket->setToken($this->_access_code);
|
$this->_mySocket->setToken($this->_access_code);
|
||||||
return $this->_mySocket;
|
return $this->_mySocket;
|
||||||
@ -28,9 +27,8 @@ class GoogleService extends AuthService
|
|||||||
public function checkUser(string $access_code): UserEntity
|
public function checkUser(string $access_code): UserEntity
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->_access_code = $access_code;
|
|
||||||
// Google 서비스 설정
|
// Google 서비스 설정
|
||||||
$userSNS_entity = $this->getMySocket()->getUserSNSEntity();
|
$userSNS_entity = $this->getMySocket($access_code)->getUserSNSEntity();
|
||||||
//local db 사용와의 연결 확인
|
//local db 사용와의 연결 확인
|
||||||
$user_entity = $this->getModel()->getEntityByPK($userSNS_entity->getParent());
|
$user_entity = $this->getModel()->getEntityByPK($userSNS_entity->getParent());
|
||||||
if ($user_entity === null) {
|
if ($user_entity === null) {
|
||||||
|
|||||||
@ -3,11 +3,9 @@
|
|||||||
namespace App\Services\Auth;
|
namespace App\Services\Auth;
|
||||||
|
|
||||||
use App\Entities\UserEntity;
|
use App\Entities\UserEntity;
|
||||||
use App\Models\UserModel;
|
|
||||||
|
|
||||||
class LocalService extends AuthService
|
class LocalService extends AuthService
|
||||||
{
|
{
|
||||||
private $_model = null;
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@ -3,11 +3,9 @@
|
|||||||
namespace App\Services\Cloudflare;
|
namespace App\Services\Cloudflare;
|
||||||
|
|
||||||
use App\Entities\Cloudflare\AccountEntity;
|
use App\Entities\Cloudflare\AccountEntity;
|
||||||
use App\Entities\Cloudflare\AuditLogEntity;
|
|
||||||
use App\Models\Cloudflare\AccountModel;
|
use App\Models\Cloudflare\AccountModel;
|
||||||
use App\Models\Cloudflare\AuditLogModel;
|
use App\Models\Cloudflare\AuditLogModel;
|
||||||
use App\Models\Cloudflare\ZoneModel;
|
use App\Models\Cloudflare\ZoneModel;
|
||||||
use stdClass;
|
|
||||||
|
|
||||||
class AuditLogService extends CloudflareService
|
class AuditLogService extends CloudflareService
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user