7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
22 /** Zend_Oauth_Http */
23 require_once 'Zend/Oauth/Http.php';
26 require_once 'Zend/Uri/Http.php';
31 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
32 * @license http://framework.zend.com/license/new-bsd New BSD License
34 class Zend_Oauth_Http_UserAuthorization extends Zend_Oauth_Http
37 * Generate a redirect URL from the allowable parameters and configured
42 public function getUrl()
44 $params = $this->assembleParams();
45 $uri = Zend_Uri_Http::fromString($this->_consumer->getUserAuthorizationUrl());
48 $this->_httpUtility->toEncodedQueryString($params)
51 return $uri->getUri();
55 * Assemble all parameters for inclusion in a redirect URL.
59 public function assembleParams()
62 'oauth_token' => $this->_consumer->getLastRequestToken()->getToken(),
65 if (!Zend_Oauth_Client::$supportsRevisionA) {
66 $callback = $this->_consumer->getCallbackUrl();
67 if (!empty($callback)) {
68 $params['oauth_callback'] = $callback;
72 if (!empty($this->_parameters)) {
73 $params = array_merge($params, $this->_parameters);