-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcallback.php
More file actions
32 lines (20 loc) · 771 Bytes
/
Copy pathcallback.php
File metadata and controls
32 lines (20 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
session_start();
set_include_path('library' . PATH_SEPARATOR . get_include_path());
if (!isset($_GET['oauth_token'])) {
die("oauth_token not set");
}
$response = array(
'oauth_token' => $_GET['oauth_token'],
'oauth_verifier' => $_GET['oauth_verifier'],
);
require_once 'Zend/Oauth/Consumer.php';
$consumer = new Zend_Oauth_Consumer(require_once 'config.php');
$requestToken = unserialize($_SESSION['requestToken']);
$accessToken = $consumer->getAccessToken($response, $requestToken);
unset($_SESSION['requestToken']);
parse_str($accessToken->getResponse()->getBody(), $params);
$params['oauth_token'] = '--==hidden==--';
$params['oauth_token_secret'] = '--==hidden==--';
$_SESSION['auth'] = $params;
header('Location: index.php');