public function indexAction($boardroom = null) { $currentBoardroom = isset($boardroom) && !empty($boardroom) ? $boardroom : 1; $boardrooms = Config::get('calendar/boardrooms'); $context = ['currentBoardroom' => $currentBoardroom, 'boardrooms' => $boardrooms, 'flash' => Session::flash('home')]; $employee = new Employee(); if ($employee->hasPermission('admin')) { $context['admin'] = true; } echo $this->view('home/index', $context); }
public function sendMailToAllAction() { $context = []; $employee = new Employee(); if (!$employee->hasPermission('admin')) { Redirect::to('home'); } if (Input::exists()) { if (!Token::check(Input::get('token'))) { Redirect::to(); } $data = ['subject' => Input::get('subject'), 'body' => Input::get('body')]; $success = $this->model()->sendMailToAll($data); if ($success) { Redirect::to('employee'); } else { $context['errors'] = $this->model()->getErrors(); $context['values'] = $data; } } $context['flash'] = Session::flash('home'); $context['token'] = Token::generate(); echo $this->view('employee/sendmailtoall', $context); }