web/hanna-arendt/client.php
changeset 842 44b97c5679c0
parent 841 bf648f325dc4
child 843 8fdc4132761e
equal deleted inserted replaced
841:bf648f325dc4 842:44b97c5679c0
     1 <?php
       
     2 
       
     3 $config = array("rep" => basename(__DIR__));
       
     4 
       
     5 include_once '../common.php';
       
     6 
       
     7 if (isset($_SESSION['TWITTER_ACCESS_TOKEN']) ) {
       
     8 	// Permanent redirection
       
     9 	header("HTTP/1.1 301 Moved Permanently");
       
    10 	header("Location: index.php");
       
    11 	exit();
       
    12 } else {
       
    13 	    /**
       
    14      * Guess we need to go get one!
       
    15      */
       
    16     $token = $consumer->getRequestToken();
       
    17     $_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token);
       
    18 
       
    19     /**
       
    20      * Now redirect user to Twitter site so they can log in and
       
    21      * approve our access
       
    22      */
       
    23     $consumer->redirect();
       
    24 }
       
    25 
       
    26 ?>