コード例 #1
0
 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');
 }
コード例 #2
0
ファイル: Common.php プロジェクト: romeoz/rock-captcha
 /**
  * Exists session.
  * @return bool
  */
 public function existsSession()
 {
     return $this->session->hasFlash($this->sessionKey);
 }
コード例 #3
0
ファイル: Captcha.php プロジェクト: romeoz/rock
 /**
  * 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));
 }