Skip to content

Commit

Permalink
correct code style
Browse files Browse the repository at this point in the history
  • Loading branch information
João Neto committed Sep 18, 2014
1 parent 7ef3fae commit 66f0f0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
27 changes: 13 additions & 14 deletions google-plus/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
$redirect_uri = SOCIAL_CONNECT_GOOGLE_PLUS_REDIRECT_URL;

$client = new Google_Client();
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setRedirectUri($redirect_uri);
$client->setClientId( $client_id );
$client->setClientSecret( $client_secret );
$client->setRedirectUri( $redirect_uri );

if (isset($_REQUEST['logout'])) {
unset($_SESSION['access_token']);
if ( isset( $_REQUEST['logout'] ) ) {
unset( $_SESSION['access_token'] );
}

if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
$client->setAccessToken($_SESSION['access_token']);
} else if (isset($code)) {
$client->authenticate($_GET['code']);
if ( isset( $_SESSION['access_token'] ) && $_SESSION['access_token'] ) {
$client->setAccessToken( $_SESSION['access_token'] );
} elseif ( isset( $code ) ) {
$client->authenticate( $_GET['code'] );
$_SESSION['access_token'] = $client->getAccessToken();
}

$token = json_decode($client->getAccessToken());
$token = json_decode( $client->getAccessToken() );

$google_oauthV2 = new Google_Service_Oauth2($client);
$google_oauthV2 = new Google_Service_Oauth2( $client );
$user = $google_oauthV2->userinfo->get();
$google_id = $user['id'];
$email = $user['email'];
Expand All @@ -39,7 +39,7 @@
$profile_url = $user['link'];


$signature = social_connect_generate_signature($google_id);
$signature = social_connect_generate_signature( $google_id );

?>
<html>
Expand All @@ -61,5 +61,4 @@ function init() {
<body onload="init();"></body>
</html>
<?php
}
?>
}
2 changes: 1 addition & 1 deletion social-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function sc_social_connect_process_login( $is_ajax = false ) {
break;
case 'google-plus':
$sc_provider_identity = $_REQUEST['social_connect_google_id'];
social_connect_verify_signature( $sc_provider_identity, $sc_provided_signature, $redirect_to);
social_connect_verify_signature( $sc_provider_identity, $sc_provided_signature, $redirect_to );
$sc_email = $_REQUEST['social_connect_email'];
$sc_first_name = $_REQUEST['social_connect_first_name'];
$sc_last_name = $_REQUEST['social_connect_last_name'];
Expand Down

0 comments on commit 66f0f0f

Please sign in to comment.