Redirect correct
authorRaphael Velt <raph.velt@gmail.com>
Mon, 15 Apr 2013 12:59:29 +0200
changeset 842 44b97c5679c0
parent 841 bf648f325dc4
child 843 8fdc4132761e
Redirect correct
web/hanna-arendt/client.php
web/hanna-arendt/config.php
web/hanna-arendt/index.php
web/hanna-arendt/paris.php
--- a/web/hanna-arendt/client.php	Mon Apr 15 12:48:58 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?php
-
-$config = array("rep" => basename(__DIR__));
-
-include_once '../common.php';
-
-if (isset($_SESSION['TWITTER_ACCESS_TOKEN']) ) {
-	// Permanent redirection
-	header("HTTP/1.1 301 Moved Permanently");
-	header("Location: index.php");
-	exit();
-} else {
-	    /**
-     * Guess we need to go get one!
-     */
-    $token = $consumer->getRequestToken();
-    $_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token);
-
-    /**
-     * Now redirect user to Twitter site so they can log in and
-     * approve our access
-     */
-    $consumer->redirect();
-}
-
-?>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/hanna-arendt/config.php	Mon Apr 15 12:59:29 2013 +0200
@@ -0,0 +1,4 @@
+<?php
+$config = array(
+   	'rep' => basename(__DIR__),
+);
\ No newline at end of file
--- a/web/hanna-arendt/index.php	Mon Apr 15 12:48:58 2013 +0200
+++ b/web/hanna-arendt/index.php	Mon Apr 15 12:59:29 2013 +0200
@@ -13,7 +13,7 @@
 	$_SESSION['TWITTER_REDIRECT_URL'] = URL_ROOT . basename(__DIR__) . '/' . basename(__FILE__);
 	// Permanent redirection
 	header("HTTP/1.1 301 Moved Permanently");
-	header("Location: client.php");
+	header("Location: client.php?CONNECT=true&rep=".basename(__DIR__));
 	exit();
 	
 }
--- a/web/hanna-arendt/paris.php	Mon Apr 15 12:48:58 2013 +0200
+++ b/web/hanna-arendt/paris.php	Mon Apr 15 12:59:29 2013 +0200
@@ -13,7 +13,7 @@
 	$_SESSION['TWITTER_REDIRECT_URL'] = URL_ROOT . basename(__DIR__) . '/' . basename(__FILE__);
 	// Permanent redirection
 	header("HTTP/1.1 301 Moved Permanently");
-	header("Location: client.php");
+	header("Location: client.php?CONNECT=true&rep=".basename(__DIR__));
 	exit();
 	
 }