コード例 #1
0
ファイル: AlbumCommand.php プロジェクト: vearutop/travel-blog
 public function performAction()
 {
     if (!($user = AuthService::getInstance()->getUser())) {
         throw new \Exception('Authenticated user required');
     }
     parent::performAction();
 }
コード例 #2
0
ファイル: Application.php プロジェクト: vearutop/travel-blog
 public function performAction()
 {
     if ($user = AuthService::getInstance()->getUser()) {
         $this->response->addContent('Hello, ' . $user->urlName . ' ');
         $this->response->addContent(new Anchor('Sign out', $this->io->makeAnchor(SignOut::createState())));
     }
     //else {
     $this->response->addContent(new Anchor('vk auth', $this->io->makeAnchor(VkAuth::createState())));
     //}
     if (null === $this->action) {
         $this->response->error("Page not found");
         return;
     }
     parent::performAction();
 }