/** * Tests if the visitor is connected and if he's an administrator. **/ public function controlAdministration() { $accountmodel = new AccountModel(); $result = $accountmodel->isAdministrator(); if (!(isset($_SESSION['infoUser']) && isset($result[0]))) { echo '<script>document.location.href="../view/index.php"</script>'; } }