diff options
author | Andrew Dolgov <[email protected]> | 2011-12-11 23:59:25 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-12-11 23:59:25 +0400 |
commit | 107d0cf39e3801547a9a86b32762b772b25f6953 (patch) | |
tree | c76a639f2b4b77f14c0942aec7cd0117144ff24c /twitter.php | |
parent | 31303c6bbdaeed42a5cc72bc01f610ed7ca99663 (diff) |
overall directory tree cleanup
Diffstat (limited to 'twitter.php')
-rw-r--r-- | twitter.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/twitter.php b/twitter.php index 9d0c8e509..2c325140b 100644 --- a/twitter.php +++ b/twitter.php @@ -1,4 +1,6 @@ <?php + set_include_path(get_include_path() . PATH_SEPARATOR . "include"); + require_once "functions.php"; require_once "sessions.php"; require_once "sanity_check.php"; @@ -7,15 +9,15 @@ //require_once "lib/twitteroauth/twitteroauth.php"; require_once "lib/tmhoauth/tmhOAuth.php"; - $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); + $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); - init_connection($link); + init_connection($link); login_sequence($link); - + $owner_uid = $_SESSION["uid"]; $op = $_REQUEST['op']; - if (!SINGLE_USER_MODE && !$_SESSION['uid']) { + if (!SINGLE_USER_MODE && !$_SESSION['uid']) { render_login_form($link); exit; } @@ -25,7 +27,7 @@ $tmhOAuth = new tmhOAuth(array( 'consumer_key' => CONSUMER_KEY, 'consumer_secret' => CONSUMER_SECRET, - )); + )); if ($op == 'clear') { unset($_SESSION['oauth']); @@ -43,7 +45,7 @@ $code = $tmhOAuth->request('POST', $tmhOAuth->url('oauth/access_token', ''), array( 'oauth_verifier' => $_REQUEST['oauth_verifier'])); - + if ($code == 200) { $access_token = json_encode($tmhOAuth->extract_params($tmhOAuth->response['response'])); @@ -62,7 +64,7 @@ if ($op == 'register') { - $code = $tmhOAuth->request('POST', + $code = $tmhOAuth->request('POST', $tmhOAuth->url('oauth/request_token', ''), array( 'oauth_callback' => $callback)); @@ -73,8 +75,8 @@ $force = isset($_REQUEST['force']) ? '&force_login=1' : ''; $forcewrite = isset($_REQUEST['force_write']) ? '&oauth_access_type=write' : ''; $forceread = isset($_REQUEST['force_read']) ? '&oauth_access_type=read' : ''; - - $location = $tmhOAuth->url("oauth/{$method}", '') . + + $location = $tmhOAuth->url("oauth/{$method}", '') . "?oauth_token={$_SESSION['oauth']['oauth_token']}{$force}{$forcewrite}{$forceread}"; header("Location: $location"); |