2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /***********************************************************************/
15 require_once('OAuth.php');
16 require_once('../Shindig/ATutorOAuthDataStore.php');
18 session_name('ATutorID');
21 $oauthDataStore = new ATutorOAuthDataStore();
23 $oauth_token = $_REQUEST['oauth_token'];
24 $oauth_callback = $_REQUEST['oauth_callback'];
26 $oauthDataStore->authorize_request_token($oauth_token);
28 // if callback was provided, append token and return to the callback
29 if ($oauth_callback) {
30 $oauth_callback .= (strpos($oauth_callback, '?') === false ? '?' : '&');
31 $oauth_callback .= 'oauth_token=' . urlencode($oauth_token);
32 header('Location:' . $oauth_callback);
34 echo "Your application is now authorized.";
36 } catch (OAuthException $e) {
37 echo $e->getMessage();
38 } catch (Exception $e) {
39 echo $e->getMessage();