Code smells and bugs resolve 3
continuous-integration/drone/push Build is passing Details

master
Alexis 2 years ago
parent 00f3aa0e91
commit c08ea82208

@ -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';

@ -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']);

Loading…
Cancel
Save