本文整理匯總了PHP中Zend_Gdata_AuthSub::getAuthSubTokenUri方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Gdata_AuthSub::getAuthSubTokenUri方法的具體用法?PHP Zend_Gdata_AuthSub::getAuthSubTokenUri怎麽用?PHP Zend_Gdata_AuthSub::getAuthSubTokenUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Gdata_AuthSub
的用法示例。
在下文中一共展示了Zend_Gdata_AuthSub::getAuthSubTokenUri方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setupDocsClient
function setupDocsClient($token = null)
{
global $authSubURL;
$docsClient = null;
// Fetch a new AuthSub token?
if (!$token && !isset($_SESSION['sessionToken'])) {
$next = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$scope = 'http://docs.google.com/feeds/ https://docs.google.com/feeds/';
$secure = 0;
$session = 1;
$permission = 1;
// 1 - allows posting notices && allows reading profile data
$authSubURL = Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
} else {
if (isset($_SESSION['sessionToken'])) {
$httpClient = new Zend_Gdata_HttpClient();
$httpClient->setAuthSubToken($_SESSION['sessionToken']);
$docsClient = new Zend_Gdata_Docs($httpClient, 'google-OCRPHPDemo-v0.1');
} else {
$httpClient = new Zend_Gdata_HttpClient();
$_SESSION['sessionToken'] = Zend_Gdata_AuthSub::getAuthSubSessionToken(trim($token), $httpClient);
$httpClient->setAuthSubToken($_SESSION['sessionToken']);
$docsClient = new Zend_Gdata_Docs($httpClient, 'google-OCRPHPDemo-v0.1');
}
}
return $docsClient;
}
示例2: getAuthSubUrl
function getAuthSubUrl()
{
$next = getCurrentUrl();
$scope = 'http://picasaweb.google.com/data';
$secure = 0;
$session = 1;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例3: _getAuthSubUrl
/**
* Returns the URL which the user must visit to authenticate
*
* @return void
*/
protected function _getAuthSubUrl()
{
$next = 'https://' . $this->_request->getHttpHost() . $this->_request->getRequestUri();
$scope = 'https://www.google.com/calendar/feeds/';
$secure = true;
$session = true;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例4: getAuthSubUrl
/**
* Returns the AuthSub URL which the user must visit to authenticate requests
* from this application.
*
* Uses getCurrentUrl() to get the next URL which the user will be redirected
* to after successfully authenticating with the Google service.
*
* @return string AuthSub URL
*/
function getAuthSubUrl()
{
$next = getCurrentUrl();
$scope = 'http://www.google.com/base/feeds/';
$secure = false;
$session = true;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例5: getAuthSubUrl
/**
* Logs in via AuthSub. AuthSub is simiar to OAuth, but was developed
* before OAuth became the "standard". AuthSub acts in a similar way as
* OAuth. You login through Google, granting access to the site. You are
* then returned to the site with an access token to authorize with.
*
* @param String $redirectUrl - URL that you want to redirect to
* once a token is assigned
* @return String - URL to follow to log into Google Calendar
*/
function getAuthSubUrl($redirectUrl)
{
// indicates the app will only access Google Calendar feeds
$scope = 'http://www.google.com/calendar/feeds';
$secure = false;
// if you are registered with SubAuth, then this can be true
$session = true;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($redirectUrl, $scope, $secure, $session);
}
示例6: testGetAuthSubTokenUriModifiedBase
public function testGetAuthSubTokenUriModifiedBase()
{
$uri = Zend_Gdata_AuthSub::getAuthSubTokenUri('http://www.example.com/foo.php', 'http://www.google.com/calendar/feeds', 0, 1, 'http://www.otherauthservice.com/accounts/AuthSubRequest');
// Note: the scope here is not encoded. It should be encoded,
// but the method getAuthSubTokenUri calls urldecode($scope).
// This currently works (no reported bugs) as web browsers will
// handle the encoding in most cases.
$this->assertEquals('http://www.otherauthservice.com/accounts/AuthSubRequest?next=http%3A%2F%2Fwww.example.com%2Ffoo.php&scope=http://www.google.com/calendar/feeds&secure=0&session=1', $uri);
}
示例7: generateSubTokenUrl
function generateSubTokenUrl($nextUrl = null)
{
$secure = false;
$session = true;
if (!$nextUrl) {
$nextUrl = OPERATIONS_URL;
}
$url = Zend_Gdata_AuthSub::getAuthSubTokenUri($nextUrl, GDATA_SCOPE, $secure, $session);
return $url;
}
示例8: getAuthSubUrl
/**
* Returns the AuthSub URL which the user must visit to authenticate requests
* from this application.
*
* Uses getCurrentUrl() to get the next URL which the user will be redirected
* to after successfully authenticating with the Google service.
*
* @return string AuthSub URL
*/
public function getAuthSubUrl()
{
global $_authSubKeyFile;
$next = $this->getCurrentUrl();
$scope = 'http://www.google.com/calendar/feeds/';
$session = true;
if ($_authSubKeyFile != null) {
$secure = true;
} else {
$secure = false;
}
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例9: generateAuthSubURL
function generateAuthSubURL()
{
$next = 'http://localhost/test1.php';
$scope = 'https://www.google.com/h9/feeds';
$authSubHandler = 'https://www.google.com/h9/authsub';
$secure = 0;
$session = 1;
$authSubURL = Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session, $authSubHandler);
// 1 - allows posting notices && allows reading profile data
$permission = 1;
$authSubURL .= '&permission=' . $permission;
return '<a href="' . $authSubURL . '">Click here to link your H9 Account</a>';
}
示例10: _getAuthSubUrl
function _getAuthSubUrl()
{
if (!empty($this->subdomain)) {
$next = 'http://' . $_SERVER["HTTP_HOST"] . '/' . 'signin/callback/';
} else {
$next = $this->config->item('base_url') . 'signin/callback/';
}
$scope = 'http://gdata.youtube.com http://picasaweb.google.com/data';
$secure = false;
$session = true;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例11: getAuthSubUrl
public function getAuthSubUrl($args) {
// Security check
$this->throwForbiddenUnless(SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_READ));
$next = ModUtil::func('IWagendas', 'user', 'getCurrentUrl');
$scope = 'http://www.google.com/calendar/feeds/';
$session = true;
$secure = false;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例12:
<?php
require_once __MLC__ . '/google/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_YouTube_VideoQuery');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_App_Exception');
$scope = 'http://gdata.youtube.com';
$secure = false;
$session = true;
$nextUrl = 'http://' . $_SERVER['SERVER_NAME'] . __PHP_ASSETS__ . '/youtube/youtubeAuth.php';
$url = Zend_Gdata_AuthSub::getAuthSubTokenUri($nextUrl, $scope, $secure, $session);
?>
<a href="<?php
_p($url);
?>
" target='_blank'>
<strong>Click here to authenticate with YouTube</strong>
</a>
示例13: getAuthSubRequestUrl
function getAuthSubRequestUrl()
{
$next = "http://" . $_SERVER['SERVER_NAME'] . $this->base . "/yts/process/";
$scope = 'http://gdata.youtube.com';
$secure = false;
$session = true;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例14: createLoginUrl
/**
* Get the URL for the AuthSub login page.
*
* @return string The URL
*/
function createLoginUrl()
{
$next = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}";
$scope = 'http://gdata.youtube.com';
$secure = false;
$session = true;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例15: session_start
* Google Base location
*/
$uri = Zend_Gdata_Base::BASE_FEED_URI;
session_start();
if (!isset($_SESSION['base_token'])) {
if (isset($_GET['token'])) {
/**
* Convert the single-use token to a session token.
*/
$session_token = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);
$_SESSION['base_token'] = $session_token;
} else {
/**
* Display a link to generate a single-use token.
*/
$googleUri = Zend_Gdata_AuthSub::getAuthSubTokenUri('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'], $uri, 0, 1);
echo "Click <a href='{$googleUri}'>here</a> to authorize this application.";
exit;
}
}
/**
* Create an authenticated HTTP Client to talk to Google.
*/
$client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['base_token']);
/**
* Submit query to Google Base
*/
$q = '';
if (isset($_GET['q']) && $_GET['q']) {
$q = $_GET['q'];
if (get_magic_quotes_gpc()) {