5.3 버전 내용 적용
This commit is contained in:
1039
plugin/social/includes/functions.php
Normal file
1039
plugin/social/includes/functions.php
Normal file
File diff suppressed because it is too large
Load Diff
32
plugin/social/includes/g5_endpoint.php
Normal file
32
plugin/social/includes/g5_endpoint.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
//https://hybridauth.github.io/hybridauth/userguide/tuts/change-hybridauth-endpoint-url.html
|
||||
|
||||
class G5_Hybrid_Authentication {
|
||||
|
||||
public static function hybridauth_endpoint() {
|
||||
|
||||
require_once( G5_SOCIAL_LOGIN_PATH.'/Hybrid/Auth.php' );
|
||||
require_once( G5_SOCIAL_LOGIN_PATH.'/Hybrid/Endpoint.php' );
|
||||
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]);
|
||||
}
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
/*
|
||||
$key = 'hauth.' . $action; // either `hauth_start` or `hauth_done`
|
||||
|
||||
$_REQUEST[ $key ] = $provider; // provider will be something like `facebook` or `google`
|
||||
*/
|
||||
|
||||
G5_Hybrid_Endpoint::process();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
32
plugin/social/includes/g5_endpoint_class.php
Normal file
32
plugin/social/includes/g5_endpoint_class.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
class G5_Hybrid_Endpoint extends Hybrid_Endpoint
|
||||
{
|
||||
protected function processAuthStart(){
|
||||
try {
|
||||
parent::processAuthStart();
|
||||
}
|
||||
catch( Exception $e ){
|
||||
$this->dieError( "412 Precondition Failed", $e->getMessage(), $e );
|
||||
}
|
||||
}
|
||||
|
||||
protected function processAuthDone()
|
||||
{
|
||||
try {
|
||||
parent::processAuthDone();
|
||||
}
|
||||
catch( Exception $e ){
|
||||
$this->dieError( "410 Gone", $e->getMessage(), $e );
|
||||
}
|
||||
}
|
||||
|
||||
public function dieError( $code, $message, $e )
|
||||
{
|
||||
$get_error = $message;
|
||||
include_once(G5_SOCIAL_LOGIN_PATH.'/error.php');
|
||||
die();
|
||||
}
|
||||
}
|
||||
?>
|
||||
0
plugin/social/includes/index.php
Normal file
0
plugin/social/includes/index.php
Normal file
68
plugin/social/includes/loading.php
Normal file
68
plugin/social/includes/loading.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta name="robots" content="NOINDEX, NOFOLLOW">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=yes">
|
||||
<title>소셜 로그인 - <?php echo $provider; ?></title>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
<td align="center" height="190px" valign="middle"><img src="<?php echo $img_url;?>loading_icon.gif" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><br /><h3>Loading...</h3><br /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><b><?php echo ucfirst( strtolower( strip_tags( $provider ) ) ) ; ?></b> 에 연결중입니다. 잠시만 기다려주세요.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php if( (defined('G5_SOCIAL_IS_LOADING') && G5_SOCIAL_IS_LOADING ) || (G5_SOCIAL_USE_POPUP && empty($login_action_url)) ){ ?>
|
||||
<script>
|
||||
window.location.href = window.location.href + "&redirect_to_idp=1";
|
||||
</script>
|
||||
<?php } else { ?>
|
||||
<form name="loginform" method="post" action="<?php echo $login_action_url; ?>">
|
||||
<input type="hidden" id="url" name="url" value="<?php echo $url ?>">
|
||||
<input type="hidden" id="provider" name="provider" value="<?php echo $provider ?>">
|
||||
<input type="hidden" id="mb_id" name="mb_id" value="<?php echo $mb_id ?>">
|
||||
<input type="hidden" id="mb_password" name="mb_password" value="<?php echo $mb_password ?>">
|
||||
</form>
|
||||
<script>
|
||||
function init()
|
||||
{
|
||||
<?php
|
||||
if( $use_popup == 1 || ! $use_popup ){
|
||||
?>
|
||||
if( window.opener )
|
||||
{
|
||||
window.opener.name = "social_login";
|
||||
document.loginform.target = window.opener.name;
|
||||
document.loginform.submit();
|
||||
window.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
document.loginform.submit();
|
||||
}
|
||||
<?php
|
||||
}
|
||||
elseif( $use_popup == 2 ){
|
||||
?>
|
||||
document.loginform.submit();
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
init();
|
||||
</script>
|
||||
<?php } //end if ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
die();
|
||||
?>
|
||||
244
plugin/social/includes/providers.php
Normal file
244
plugin/social/includes/providers.php
Normal file
@ -0,0 +1,244 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$social_providers_config = array(
|
||||
ARRAY(
|
||||
"provider_id" => "Facebook",
|
||||
"provider_name" => "Facebook",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://developers.facebook.com/apps",
|
||||
"default_api_scope" => "email, public_profile, user_friends",
|
||||
|
||||
"default_network" => true,
|
||||
"cat" => "socialnetworks",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Google",
|
||||
"provider_name" => "Google",
|
||||
"callback" => true,
|
||||
"require_client_id" => true,
|
||||
"new_app_link" => "https://console.developers.google.com",
|
||||
"default_api_scope" => "profile https://www.googleapis.com/auth/plus.profile.emails.read",
|
||||
|
||||
"default_network" => true,
|
||||
"cat" => "socialnetworks",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Twitter",
|
||||
"provider_name" => "Twitter",
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://dev.twitter.com/apps",
|
||||
|
||||
"default_network" => true,
|
||||
"cat" => "microblogging",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "WordPress",
|
||||
"provider_name" => "WordPress",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://developer.wordpress.com/apps/new/",
|
||||
|
||||
"cat" => "blogging",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Yahoo",
|
||||
"provider_name" => "Yahoo!",
|
||||
"new_app_link" => null,
|
||||
|
||||
"cat" => "pleasedie",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "LinkedIn",
|
||||
"provider_name" => "LinkedIn",
|
||||
"new_app_link" => "https://www.linkedin.com/secure/developer",
|
||||
|
||||
"cat" => "professional",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Disqus",
|
||||
"provider_name" => "Disqus",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://disqus.com/api/applications/",
|
||||
|
||||
"cat" => "misc",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Instagram",
|
||||
"provider_name" => "Instagram",
|
||||
"callback" => true,
|
||||
"require_client_id" => true,
|
||||
"new_app_link" => "http://instagr.am/developer/clients/manage/",
|
||||
|
||||
"cat" => "media",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Reddit",
|
||||
"provider_name" => "Reddit",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://ssl.reddit.com/prefs/apps",
|
||||
|
||||
"cat" => "socialnetworks",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Foursquare",
|
||||
"provider_name" => "Foursquare",
|
||||
"callback" => true,
|
||||
"require_client_id" => true,
|
||||
"new_app_link" => "https://www.foursquare.com/oauth/",
|
||||
|
||||
"cat" => "microblogging",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "LastFM",
|
||||
"provider_name" => "Last.FM",
|
||||
"new_app_link" => "http://www.lastfm.com/api/account",
|
||||
|
||||
"cat" => "media",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Tumblr",
|
||||
"provider_name" => "Tumblr",
|
||||
"new_app_link" => "http://www.tumblr.com/oauth/apps",
|
||||
|
||||
"cat" => "microblogging", // o well
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Goodreads",
|
||||
"provider_name" => "Goodreads",
|
||||
"callback" => true,
|
||||
"new_app_link" => "http://www.goodreads.com/api",
|
||||
|
||||
"cat" => "media",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Stackoverflow",
|
||||
"provider_name" => "Stackoverflow",
|
||||
"new_app_link" => null,
|
||||
|
||||
"cat" => "programmers",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "GitHub",
|
||||
"provider_name" => "GitHub",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://github.com/settings/applications/new",
|
||||
"default_api_scope" => "user:email",
|
||||
|
||||
"cat" => "programmers",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Dribbble",
|
||||
"provider_name" => "Dribbble",
|
||||
"require_client_id" => true,
|
||||
"custom_callback" => true,
|
||||
"new_app_link" => "https://dribbble.com/account/applications/new",
|
||||
|
||||
"cat" => "designers",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "500px",
|
||||
"provider_name" => "px500",
|
||||
"new_app_link" => "http://developers.500px.com/",
|
||||
|
||||
"cat" => "media",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Skyrock",
|
||||
"provider_name" => "Skyrock",
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://www.skyrock.com/developer/application",
|
||||
|
||||
"cat" => "socialnetworks",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Mixi",
|
||||
"provider_name" => "Mixi",
|
||||
"new_app_link" => null,
|
||||
|
||||
"cat" => "socialnetworks",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Steam",
|
||||
"provider_name" => "Steam",
|
||||
"new_app_link" => "http://steamcommunity.com/dev/apikey",
|
||||
"require_api_key" => true,
|
||||
|
||||
"cat" => "gamers",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "TwitchTV",
|
||||
"provider_name" => "Twitch.tv",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "http://www.twitch.tv/settings?section=applications",
|
||||
|
||||
"cat" => "gamers",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Vkontakte",
|
||||
"provider_name" => "ВКонтакте",
|
||||
"callback" => true,
|
||||
"require_client_id" => true,
|
||||
"new_app_link" => "http://vk.com/developers.php",
|
||||
|
||||
"cat" => "socialnetworks",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Mailru",
|
||||
"provider_name" => "Mailru",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "http://api.mail.ru/",
|
||||
|
||||
"cat" => "misc",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Yandex",
|
||||
"provider_name" => "Yandex",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://oauth.yandex.ru",
|
||||
|
||||
"cat" => "misc",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Odnoklassniki",
|
||||
"provider_name" => "Odnoklassniki",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "http://dev.odnoklassniki.ru/",
|
||||
|
||||
"cat" => "socialnetworks",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "AOL",
|
||||
"provider_name" => "AOL",
|
||||
"new_app_link" => null,
|
||||
|
||||
"cat" => "pleasedie",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "Live",
|
||||
"provider_name" => "Windows Live",
|
||||
"require_client_id" => true,
|
||||
"new_app_link" => "https://account.live.com/developers/applications/create",
|
||||
|
||||
"cat" => "pleasedie",
|
||||
),
|
||||
ARRAY(
|
||||
"provider_id" => "PixelPin",
|
||||
"provider_name" => "PixelPin",
|
||||
"require_client_id" => true,
|
||||
"callback" => true,
|
||||
"new_app_link" => "https://login.pixelpin.co.uk/",
|
||||
|
||||
"cat" => "misc",
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user