public function status() { $signedUser = $this->app->user(); if (isset($_POST['sign-out'])) { \Rebond\Core\UserSecurity\Service::signOut($signedUser); } $tpl = new Util\Template(Util\Template::MODULE, ['app', 'User']); if (Util\Auth::isAuth($signedUser)) { $tpl->set('email', $signedUser->getEmail()); } return $tpl->render('status'); }
public function index() { if (isset($_POST['sign-out'])) { \Rebond\Core\UserSecurity\Service::signOut($this->signedUser); } // main $tplMain = new Util\Template(Util\Template::SITE, ['www']); if ($this->player->getId() == 0) { $tpl = 'index-guest'; $matchView = \Own\Bus\Match\Data::loadLastMatch(); } else { $tpl = 'index'; $matchView = \Own\Bus\Match\Data::loadRecentByPlayerId($this->player->getId()); $nextMatch = \Own\Bus\Match\Data::loadNextMatchByPlayerId($this->player->getId()); $soon = isset($nextMatch) && $nextMatch->getScheduled() < time() + Engine::DAY * 360 ? true : false; $tplMain->set('player', $this->player); $tplMain->set('notificationCount', \Own\Bus\Notification\Data::countByPlayerId($this->player->getId())); $tplMain->set('isBonusDayXp', $this->player->isBonusDayXp()); $tplMain->set('nextBonusDayXp', $this->player->getNextBonusDayXp()); $tplMain->set('nextMatch', $nextMatch); $tplMain->set('soon', $soon); } $tplMain->set('matchView', $matchView); $options = []; $options['where'][] = 'configuration.property = \'nextWeek\''; $nextWeek = \Own\Bus\Configuration\Data::load($options); $options = []; $options['where'][] = 'configuration.property = \'nextMonth\''; $nextMonth = \Own\Bus\Configuration\Data::load($options); $options = []; $options['where'][] = 'configuration.property = \'nextYear\''; $nextYear = \Own\Bus\Configuration\Data::load($options); if (!isset($nextWeek, $nextMonth, $nextYear)) { Util\error::kill(Util\Code::UNHANDLED_ERROR, 'nextWeek, nextMonth or nextYear is not set in bus_configuration', __FILE__, __LINE__); } $tplMain->set('gameTime', Engine::renderTime($this->app->site()->getCreatedDate())); $tplMain->set('endWeek', (new Util\DateTime())->setTimestamp($nextWeek->getValue())); $tplMain->set('endMonth', (new Util\DateTime())->setTimestamp($nextMonth->getValue())); $tplMain->set('endYear', (new Util\DateTime())->setTimestamp($nextYear->getValue())); // view $this->setTpl(); // layout $this->tplLayout->set('column1', $tplMain->render($tpl)); // template $this->tplMaster->set('layout', $this->tplLayout->render('layout-center')); return $this->tplMaster->render('tpl-default'); }
public function index() { // auth Util\Auth::isAuthorized($this->signedUser, 'member', false, '/profile/sign-in'); if (isset($_POST['sign-out'])) { \Rebond\Core\UserSecurity\Service::signOut($this->signedUser); } // view $this->setTpl(); // main $tplMain = new Util\Template(Util\Template::SITE, ['www']); // layout $this->tplLayout->set('column1', $tplMain->render('index')); // template $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col')); return $this->tplMaster->render('tpl-default'); }
public function status(\Own\Bus\Player\Model $player) { $signedUser = $this->app->user(); if (isset($_POST['sign-out'])) { \Rebond\Core\UserSecurity\Service::signOut($signedUser); } $tpl = new Util\Template(Util\Template::MODULE, ['app', 'User']); if (Util\Auth::isAuth($signedUser)) { $tpl->set('user', $signedUser); $tpl->set('player', $player); $today = new Util\DateTime(); $options = []; $options['join'][] = 'bus_player_membership player_membership ON player_membership.membership_id = membership.id'; $options['where'][] = ['player_membership.player_id = ?', $signedUser->getId()]; $options['where'][] = ['membership.end_date >= ?', $today->format('date')]; $memberships = \Own\Bus\Membership\Data::loadAll($options); $tpl->set('memberships', $memberships); } return $tpl->render('status'); }
public function sign_out() { \Rebond\Core\UserSecurity\Service::signOut($this->signedUser); }