本文整理汇总了PHP中Zend_Gdata_AuthSub::AuthSubRevokeToken方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_AuthSub::AuthSubRevokeToken方法的具体用法?PHP Zend_Gdata_AuthSub::AuthSubRevokeToken怎么用?PHP Zend_Gdata_AuthSub::AuthSubRevokeToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata_AuthSub
的用法示例。
在下文中一共展示了Zend_Gdata_AuthSub::AuthSubRevokeToken方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stripslashes
if (get_magic_quotes_gpc()) {
$q = stripslashes($q);
}
$gdata = new Zend_Gdata_Base($client);
$gdata->setQuery($q);
$feed = $gdata->getBaseFeed();
}
/**
* Filter php_self to avoid a security vulnerability.
*/
$php_self = htmlentities(substr($_SERVER['PHP_SELF'], 0, strcspn($_SERVER['PHP_SELF'], "\n\r")), ENT_QUOTES);
/**
* Logout and revoke AuthSub token when we are done with it.
*/
if (isset($_GET['logout'])) {
Zend_Gdata_AuthSub::AuthSubRevokeToken($_SESSION['base_token']);
unset($_SESSION['base_token']);
header('Location: ' . $php_self);
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Google Base Demo</title>
<style>
body{ font-family: Arial; }
input,select{font-size: 32px;}
</style>
</head>
示例2: revokeToken
function revokeToken($client)
{
$sessionToken = $client->getAuthSubToken();
return Zend_Gdata_AuthSub::AuthSubRevokeToken($sessionToken, $client);
}
示例3: testAuthSubRevokeTokenCatchesHttpClientException
/**
* @expectedException Zend_Gdata_App_HttpException
*/
public function testAuthSubRevokeTokenCatchesHttpClientException()
{
$adapter = new Zend_Http_Client_Adapter_Test();
$adapter->setNextRequestWillFail(true);
$client = new Zend_Gdata_HttpClient();
$client->setUri('http://example.com/AuthSub');
$client->setAdapter($adapter);
$revoked = Zend_Gdata_AuthSub::AuthSubRevokeToken($this->token, $client);
}
示例4: logout
/**
* If there are some discrepancies in the session or user
* wants not to connect his/her Google Calendars with ATutor
* then this function will securely log out the user.
*
* @return void
*/
public function logout()
{
// Carefully construct this value to avoid application security problems.
$php_self = htmlentities(substr($_SERVER['PHP_SELF'], 0, strcspn($_SERVER['PHP_SELF'], "\n\r")), ENT_QUOTES);
//Revoke access for the stored token
Zend_Gdata_AuthSub::AuthSubRevokeToken($_SESSION['sessionToken']);
unset($_SESSION['sessionToken']);
//Close this popup window
echo "<script>window.opener.location.reload(true);window.close();</script>";
exit;
}
示例5: revokeTokenAction
public function revokeTokenAction()
{
$this->_helper->layout->disableLayout();
Zend_Gdata_AuthSub::AuthSubRevokeToken($_SESSION['sessionToken']);
unset($_SESSION['sessionToken']);
}