当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Gdata_AuthSub类代码示例

本文整理汇总了PHP中Zend_Gdata_AuthSub的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_AuthSub类的具体用法?PHP Zend_Gdata_AuthSub怎么用?PHP Zend_Gdata_AuthSub使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Zend_Gdata_AuthSub类的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: getAuthSubHttpClient

function getAuthSubHttpClient()
{
    if (isset($_SESSION['google_session_token'])) {
        $client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['google_session_token']);
        return $client;
    }
}
开发者ID:vaibhav734,项目名称:Facebook-Album,代码行数:7,代码来源:move_to_picasa.php

示例3: 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

示例4: 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:ntemple,项目名称:intelli-plancake,代码行数:9,代码来源:AuthSubTest.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: includes

 public function includes()
 {
     set_include_path(PLUGIN_DIR . "wildfire.media.youtube/ZendGdata/library/");
     require_once PLUGIN_DIR . 'wildfire.media.youtube/ZendGdata/library/Zend/Loader.php';
     Zend_Loader::loadClass('Zend_Gdata_YouTube');
     Zend_Loader::loadClass('Zend_Gdata_AuthSub');
     Zend_Loader::loadClass('Zend_Gdata_App_Exception');
     $httpClient = Zend_Gdata_AuthSub::getHttpClient(Config::get('youtube/token'));
     return new Zend_Gdata_YouTube($httpClient, 0, 0, Config::get('youtube/developer_key'));
 }
开发者ID:phpwax,项目名称:wildfire.media.youtube,代码行数:10,代码来源:WildfireYoutubeFile.php

示例7: updateAuthSubToken

/**
 * Upgrade the single-use token to a session token.
 *
 * @param string $singleUseToken A valid single use token that is upgradable to a session token.
 * @return void
 */
function updateAuthSubToken($singleUseToken)
{
    try {
        $sessionToken = Zend_Gdata_AuthSub::getAuthSubSessionToken($singleUseToken);
    } catch (Zend_Gdata_App_Exception $e) {
        print 'ERROR - Token upgrade for ' . $singleUseToken . ' failed : ' . $e->getMessage();
        return;
    }
    $_SESSION['sessionToken'] = $sessionToken;
    header('Location: ' . HOME_URL);
}
开发者ID:kevinmel2000,项目名称:Youtube-API-Sample,代码行数:17,代码来源:function.php

示例8: 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

示例9: getAuthSubHttpClient

 /**
  * Returns a HTTP client object with the appropriate headers for communicating
  * with Google using AuthSub authentication.
  *
  * Uses the $_SESSION['sessionToken'] to store the AuthSub session token after
  * it is obtained.  The single use token supplied in the URL when redirected
  * after the user succesfully authenticated to Google is retrieved from the
  * $_GET['token'] variable.
  *
  * @return Zend_Http_Client
  */
 function getAuthSubHttpClient()
 {
     global $_SESSION, $_GET;
     $client = new Zend_Gdata_HttpClient();
     if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) {
         $_SESSION['sessionToken'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token'], $client);
     }
     if (empty($_SESSION['sessionToken'])) {
         return null;
     }
     $client->setAuthSubToken($_SESSION['sessionToken']);
     return $client;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:24,代码来源:import.php

示例10: getAuthSubHttpClient

 function getAuthSubHttpClient($mmm_id, $username)
 {
     if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) {
         $this->redirect('/yts/index/');
         exit;
         return false;
     } else {
         if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) {
             $_SESSION['sessionToken'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);
             $sessionToken = $_SESSION['sessionToken'];
             $this->time = time();
             $this->record['Yt']['mmm_id'] = $mmm_id;
             $this->record['Yt']['sessionToken'] = $sessionToken;
             $this->record['Yt']['status'] = '1';
             $this->record['Yt']['etime'] = $this->time;
             /*$qry="insert into yt_login(mmm_id , user_id ,sessionToken , status) values
             	 ('$mmm_id', '$username' , '$sessionToken', '1')";
             	 $result = mysql_query($qry);
             	 */
         }
     }
     $httpClient = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']);
     return $httpClient;
 }
开发者ID:hilkeros,项目名称:MMM-php-cake,代码行数:24,代码来源:yts_controller.php

