Update api.socialhub.php

This commit is contained in:
Namhyeon Go 2018-09-27 06:11:24 +09:00 committed by GitHub
parent 168ab9a7e6
commit 7773343f42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@
loadHelper("hybridauth.lnk"); loadHelper("hybridauth.lnk");
loadHelper("hybridauth.dbt"); loadHelper("hybridauth.dbt");
loadHelper("socialhub.utl");
set_session_token(); set_session_token();
$_token = get_session_token(); $_token = get_session_token();
@ -74,13 +75,11 @@ if(!empty($connection_id)) {
} }
// check hybridauth request // check hybridauth request
if(hybridauth_check_redirect()) { if($hauth->isConnectedWith($provider)) {
if($hauth->isConnectedWith($provider)) { $hauth_session = $hauth->getSessionData();
$hauth_session = $hauth->getSessionData(); $connection_id = store_hybridauth_session($hauth_session, $user_id);
$connection_id = store_hybridauth_session($hauth_session, $user_id); if($connection_id) {
if($connection_id) { $session_flag = true;
$session_flag = true;
}
} }
} }
@ -186,6 +185,8 @@ switch($action) {
break; break;
case "delete": // listen delete ping case "delete": // listen delete ping
break; break;
case "accept": // listen accept ping
break;
case "object": // get object by id case "object": // get object by id
$object_id = get_requested_value("object_id"); $object_id = get_requested_value("object_id");
$context = array( $context = array(
@ -199,6 +200,8 @@ switch($action) {
show_errors(); show_errors();
} }
var_dump($redirect_uri);
if(empty($redirect_uri)) { if(empty($redirect_uri)) {
header("Content-Type: application/json"); header("Content-Type: application/json");
echo json_encode($context); echo json_encode($context);