コード例 #1
0
ファイル: Base.php プロジェクト: vincium/lot
 public function __construct(\Rebond\App $app)
 {
     if ($app->site()->getStatus() == \Rebond\Core\StatusType::INACTIVE) {
         Util\Session::redirect('/error/maintenance');
     }
     parent::__construct($app);
     if ($this->signedUser->getId() != 0) {
         $this->player = \Own\Bus\Player\Data::loadByUserId($this->signedUser->getId());
         if ($this->player == null) {
             $this->player = \Own\Bus\Player\Service::create($this->signedUser);
         }
     } else {
         $this->player = new \Own\Bus\Player\Model();
     }
 }
コード例 #2
0
ファイル: Base.php プロジェクト: vincium/resa
 public function __construct(\Rebond\App $app)
 {
     if ($app->site()->getStatus() == \Rebond\Core\StatusType::INACTIVE) {
         if ($app->ajax()) {
             return ['result' => ResultType::ERROR, 'message' => Lang::lang('error.maintenance')];
         } else {
             Util\Session::redirect('/error/maintenance');
         }
     }
     parent::__construct($app);
     if ($this->signedUser->getId() != 0) {
         $options = ['where' => [['id = ?', $this->signedUser->getId()]]];
         $this->player = \Own\Bus\Player\Data::load($options);
         if ($this->player == null) {
             $this->player = \Own\Bus\Player\Service::create($this->signedUser);
         }
     } else {
         $this->player = new \Own\Bus\Player\Model();
     }
 }
コード例 #3
0
ファイル: Profile.php プロジェクト: vincium/resa
 public function register()
 {
     $userGadget = new \Own\App\User\Gadget($this->app);
     $register = $userGadget->register();
     $this->signedUser = $this->app->user();
     if ($this->signedUser->getId() != 0) {
         $player = \Own\Bus\Player\Data::loadById($this->signedUser->getId());
         if ($player == null) {
             $player = \Own\Bus\Player\Service::create($this->signedUser);
         }
     }
     return $this->response('tpl-default', ['title' => Util\Lang::lang('profile')], 'layout-home', ['column1' => $register]);
 }
コード例 #4
0
ファイル: Profile.php プロジェクト: vincium/lot
 public function register()
 {
     $userGadget = new \Own\App\User\Gadget($this->app);
     $register = $userGadget->register();
     $this->signedUser = $this->app->user();
     if ($this->signedUser->getId() != 0) {
         $player = \Own\Bus\Player\Data::loadByUserId($this->signedUser->getId());
         if ($player == null) {
             $player = \Own\Bus\Player\Service::create($this->signedUser);
         }
         $player->setActive(true);
         $player->save();
     }
     $email = Util\Converter::toString('email', 'post');
     if (isset($email)) {
         $user = \Rebond\Core\User\Data::loadByEmail($email);
     }
     // view
     $this->setTpl();
     // layout
     $this->tplLayout->set('column1', $register);
     // template
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-center'));
     return $this->tplMaster->render('tpl-default');
 }