diff --git a/assests/img/error403.jpg b/assests/img/error403.jpg new file mode 100644 index 0000000..ddb9376 Binary files /dev/null and b/assests/img/error403.jpg differ diff --git a/assests/img/error404.webp b/assests/img/error404.webp new file mode 100644 index 0000000..1fb29eb Binary files /dev/null and b/assests/img/error404.webp differ diff --git a/controllers/admin_controller.php b/controllers/admin_controller.php index 5fd9e56..b98252b 100644 --- a/controllers/admin_controller.php +++ b/controllers/admin_controller.php @@ -25,7 +25,6 @@ header("Location:index.php?ctrl=error&action=error_403"); exit; } - var_dump($_SESSION); //gestion de l'user $objCategoryModel = new CategoryModel; @@ -44,6 +43,7 @@ $editCat->setId($_POST['id_to_edit']); $editCat->setName($_POST['new_name']); $objCategoryModel->editCategory($editCat); + $_SESSION['success'] = "La catégorie a bien été modifiée"; header('Location: index.php?ctrl=admin&action=admin'); exit; } diff --git a/controllers/error_controller.php b/controllers/error_controller.php new file mode 100644 index 0000000..4ebead6 --- /dev/null +++ b/controllers/error_controller.php @@ -0,0 +1,24 @@ +_display("error_404"); + } + + /** + * Page erreur 403 + */ + public function error_403(){ + $this->_display("error_403"); + } + + } \ No newline at end of file diff --git a/controllers/user_controller.php b/controllers/user_controller.php index 1a3b464..197728e 100644 --- a/controllers/user_controller.php +++ b/controllers/user_controller.php @@ -110,7 +110,7 @@ class UserCtrl extends MotherCtrl { $arrError['user_pseudo'] = "Le pseudo est obligatoire"; } - $strRegex = "/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{16,}$/"; + $strRegex = "/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{15,}$/"; if ($objUser->getPwd() == ""){ $arrError['user_password'] = "Le mot de passe est obligatoire"; }else if (!preg_match($strRegex, $objUser->getPwd())){ diff --git a/index.php b/index.php index 090bef2..de05a20 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,7 @@ $boolError = false; $strFileName = "./controllers/".$strCtrl."_controller.php"; - + if(file_exists($strFileName)){ require($strFileName); $strClassName = ucfirst($strCtrl)."Ctrl"; @@ -32,6 +32,6 @@ } if($boolError){ - echo "error 404 - la page elle existe pas "; + header("Location:index.php?ctrl=error&action=error_404"); } diff --git a/views/_partial/header.tpl b/views/_partial/header.tpl index 81c9804..0bdd5f4 100644 --- a/views/_partial/header.tpl +++ b/views/_partial/header.tpl @@ -84,5 +84,4 @@ - {$success_message|vardump} {include file="views/_partial/messages.tpl"} \ No newline at end of file diff --git a/views/_partial/preview.tpl b/views/_partial/preview.tpl index 6103588..26329e4 100644 --- a/views/_partial/preview.tpl +++ b/views/_partial/preview.tpl @@ -3,21 +3,24 @@ {* IMAGE (partie supérieure - plus grande) *}
{* CONTENU (photo profil + infos) *}Changer le statut ou supprimer un utilisateur