本文整理汇总了PHP中TBGSettings::getOpenIDStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGSettings::getOpenIDStatus方法的具体用法?PHP TBGSettings::getOpenIDStatus怎么用?PHP TBGSettings::getOpenIDStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGSettings
的用法示例。
在下文中一共展示了TBGSettings::getOpenIDStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getByOpenID
/**
* Return (or create, assuming no external auth backend) a user based on
* a provided openid identity
*
* @param string $identity
*
* @return TBGUser
*/
public static function getByOpenID($identity)
{
$user = null;
if ($user_id = TBGOpenIdAccountsTable::getTable()->getUserIDfromIdentity($identity)) {
$user = TBGContext::factory()->TBGUser($user_id);
} elseif (!TBGSettings::isUsingExternalAuthenticationBackend() && TBGSettings::getOpenIDStatus() == 'all') {
$user = new TBGUser();
$user->setPassword(TBGUser::createPassword());
$user->setUsername(TBGUser::createPassword() . TBGUser::createPassword());
$user->setOpenIdLocked();
$user->setActivated();
$user->setEnabled();
$user->setValidated();
$user->save();
}
return $user;
}
示例2: __
><?php
echo __('Users can register with OpenID and link OpenID to existing accounts');
?>
</option>
<option value="existing"<?php
if (TBGSettings::getOpenIDStatus() == 'existing') {
?>
selected<?php
}
?>
><?php
echo __('Users can only link OpenID logins with existing accounts');
?>
</option>
<option value="none"<?php
if (TBGSettings::getOpenIDStatus() == 'none') {
?>
selected<?php
}
?>
><?php
echo __('OpenID authentication is disabled');
?>
</option>
</select>
<?php
} else {
?>
<div class="faded_out"><?php
echo __('OpenID support is not available when not using internal authentication');
?>