diff --git a/extend/social_login.extend.php b/extend/social_login.extend.php index 44a6a0154..0a21ec3c2 100644 --- a/extend/social_login.extend.php +++ b/extend/social_login.extend.php @@ -13,12 +13,12 @@ define('G5_SOCIAL_LOGIN_START_PARAM', 'hauth.start'); // 소셜로그인 login_done 파라미터 이름입니다. 기본값은 hauth.done define('G5_SOCIAL_LOGIN_DONE_PARAM', 'hauth.done'); -// 소셜로그인 G5_SOCIAL_LOGIN_URL 값의 끝에 해당 문자열을 더합니다. -define('G5_SOCIAL_LOGIN_ADD_URL', '/'); - define('G5_SOCIAL_LOGIN_PATH', G5_PLUGIN_PATH.'/'.G5_SOCIAL_LOGIN_DIR); define('G5_SOCIAL_LOGIN_URL', G5_PLUGIN_URL.'/'.G5_SOCIAL_LOGIN_DIR); +// 소셜로그인 SOCIAL_LOGIN_BASE_URL 기본값은 G5_SOCIAL_LOGIN_URL.'/' +define('SOCIAL_LOGIN_BASE_URL', G5_SOCIAL_LOGIN_URL.'/'); + if(G5_IS_MOBILE) { define('G5_SOCIAL_SKIN_PATH', G5_PATH.'/'.G5_MOBILE_DIR.'/'.G5_SKIN_DIR.'/'.G5_SOCIAL_LOGIN_DIR); define('G5_SOCIAL_SKIN_URL', G5_URL.'/'.G5_MOBILE_DIR.'/'.G5_SKIN_DIR.'/'.G5_SOCIAL_LOGIN_DIR); diff --git a/plugin/social/includes/functions.php b/plugin/social/includes/functions.php index 8672505a7..230474d78 100644 --- a/plugin/social/includes/functions.php +++ b/plugin/social/includes/functions.php @@ -84,7 +84,7 @@ function social_login_get_provider_adapter( $provider ) return $g5['hybrid_auth']->authenticate($provider); } - $base_url = G5_SOCIAL_LOGIN_URL.G5_SOCIAL_LOGIN_ADD_URL; + $base_url = SOCIAL_LOGIN_BASE_URL; $hauth_time = time(); $connect_data = array( @@ -870,6 +870,32 @@ function social_service_check($provider){ return false; } +function exist_mb_id_recursive($mb_id){ + static $count = 0; + + $mb_id = ($count > 0) ? $mb_id.(string)$count : $mb_id; + + if( ! exist_mb_id($mb_id) ){ + return $mb_id; + } + + $count++; + return exist_mb_id_recursive($mb_id); +} + +function exist_mb_nick_recursive($mb_nick){ + static $count = 0; + + $mb_nick = ($count > 0) ? $mb_nick.(string)$count : $mb_nick; + + if( ! exist_mb_nick($mb_nick, '') ){ + return $mb_nick; + } + + $count++; + return exist_mb_nick_recursive($mb_nick); +} + function social_get_nonce($key=''){ if( $key == 'd' ){ //nonce_duration return 7200; diff --git a/plugin/social/includes/g5_endpoint.php b/plugin/social/includes/g5_endpoint.php index c9df2435f..0eda8063a 100644 --- a/plugin/social/includes/g5_endpoint.php +++ b/plugin/social/includes/g5_endpoint.php @@ -11,11 +11,11 @@ class G5_Hybrid_Authentication { require_once( G5_SOCIAL_LOGIN_PATH.'/includes/g5_endpoint_class.php' ); if( defined('G5_SOCIAL_LOGIN_START_PARAM') && G5_SOCIAL_LOGIN_START_PARAM !== 'hauth.start' && isset($_REQUEST[G5_SOCIAL_LOGIN_START_PARAM]) ){ - $_REQUEST['hauth.start'] = preg_replace('/[^a-zA-Z0-9\-\._]/i', '', $_REQUEST[G5_SOCIAL_LOGIN_START_PARAM]); + $_REQUEST['hauth_start'] = preg_replace('/[^a-zA-Z0-9\-\._]/i', '', $_REQUEST[G5_SOCIAL_LOGIN_START_PARAM]); } if( defined('G5_SOCIAL_LOGIN_DONE_PARAM') && G5_SOCIAL_LOGIN_DONE_PARAM !== 'hauth.done' && isset($_REQUEST[G5_SOCIAL_LOGIN_DONE_PARAM]) ){ - $_REQUEST['hauth.done'] = preg_replace('/[^a-zA-Z0-9\-\._]/i', '', $_REQUEST[G5_SOCIAL_LOGIN_DONE_PARAM]); + $_REQUEST['hauth_done'] = preg_replace('/[^a-zA-Z0-9\-\._]/i', '', $_REQUEST[G5_SOCIAL_LOGIN_DONE_PARAM]); } /* diff --git a/plugin/social/index.php b/plugin/social/index.php index e974ae9ee..4be5c9531 100644 --- a/plugin/social/index.php +++ b/plugin/social/index.php @@ -12,4 +12,6 @@ include_once('_common.php'); require_once( "includes/g5_endpoint.php" ); +error_reporting(0); // Turn off all error reporting + G5_Hybrid_Authentication::hybridauth_endpoint(); \ No newline at end of file diff --git a/plugin/social/register_member.php b/plugin/social/register_member.php index 505ea0f86..feae3b3a6 100644 --- a/plugin/social/register_member.php +++ b/plugin/social/register_member.php @@ -16,7 +16,7 @@ if( $is_member ){ $provider_name = social_get_request_provider(); $user_profile = social_session_exists_check(); if( ! $user_profile ){ - alert( "소셜로그인 을 하신 분만 접근할 수 있습니다.", G5_URL); + alert( "소셜로그인을 하신 분만 접근할 수 있습니다.", G5_URL); } // 소셜 가입된 내역이 있는지 확인 상수 G5_SOCIAL_DELETE_DAY 관련 @@ -26,15 +26,17 @@ $user_nick = social_relace_nick($user_profile->displayName); $user_email = ($user_profile->emailVerified) ? $user_profile->emailVerified : $user_profile->email; $user_id = $user_profile->sid ? preg_replace("/[^0-9a-z_]+/i", "", $user_profile->sid) : get_social_convert_id($user_profile->identifier, $provider_name); -$is_exists_id = exist_mb_id($user_id); -$is_exists_name = exist_mb_nick($user_nick, ''); +//$is_exists_id = exist_mb_id($user_id); +//$is_exists_name = exist_mb_nick($user_nick, ''); +$user_id = exist_mb_id_recursive($user_id); +$user_nick = exist_mb_nick_recursive($user_nick, ''); $is_exists_email = exist_mb_email($user_email, ''); // 불법접근을 막도록 토큰생성 $token = md5(uniqid(rand(), true)); set_session("ss_token", $token); -$g5['title'] = '소셜 회원 가입'; +$g5['title'] = '소셜 회원 가입 - '.social_get_provider_service_name($provider_name); include_once(G5_BBS_PATH.'/_head.php'); diff --git a/plugin/social/register_member_update.php b/plugin/social/register_member_update.php index c93e73f0c..dc826fd96 100644 --- a/plugin/social/register_member_update.php +++ b/plugin/social/register_member_update.php @@ -41,10 +41,16 @@ if($tmp_mb_nick != $mb_nick) { alert('닉네임을 올바르게 입력해 주십시오.'); } -if ($w == '' && !$mb_password) - alert('비밀번호가 넘어오지 않았습니다.'); -if($w == '' && $mb_password != $mb_password_re) - alert('비밀번호가 일치하지 않습니다.'); +if( $mb_password ){ + + if ($w == '' && !$mb_password) + alert('비밀번호가 넘어오지 않았습니다.'); + if($w == '' && $mb_password != $mb_password_re) + alert('비밀번호가 일치하지 않습니다.'); + +} else { + $mb_password = ''; +} if ($msg = empty_mb_name($mb_name)) alert($msg, "", true, true); if ($msg = empty_mb_nick($mb_nick)) alert($msg, "", true, true); diff --git a/skin/social/img/btn_p.jpg b/skin/social/img/btn_p.jpg new file mode 100644 index 000000000..854640b55 Binary files /dev/null and b/skin/social/img/btn_p.jpg differ diff --git a/skin/social/img/login_id.jpg b/skin/social/img/login_id.jpg new file mode 100644 index 000000000..42b9ae47c Binary files /dev/null and b/skin/social/img/login_id.jpg differ diff --git a/skin/social/img/login_pw.jpg b/skin/social/img/login_pw.jpg new file mode 100644 index 000000000..e686037d8 Binary files /dev/null and b/skin/social/img/login_pw.jpg differ diff --git a/skin/social/register_social_member.skin.php b/skin/social/register_social_member.skin.php index 00d26dd0d..800cc8db4 100644 --- a/skin/social/register_social_member.skin.php +++ b/skin/social/register_social_member.skin.php @@ -6,29 +6,16 @@ if( ! $config['cf_social_login_use']) { //소셜 로그인을 사용하지 } // add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 -add_stylesheet('', 10); +add_stylesheet('', 11); +add_stylesheet('', 12); +add_stylesheet('', 13); +add_javascript('', 10); + +$email_msg = $is_exists_email ? '등록할 이메일이 중복되었습니다.다른 이메일을 입력해 주세요.' : ''; ?>
- -
- 회원님은 소셜 계정을 통하여 로그인하셨습니다.
- 회원님의 아이디, 패스워드, 이메일, 닉네임 정보를 입력하시면, 앞으로는 소셜계정으로도 로그인을 계속 하실 수 있으며, 또한 입력하신 회원 아이디와 패스워드로도 이 홈페이지에 로그인이 가능해집니다.
- 또한 이 정보를 입력하신 후에 개인정보 수정페이지에서 메일수신여부, 쪽지수신여부 등을 계속하여 설정하실 수 있습니다. -
- - 등록할 아이디가 중복되었습니다.다른 아이디를 입력해 주세요.

'.PHP_EOL; - } - if( $is_exists_email ){ //이메일 중복 메시지 - echo '

등록할 이메일이 중복되었습니다.다른 이메일을 입력해 주세요.

'.PHP_EOL; - } - if( $is_exists_name ){ //닉네임 중복 메시지 - echo '

등록할 닉네임이 중복되었습니다.다른 닉네임을 입력해 주세요.

'.PHP_EOL; - } - ?> @@ -40,57 +27,43 @@ add_stylesheet(' -
- - - - - - - - - - - - - - - - -
사이트 이용정보 입력
- 영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요. - class="frm_input " minlength="3" maxlength="20"> - -
class="frm_input " minlength="3" maxlength="20">
class="frm_input " minlength="3" maxlength="20">
+ + + + +
+
+ 자세히보기 + +
+
+

+
+
+
+
+ 자세히보기 + +
+
+

+
+
+
+
+ +
- - - - - @@ -99,28 +72,41 @@ add_stylesheet(' - + 취소 - -
개인정보 입력
- - 공백없이 한글,영문,숫자만 입력 가능 (한글2자, 영문4자 이상)
- 닉네임을 바꾸시면 앞으로 일 이내에는 변경 할 수 없습니다. -
- - - -
- - - - - - - + +