From f237e37a28be69f1945af90417f3ae7d69b9bff0 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 4 Aug 2016 15:40:19 +0200 Subject: [PATCH] Added GMAIL_SEND scope request for Google API. Details in README. --- README.md | 4 +++- lib/Frs/SessionManager.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb865b6..6c4e11f 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,12 @@ Fake Reservation System Allows you to send mails to your Google Inbox that trigger Google Now cards. -To set up a server for yourself, you have to get an API key from +To set up a server for yourself, you have to get an OAuth client ID from https://console.developers.google.com/apis/, download the `client_secret.json` and put it into the root directory. +Also make sure to enable the *Google+ API* and the *Gmail API*. + Installation ============ diff --git a/lib/Frs/SessionManager.php b/lib/Frs/SessionManager.php index 2dc8553..bbba7c7 100644 --- a/lib/Frs/SessionManager.php +++ b/lib/Frs/SessionManager.php @@ -11,8 +11,10 @@ class SessionManager { $this->googleAuthValid = false; $this->client = new \Google_Client(); + $this->client->setApplicationName('Fake Reservation System'); $this->client->setAuthConfigFile('client_secret.json'); $this->client->addScope(\Google_Service_Oauth2::USERINFO_EMAIL); + $this->client->addScope(\Google_Service_Gmail::GMAIL_SEND); session_start(); }