From 66f0f0fa96f5ffd893e6141ac7eddc3232cc7c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neto?= Date: Thu, 18 Sep 2014 07:52:49 -0300 Subject: [PATCH] correct code style --- google-plus/callback.php | 27 +++++++++++++-------------- social-connect.php | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/google-plus/callback.php b/google-plus/callback.php index 783c922..b89e073 100644 --- a/google-plus/callback.php +++ b/google-plus/callback.php @@ -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']; @@ -39,7 +39,7 @@ $profile_url = $user['link']; - $signature = social_connect_generate_signature($google_id); + $signature = social_connect_generate_signature( $google_id ); ?> @@ -61,5 +61,4 @@ function init() { \ No newline at end of file +} \ No newline at end of file diff --git a/social-connect.php b/social-connect.php index d89506e..468c823 100644 --- a/social-connect.php +++ b/social-connect.php @@ -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'];