diff --git a/Source/Config/config.php b/Source/Config/config.php index cd2631c..658e883 100644 --- a/Source/Config/config.php +++ b/Source/Config/config.php @@ -15,14 +15,7 @@ $views['error'] = 'Views/HTML/error.php'; $_SERVER['BASE_URI'] = ''; - $url = $_SERVER['PHP_SELF']; -/* -$newUrl=parse_url($url, PHP_URL_PATH); -echo "NewURL : ".$newUrl; -$container_name = basename($newUrl); -echo "Container : ".$container_name; -*/ $controller['Candidate'] = 'ControllerCandidate'; $controller['Admin'] = 'ControllerAdmin'; diff --git a/Source/Controller/ControllerCandidate.php b/Source/Controller/ControllerCandidate.php index 99c5f5d..610b2b5 100644 --- a/Source/Controller/ControllerCandidate.php +++ b/Source/Controller/ControllerCandidate.php @@ -48,18 +48,17 @@ class ControllerCandidate global $rep, $views; require_once($rep.$views['thanks']); } - public function login() :void { + + public function login(): void { global $rep,$views; - try{ - $model= new ModelCandidate(); - $model->login(); - if($_SESSION['role'] == "Admin") { - require_once($rep . $views['admin']); - } - else - { - require_once($rep . $views['adminLogin']); - } + try { + $model= new ModelCandidate(); + $model->login(); + if ($_SESSION['role'] == "Admin") { + require_once($rep . $views['admin']); + } else { + require_once($rep . $views['adminLogin']); + } } catch (Exception $e) { $error = $e->getMessage(); require_once($rep . $views['adminLogin']);