本文整理汇总了PHP中UserAccount::isUserActive方法的典型用法代码示例。如果您正苦于以下问题:PHP UserAccount::isUserActive方法的具体用法?PHP UserAccount::isUserActive怎么用?PHP UserAccount::isUserActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAccount
的用法示例。
在下文中一共展示了UserAccount::isUserActive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activateAction
function activateAction()
{
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$session = SessionWrapper::getInstance();
$formvalues = $this->_getAllParams();
if (!isArrayKeyAnEmptyString('id', $formvalues)) {
// debugMessage($formvalues);
$user = new UserAccount();
$user->populate(decode($formvalues['id']));
// debugMessage($user->toArray()); // exit;
if ($user->isUserActive() && isEmptyString($user->getActivationKey())) {
// account already activated
$session->setVar(ERROR_MESSAGE, 'Account is already activated. Please login.');
$this->_helper->redirector->gotoUrl($this->view->baseUrl("user/login"));
}
$this->_setParam(URL_FAILURE, encode($this->view->baseUrl("signup/confirm/id/" . encode($user->getID()))));
$key = $this->_getParam('actkey');
$this->view->result = $user->activateAccount($key);
// exit();
if (!$this->view->result) {
// activation failed
$this->view->message = $user->getErrorStackAsString();
$session->setVar(FORM_VALUES, $this->_getAllParams());
$session->setVar(ERROR_MESSAGE, $user->getErrorStackAsString());
// debugMessage('error '.$user->getErrorStackAsString());
} else {
# send activation confirmation
$user->sendActivationConfirmationNotification();
$session->setVar(SUCCESS_MESSAGE, "Account activated successfully. Please login to start.");
}
}
$this->_helper->redirector->gotoUrl($this->view->baseUrl("user/login"));
// exit;
}