그누보드5 리뉴얼 소셜 수정중
This commit is contained in:
1 parent
23bf0d6a17
commit
b03b0a1b1a
14 files changed
+1280
-124
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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();
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user