本文整理汇总了PHP中OAuthServer::setParam方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuthServer::setParam方法的具体用法?PHP OAuthServer::setParam怎么用?PHP OAuthServer::setParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuthServer
的用法示例。
在下文中一共展示了OAuthServer::setParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OAuthException
<?php
// Users "authorize" a request token here. This first involves logging in to a Coppermine account. An application "consuming" the API should direct users here once they have received a request token.
require 'cpgOAuth.php';
define('IN_COPPERMINE', true);
require_once 'include/init.inc.php';
$token = $superCage->get->getAlnum('oauth_token');
$authorized = $superCage->get->getAlnum('authorized');
if ($token == '') {
throw new OAuthException('No "oauth_token" provided via HTTP GET.');
}
$server = new OAuthServer();
$server->setParam('oauth_token', $token, true);
$rs = $server->authorizeVerify();
if ($authorized == 'yes') {
$server->authorizeFinish(true, USER_ID);
api_message('Token "' . $rs['token'] . '" authorized.');
} else {
if ($authorized == 'no') {
$server->authorizeFinish(false, USER_ID);
api_message('Token "' . $rs['token'] . '" deleted.');
} else {
$store = OAuthStore::instance();
$consumer = $store->getConsumerInfo($rs['consumer_id']);
if (!USER_ID) {
print 'Please <a href="../login.php?referer=oauth/authorize.php?oauth_token=' . $token . '">login</a> to your user account.<br />';
print 'Access this gallery anonymously with the application "' . $consumer[0]['application_title'] . '"?';
print '<br /><br />';
} else {
print 'Would you like to allow "' . $consumer[0]['application_title'] . '" to access your photos from this site?';
print '<br /><br />';