12345678910111213141516171819202122232425262728 |
- <?php
- require_once __DIR__ . '/boot.inc';
- $app = boot();
- session_start();
- $client = new Google_Client();
- $client->setClientId($app['auth']['client_id']);
- $client->setClientSecret($app['auth']['client_secret']);
- $client->setRedirectUri('http://api.audean.com/login.php');
- if (isset($_GET['logout'])) {
- unset($_SESSION['token']);
- }
- if (isset($_GET['code'])) {
- echo "<p>Code received";
- $client->authenticate($_GET['code']);
- $_SESSION['token'] = $client->getAccessToken();
- }
- else {
- echo "<p>No code";
- }
- header('Location: http://' . $_SERVER['HTTP_HOST'] . '/simple.php');//$_SERVER['PHP_SELF']);
|