本文整理匯總了PHP中Flyspray::checkForOauthUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flyspray::checkForOauthUser方法的具體用法?PHP Flyspray::checkForOauthUser怎麽用?PHP Flyspray::checkForOauthUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flyspray
的用法示例。
在下文中一共展示了Flyspray::checkForOauthUser方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
// Try to get an access token
try {
$token = $obj->getAccessToken('authorization_code', array('code' => $_GET['code']));
} catch (\League\OAuth2\Client\Exception\IDPException $e) {
throw new Exception($e->getMessage());
}
}
$user_details = $obj->getUserDetails($token);
$uid = $user_details->uid;
if (Post::has('username')) {
$username = Post::val('username');
} else {
$username = $user_details->nickname;
}
// First time logging in
if (!Flyspray::checkForOauthUser($uid, $provider)) {
if (!$user_details->email) {
Flyspray::show_error(27);
}
$success = false;
if ($username) {
$group_in = $fs->prefs['anon_group'];
$name = $user_details->name ?: $username;
$success = Backend::create_user($username, null, $name, '', $user_details->email, 0, 0, $group_in, 1, $uid, $provider);
}
// username taken or not provided, ask for it
if (!$success) {
$_SESSION['oauth_token'] = serialize($token);
$_SESSION['oauth_provider'] = $provider;
$page->assign('provider', ucfirst($provider));
$page->assign('username', $username);