當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Gdata_AuthSub::getAuthSubTokenUri方法代碼示例

本文整理匯總了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;
}
開發者ID:eva-chaunm,項目名稱:paraflow,代碼行數:27,代碼來源:ocr.php

示例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);
}
開發者ID:sidramaraddy,項目名稱:facebook-albums-challenge,代碼行數:8,代碼來源:google_login.php

示例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);
 }
開發者ID:GEANT,項目名稱:CORE,代碼行數:13,代碼來源:GoogleTest.php

示例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);
}
開發者ID:automatweb,項目名稱:automatweb_dev,代碼行數:17,代碼來源:Gbase.php

示例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);
 }
開發者ID:abdullahbutt,項目名稱:Codeigniter-Gcal,代碼行數:19,代碼來源:Gcal.php

示例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);
 }
開發者ID:omusico,項目名稱:logica,代碼行數:9,代碼來源:AuthSubTest.php

示例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;
}
開發者ID:kevinmel2000,項目名稱:Youtube-API-Sample,代碼行數:10,代碼來源:function.php

示例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);
 }
開發者ID:genaromendezl,項目名稱:ATutor,代碼行數:22,代碼來源:googlecalendar.class.php

示例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>';
}
開發者ID:ravikiran438,項目名稱:GoogleHealthApp,代碼行數:13,代碼來源:ghmytake1.php

示例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);
 }
開發者ID:ki8asui,項目名稱:isography,代碼行數:12,代碼來源:base_controller.php

示例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);
    }
開發者ID:projectesIF,項目名稱:Sirius,代碼行數:10,代碼來源:User.php

示例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>
開發者ID:schematical,項目名稱:MJax2.0,代碼行數:19,代碼來源:youtube_iframe.php

示例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);
 }
開發者ID:hilkeros,項目名稱:MMM-php-cake,代碼行數:8,代碼來源:yts_controller.php

示例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);
}
開發者ID:hamik112,項目名稱:gdata-samples,代碼行數:13,代碼來源:get_activity.php

示例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()) {
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:31,代碼來源:Base-AuthSub.php


注:本文中的Zend_Gdata_AuthSub::getAuthSubTokenUri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。