diff goodreads/getLoginURL.php @ 6:077b0a0a3e6d

remaining originals according to dependency walk
author Robert Boland <robert@markup.co.uk>
date Thu, 16 Feb 2017 22:29:02 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/goodreads/getLoginURL.php	Thu Feb 16 22:29:02 2017 +0000
@@ -0,0 +1,23 @@
+<?php
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: post-check=0, pre-check=0", false);
+header("Pragma: no-cache");
+require_once('GoodreadsAPI.php');
+
+$back=$_GET['backLocation'];
+
+session_start();
+$_SESSION['backLocation'] = $back;
+
+$connection = new GoodreadsAPI(CONSUMER_KEY, CONSUMER_SECRET);
+$request_token = $connection->getRequestToken(CALLBACK_URL);
+
+$_SESSION['oauth_token']  = $request_token['oauth_token'];
+$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
+
+$authorize_url = $connection->getLoginURL($request_token);
+echo $authorize_url;
+
+?>