/** * Asks Twitter for a request token, and then redirects to Twitter * to authorize it. */ protected function authorizeRequestToken() { try { // Get a new request token and authorize it $client = new TwitterOAuthClient(); $req_tok = $client->getTwitterRequestToken(); // Sock the request token away in the session temporarily $_SESSION['twitter_request_token'] = $req_tok->key; $_SESSION['twitter_request_token_secret'] = $req_tok->secret; $auth_link = $client->getTwitterAuthorizeLink($req_tok, $this->boolean('signin')); } catch (OAuthClientException $e) { $msg = sprintf('OAuth client error - code: %1s, msg: %2s', $e->getCode(), $e->getMessage()); common_log(LOG_INFO, 'Twitter bridge - ' . $msg); // TRANS: Server error displayed when linking to a Twitter account fails. throw new ServerException(_m('Could not link your Twitter account.')); } common_redirect($auth_link); }