/** * - Validate the user is allowed to be here. * - Redirect if no user id is set in the session. * - Set any messages that need to be displayed. * * @return void */ public function __construct() { if ($_SERVER['HTTP_HOST'] != 'local.restaurants.com') { $this->loadView('404'); } if (!isset($_SESSION['user']['id'])) { header('Location: /signin/'); exit; } $this->db = new Db(); $this->user_id = $_SESSION['user']['id']; $business = new Business($this->db); $this->business_id = $business->getIdFromUserId($this->user_id); }