<?php
require_once(SITE_LOGICS . 'middleware/logic.php');

class ControlMiddleware extends LogicMiddleware {

	function __construct() {
		parent::__construct();
	}

	function action() {
		try {
			$this -> checkAvailability("site", function(){
			    header("Location: menu");
			    exit();
			});

			$this -> logic();
		} catch (Exception $e) {
			header('Location: /' . $this ->  getLangage() . '/login');
		}
	}
}

