本文整理汇总了PHP中OAuth::there_is_error方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuth::there_is_error方法的具体用法?PHP OAuth::there_is_error怎么用?PHP OAuth::there_is_error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuth
的用法示例。
在下文中一共展示了OAuth::there_is_error方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
if ($_SERVER['REQUEST_METHOD'] != 'GET' && $_SERVER['REQUEST_METHOD'] != 'POST') {
echo 'Invalid request method.';
exit;
} elseif (isset($_REQUEST['oauth_version']) && $_REQUEST['oauth_version'] != '1.0') {
echo 'Invalid OAuth version.';
exit;
}
if (isset($_REQUEST['oauth_consumer_key'], $_REQUEST['oauth_nonce'], $_REQUEST['oauth_signature_method'], $_REQUEST['oauth_signature'], $_REQUEST['oauth_timestamp']) && $_REQUEST['oauth_signature_method'] != '') {
require_once $C->INCPATH . 'classes/class_oauth.php';
$oauth_client = new OAuth($_REQUEST['oauth_consumer_key'], $_REQUEST['oauth_nonce'], $_REQUEST['oauth_signature'], $_REQUEST['oauth_timestamp']);
if (isset($_REQUEST['oauth_version'])) {
$oauth_client->set_variable('version', '1.0');
}
if ($oauth_client->is_valid_consumer_key() && $oauth_client->is_valid_nonce() && $oauth_client->is_valid_timestamp() && strtolower(urldecode($_REQUEST['oauth_signature_method'])) == 'hmac-sha1' && $oauth_client->decrypt_hmac_sha1() && $oauth_client->is_valid_application()) {
$oauth_client->set_variable('token_secret', $oauth_client->generate_random_value());
$oauth_client->set_variable('request_token', $oauth_client->generate_request_token());
if ($oauth_client->set_request_table()) {
echo 'oauth_token_secret=' . $oauth_client->get_variable('token_secret');
echo '&oauth_token=' . $oauth_client->get_variable('request_token') . '&oauth_callback_confirmed=true';
} else {
echo $oauth_client->get_variable('error_msg');
exit;
}
} else {
echo $oauth_client->there_is_error() ? $oauth_client->get_variable('error_msg') : 'Invalid signature method';
exit;
}
} else {
echo 'Missing OAuth parameter(s).';
exit;
}
示例2:
echo $oauth_client->get_variable('error_msg');
} else {
$callback = $oauth_client->get_field_in_table('applications', 'callback_url', 'app_id', $oauth_client->get_value_in_consumer_key('app_id'));
$oauth_client->log();
if ($callback) {
$this->redirect($callback . '?oauth_token=' . $_GET['oauth_token'] . '&oauth_verifier=' . $verifier);
exit;
} else {
echo '<p style="width: auto; text-align: center;">Your verifier is: <b>' . $verifier . '</b>.You should enter it manually at your service provider.</p><div class="klear"></div>';
$snow_form = false;
}
}
}
}
}
if (isset($_GET['oauth_token']) && $snow_form && $oauth_client->is_valid_request_token(true) && !$oauth_client->there_is_error()) {
$oauth_client->set_variable('consumer_key', $oauth_client->get_field_in_table('oauth_request_token', 'consumer_key', 'request_token', $_GET['oauth_token']));
$app_name = $oauth_client->get_field_in_table('applications', 'name', 'app_id', $oauth_client->get_value_in_consumer_key('app_id'));
?>
<div id="poblicpage_login">
<form method="post" action="<?php
echo $C->SITE_URL . 'oauth/authorize?oauth_token=' . $_GET['oauth_token'];
?>
">
<?php
if (!$user->is_logged) {
?>
<table id="regform" cellspacing="5">
<tr>