<?php require_once __DIR__ . '/vendor/autoload.php'; require_once __DIR__ . '/config.php'; require_once __DIR__ . '/helpers.php'; session_start(); if (isset($_GET['error'])) { throw new Exception($_GET['error']); } $authCode = $_GET['code']; $client = getGoogleClient(); // exchange authorization code for an access token. $accessToken = $client->authenticate($authCode); // store the access_token in a session. $_SESSION['google_access_token'] = serialize($accessToken); $mainUrl = 'http://my-playground-bw-jfs.appspot.com'; header('Location: ' . $mainUrl); exit;
function deleteFromCalendar($gig, $calendartype = 'private') { global $calendars; extract($calendars[$calendartype]); if (!$gig[$id_field]) { return; } $cal = getGoogleClient(); $event = new Google_Event(); $cal->events->delete($calendar_id, $gig[$id_field]); dbwrite("update gigs set {$id_field} = '' where gig_id = {$gig['gig_id']}"); }