public function actionIndex(User $user, Session $session) { $placeholders = []; if ($session->hasFlash($this->keySessionFlash)) { $placeholders['content'] = i18n::t('successActivate'); return $this->render('success', $placeholders); } elseif ($user->isGuest() && ($users = Users::activate(Request::get('token')))) { // auto-login $user->addMulti($users->toArray(['id', 'username', 'url'])); $user->login(); $session->setFlash($this->keySessionFlash); $this->response->redirect(Url::set()->removeAllArgs()->getAbsoluteUrl(true))->send(true); return null; } return $this->notPage('@frontend.views/layouts/notPage'); }
/** * Exists session. * @return bool */ public function existsSession() { return $this->session->hasFlash($this->sessionKey); }
/** * Exists session by code of captcha. * * @param string|null $name * @return bool */ public function existsSession($name = null) { return $this->session->hasFlash(Helper::getValue($name, $this->sessionName)); }