本文整理匯總了PHP中LightOpenID::__set方法的典型用法代碼示例。如果您正苦於以下問題:PHP LightOpenID::__set方法的具體用法?PHP LightOpenID::__set怎麽用?PHP LightOpenID::__set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LightOpenID
的用法示例。
在下文中一共展示了LightOpenID::__set方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: steam_redirect
/**
*
* Steam Redirect - steam_redirect
* - - - - - - - - - - - - - - -
* @desc Redirects the browser to Steam OpenID website for login.
* @since 1.0
* @version 1.6
*
*/
function steam_redirect()
{
global $mybb, $db;
// Check if the user is logged in or not.
if ($mybb->user['uid'] == 0) {
// Get the Steam API key set in settings.
$get_key = $db->fetch_array($db->simple_select("settings", "name, value", "name = 'steamlogin_api_key'"));
if ($get_key['value'] == null) {
// The Steam API key hasn't been set, so stop the script and output error message.
die("<strong>Not Configured</strong> The Steam Login plugin hasn't been configured correctly. Please ensure an API key is set in the Configuration settings.");
} else {
// close if($get_key['value'] == null)
// Do a check for required profile fields.
$count_required_fields = $db->num_rows($db->simple_select("profilefields", "*", "required = '1'"));
$return_url = '/misc.php?action=steam_return';
//Set options for the OpenID library.
require_once MYBB_ROOT . 'inc/class_lightopenid.php';
$SteamOpenID = new LightOpenID();
$SteamOpenID->returnUrl = $mybb->settings['bburl'] . $return_url;
$SteamOpenID->__set('realm', $mybb->settings['bburl'] . $return_url);
$SteamOpenID->identity = 'http://steamcommunity.com/openid';
// Redirect directly to Steam.
redirect($SteamOpenID->authUrl(), 'You are being redirect to Steam to authenticate your account for use on our website.', 'Login via Steam');
}
// close else
}
// close if($mybb->user['uid'] == 0)
}