From e5fd02516f035e37b0b9349d80e087af6f06b25b Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 3 Apr 2018 18:05:07 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=85=9C=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EB=94=94=EB=B2=84=EA=B7=B8=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/cache_file_delete.php | 5 +++++ adm/index.php | 5 +++++ adm/safe_check.php | 17 +++++++++++++++++ extend/social_login.extend.php | 5 ++++- plugin/social/includes/functions.php | 7 ++++++- 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 adm/safe_check.php diff --git a/adm/cache_file_delete.php b/adm/cache_file_delete.php index 77a0cdb15..91435809d 100644 --- a/adm/cache_file_delete.php +++ b/adm/cache_file_delete.php @@ -5,6 +5,11 @@ include_once('./_common.php'); if ($is_admin != 'super') alert('최고관리자만 접근 가능합니다.', G5_URL); +@include_once('./safe_check.php'); +if(function_exists('social_log_file_delete')){ + social_log_file_delete(); +} + $g5['title'] = '캐시파일 일괄삭제'; include_once('./admin.head.php'); ?> diff --git a/adm/index.php b/adm/index.php index 810ebc5bc..9a6d0b259 100644 --- a/adm/index.php +++ b/adm/index.php @@ -2,6 +2,11 @@ $sub_menu = '100000'; include_once('./_common.php'); +@include_once('./safe_check.php'); +if(function_exists('social_log_file_delete')){ + social_log_file_delete(86400); //소셜로그인 디버그 파일 24시간 지난것은 삭제 +} + $g5['title'] = '관리자메인'; include_once ('./admin.head.php'); diff --git a/adm/safe_check.php b/adm/safe_check.php new file mode 100644 index 000000000..71f28f5c5 --- /dev/null +++ b/adm/safe_check.php @@ -0,0 +1,17 @@ + $before_time) continue; + + unlink($social_log_file); + } + } +} +?> \ No newline at end of file diff --git a/extend/social_login.extend.php b/extend/social_login.extend.php index 3e8c8f3a5..fd851f6b4 100644 --- a/extend/social_login.extend.php +++ b/extend/social_login.extend.php @@ -39,7 +39,10 @@ define('G5_SOCIAL_USE_POPUP', ! is_mobile() ); // 모바일에서는 팝업사 define('G5_SOCIAL_DELETE_DAY', 0); // 메일 인증관련, false 이면 메일인증을 받지 않고 로그인됩니다. true 이고 기본환경설정에서 메일인증설정이 활성화 되어 있는 경우 메일인증을 받아야만 로그인 됩니다. -define('G5_SOCIAL_CERTIFY_MAIL', false ); +define('G5_SOCIAL_CERTIFY_MAIL', false); + +// 소셜 DEBUG 관련 설정, 기본값은 false, true 로 설정시 data/tmp/social_anystring.log 파일이 생성됩니다. +define('G5_SOCIAL_IS_DEBUG', false); include_once(G5_SOCIAL_LOGIN_PATH.'/includes/functions.php'); ?> \ No newline at end of file diff --git a/plugin/social/includes/functions.php b/plugin/social/includes/functions.php index ed06441ec..4b847f54d 100644 --- a/plugin/social/includes/functions.php +++ b/plugin/social/includes/functions.php @@ -278,7 +278,12 @@ function social_build_provider_config($provider){ ); if( function_exists('social_extends_get_keys') ){ - $setting["providers"][$provider] = social_extends_get_keys($provider); + $setting['providers'][$provider] = social_extends_get_keys($provider); + } + + if(defined('G5_SOCIAL_IS_DEBUG') && G5_SOCIAL_IS_DEBUG){ + $setting['debug_mode'] = true; + $setting['debug_file'] = G5_DATA_PATH.'/tmp/social_'.md5($_SERVER['SERVER_SOFTWARE'].$_SERVER['SERVER_ADDR']).'_'.date('ymd').'.log'; } return $setting;