示例11: getAuthSubHttpClient

/**
 * Returns a HTTP client object with the appropriate headers for communicating
 * with Google using AuthSub authentication.
 *
 * Uses the $_SESSION['sessionToken'] to store the AuthSub session token after
 * it is obtained.  The single use token supplied in the URL when redirected
 * after the user succesfully authenticated to Google is retrieved from the
 * $_GET['token'] variable.
 *
 * @return Zend_Http_Client
 */
function getAuthSubHttpClient()
{
    global $_SESSION, $_GET, $_authSubKeyFile, $_authSubKeyFilePassphrase;
    $client = new Zend_Gdata_HttpClient();
    if ($_authSubKeyFile != null) {
        // set the AuthSub key
        $client->setAuthSubPrivateKeyFile($_authSubKeyFile, $_authSubKeyFilePassphrase, true);
    }
    if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) {
        $_SESSION['sessionToken'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token'], $client);
    }
    $client->setAuthSubToken($_SESSION['sessionToken']);
    return $client;
}
开发者ID:natureday1,项目名称:Life,代码行数:25,代码来源:Calendar.php

示例12: str_repeat

        } else {
            if (preg_match('/^<\\/.+>$/', $el)) {
                $indent -= $level;
                // closing tag, decrease indent
            }
            if ($indent < 0) {
                $indent += $level;
            }
            $pretty[] = str_repeat(' ', $indent) . $el;
        }
    }
    $xml = implode("\n", $pretty);
    return $html_output ? htmlentities($xml) : $xml;
}
$sessionToken = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);
$client = Zend_Gdata_AuthSub::getHttpClient($sessionToken);
$useH9Sandbox = true;
$healthService = new Zend_Gdata_Health($client, 'MyGHAppNamev1.0', $useH9Sandbox);
$query = new Zend_Gdata_Health_Query();
$query->setDigest("true");
$profileFeed = $healthService->getHealthProfileFeed($query);
$entry = $profileFeed->entry[0];
//To print ccr
$ccr = $entry->getCcr();
$xmlStr = $ccr->saveXML($ccr);
echo '<p>' . xmlpp($xmlStr, true) . '</p>';
// digest=true was set so we only have 1 entry
$allergies = $entry->getCcr()->getAllergies();
$conditions = $entry->getCcr()->getConditions();
$immunizations = $entry->getCcr()->getImmunizations();
$lab_results = $entry->getCcr()->getLabResults();
开发者ID:ravikiran438,项目名称:GoogleHealthApp,代码行数:31,代码来源:test1.php

示例13: getAuthSubHttpClient

/**
 * Convenience method to obtain an authenticted Zend_Http_Client object.
 *
 * @return Zend_Http_Client An authenticated client.
 */
function getAuthSubHttpClient()
{
    try {
        $httpClient = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']);
    } catch (Zend_Gdata_App_Exception $e) {
        print 'ERROR - Could not obtain authenticated Http client object. ' . $e->getMessage();
        return;
    }
    $httpClient->setHeaders('X-GData-Key', 'key=' . $_SESSION['developerKey']);
    return $httpClient;
}
开发者ID:holdensmagicalunicorn,项目名称:copperFramework,代码行数:16,代码来源:operations.php

示例14: revokeToken

function revokeToken($client)
{
    $sessionToken = $client->getAuthSubToken();
    return Zend_Gdata_AuthSub::AuthSubRevokeToken($sessionToken, $client);
}
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:5,代码来源:Health.php

示例15: getAuthSubHttpClient

    public function getAuthSubHttpClient() {
        // Security check
        $this->throwForbiddenUnless(SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_READ));

        //global $_SESSION, $_GET, $_authSubKeyFile, $_authSubKeyFilePassphrase;
        $client = new Zend_Gdata_HttpClient();
        if ($_authSubKeyFile != null) {
            // set the AuthSub key
            $client->setAuthSubPrivateKeyFile($_authSubKeyFile, $_authSubKeyFilePassphrase, true);
        }
        if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) {
            $_SESSION['sessionToken'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token'], $client);
        }
        $client->setAuthSubToken($_SESSION['sessionToken']);
        return $client;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:16,代码来源:User.php


注:本文中的Zend_Gdata_AuthSub类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。