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 /***********************************************************************/
14 $_user_location = 'public';
16 define('AT_INCLUDE_PATH', '../../../../../include/');
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 require_once('OAuth.php');
19 //require_once('../Shindig/ATutorOAuthDataStore.php');
22 if (!isset($_SESSION['member_id'])){
23 header('Location: ../../../../../login.php?p='.urlencode($_SERVER['REQUEST_URI']));
28 $request = OAuthRequest::from_request();
29 $token = $request->get_parameter('oauth_token');
30 $callback = $request->get_parameter('oauth_callback');
32 echo 'Bad Request - missing oauth_token';
35 //oauth customized header template
36 $savant->assign('page_title', 'Authentication Page');
37 $savant->assign('lang_code', $_SESSION['lang']);
38 $savant->assign('lang_charset', $myLang->getCharacterSet());
39 $savant->assign('base_path', $_base_path);
40 $savant->assign('base_tmpl_path', $_SERVER['HTTP_HOST']);
41 $savant->assign('theme', $_SESSION['prefs']['PREF_THEME']);
42 $savant->assign('current_date', AT_date(_AT('announcement_date_format')));
43 $savant->assign('just_social', $_config['just_social']);
44 $savant->display('social/oauth/header.tmpl.php');
47 $savant->assign('token', $token);
48 $savant->assign('callback', $callback);
49 $savant->display('social/oauth/authorize.tmpl.php');
51 //oauth customized footer template
52 $savant->display('social/oauth/footer.tmpl.php');
53 } catch (OAuthException $e) {
54 echo $e->getMessage();
56 } catch (Exception $e) {
57 echo $e->getMessage();