本文整理汇总了PHP中bizley\podium\models\User::createInheritedAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP User::createInheritedAccount方法的具体用法?PHP User::createInheritedAccount怎么用?PHP User::createInheritedAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bizley\podium\models\User
的用法示例。
在下文中一共展示了User::createInheritedAccount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Creates inherited user account.
* @throws Exception
*/
public function init()
{
parent::init();
if (!Yii::$app->user->isGuest) {
if (PodiumModule::getInstance()->userComponent == PodiumModule::USER_INHERIT) {
$user = User::findMe();
if (empty($user)) {
if (User::createInheritedAccount()) {
$this->success(Yii::t('podium/flash', 'Hey! Your new forum account has just been automatically created! Go to {link} to complement it.', ['link' => Html::a(Yii::t('podium/view', 'Profile'))]));
} else {
throw new Exception(Yii::t('podium/view', 'There was an error while creating inherited user account. Podium can not run with the current configuration. Please contact administrator about this problem.'));
}
}
} else {
$user = Yii::$app->user->identity;
}
if ($user->status == User::STATUS_BANNED) {
return $this->redirect(['default/ban']);
}
if ($user && !empty($user->timezone)) {
Yii::$app->formatter->timeZone = $user->timezone;
}
}
}