Skip to content

Commit

Permalink
Tabs to spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
mukunda- committed Apr 24, 2016
1 parent 8daebf6 commit f45f586
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions examples/battlenet.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@

if( empty( $_GET['code'] ) && !isset($_GET['go'] )) {

// Empty query; show the startup page.
// Empty query; show the startup page.
echo '
<p>Sign-in using Battle.net. Please pick your region:</p>
<p>
<a href="?go&region=us">USA</a>
<a href="?go&region=eu">Europe</a>
<a href="?go&region=kr">Korea</a>
<a href="?go&region=tw">Taiwan</a>
<a href="?go&region=cn">China</a>
</p>
';
die();
<p>Sign-in using Battle.net. Please pick your region:</p>
<p>
<a href="?go&region=us">USA</a>
<a href="?go&region=eu">Europe</a>
<a href="?go&region=kr">Korea</a>
<a href="?go&region=tw">Taiwan</a>
<a href="?go&region=cn">China</a>
</p>
';
die();
}

//////////////////////////////////////////////////////////////////////////////
Expand All @@ -58,11 +58,11 @@
$region = isset($_GET['region']) ? $_GET['region'] : "";

$region_map = array(
'us' => BattleNet::API_URI_US, // USA - this is the default if you omit the base API URI.
'eu' => BattleNet::API_URI_EU, // Europe
'kr' => BattleNet::API_URI_KR, // Korea
'tw' => BattleNet::API_URI_TW, // Taiwan
'cn' => BattleNet::API_URI_CN, // China
'us' => BattleNet::API_URI_US, // USA - this is the default if you omit the base API URI.
'eu' => BattleNet::API_URI_EU, // Europe
'kr' => BattleNet::API_URI_KR, // Korea
'tw' => BattleNet::API_URI_TW, // Taiwan
'cn' => BattleNet::API_URI_CN, // China
);

// Get base API URI from region.
Expand All @@ -78,16 +78,16 @@
// This was a callback request from Battle.net, get the token
$token = $battlenetService->requestAccessToken( $_GET['code'] );

// See https://dev.battle.net/io-docs for OAuth request types.
//
// Without any scopes specified, we can get their BattleTag.
// See https://dev.battle.net/io-docs for OAuth request types.
//
// Without any scopes specified, we can get their BattleTag.
$result = json_decode( $battlenetService->request('/account/user') );

echo "Your BattleTag is \"$result->battletag\".";
echo "Your BattleTag is \"$result->battletag\".";

} elseif( isset($_GET['go']) ) {

$url = $battlenetService->getAuthorizationUri();
header( "Location: $url" );
}

0 comments on commit f45f586

Please sign in to comment.