/home/desid573/public_html/tollster
NameSizeModeActions
coder/-0755rm
geometry-library/-0755rm
lib/-0755rm
src/-0755rm
vendor/-0755rm
11.php280820644editdlrm
21.php7330644editdlrm
a_index.php292430644editdlrm
credentials.json3180644editdlrm
encoder.php26620644editdlrm
endFlag.png6660644editdlrm
error_log1510301880644editdlrm
google_log_api.php90200644editdlrm
google_service.php8870644editdlrm
inFlag.png3450644editdlrm
keyGen.php3240644editdlrm
login_api.php7520644editdlrm
outFlag.png5150644editdlrm
playconsole.php30810644editdlrm
startFlag.png6790644editdlrm
tollster-48ab6e372c8b.json23030644editdlrm
tollster-274e90e11b50.p1224790644editdlrm
Edit: /home/desid573/public_html/tollster/playconsole.php (3081B)
setApplicationName('Google Calendar API PHP Quickstart'); $client->setScopes(Android_Publisher); $client->setAuthConfig('client_secret.json'); $client->setAccessType('offline'); // Load previously authorized credentials from a file. $credentialsPath = expandHomeDirectory('contactsCredentials.json'); if (file_exists($credentialsPath)) { $accessToken = json_decode(file_get_contents($credentialsPath), true); } else { // Request authorization from the user. $authUrl = $client->createAuthUrl(); printf("Open the following link in your browser:\n%s\n", $authUrl); print 'Enter verification code: '; $authCode = "4/AADEQ3UpoPiXhDVlvPYYKcQWvYV4woaKZrEWqbSvNCMJCj0Ihnuh_n4"; //header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL)); // Exchange authorization code for an access token. $accessToken = $client->fetchAccessTokenWithAuthCode($authCode); // Store the credentials to disk. if (!file_exists(dirname($credentialsPath))) { mkdir(dirname($credentialsPath), 0700, true); } file_put_contents($credentialsPath, json_encode($accessToken)); printf("Credentials saved to %s\n", $credentialsPath); } $client->setAccessToken($accessToken); // Refresh the token if it's expired. if ($client->isAccessTokenExpired()) { $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken()); file_put_contents($credentialsPath, json_encode($client->getAccessToken())); } return $client; } /** * Expands the home directory alias '~' to the full path. * @param string $path the path to expand. * @return string the expanded path. */ function expandHomeDirectory($path) { $homeDirectory = getenv('HOME'); if (empty($homeDirectory)) { $homeDirectory = getenv('HOMEDRIVE') . getenv('HOMEPATH'); } return str_replace('~', realpath($homeDirectory), $path); } // Get the API client and construct the service object. function checkToken($product, $token) { $client = getClient(); $accesstoken = $client->getAccessToken(); $accesstoken = $accesstoken['access_token']; $url = "https://www.googleapis.com/androidpublisher/v3/applications/com.tollster.android/purchases/products/".$product."/tokens/".$token; $curlObj = curl_init(); $headr = array(); $headr[] = 'Content-length: 0'; $headr[] = 'Content-type: application/json'; $headr[] = 'Authorization: OAuth '.$accesstoken; curl_setopt($curlObj, CURLOPT_URL, "$url"); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HTTPHEADER, $headr); curl_setopt($curlObj, CURLOPT_POST,true); $response = curl_exec($curlObj); curl_close($curlObj); return $response; } ?>