-
diff --git a/views/user.tpl b/views/user.tpl
index 45a78e5..d7e5016 100644
--- a/views/user.tpl
+++ b/views/user.tpl
@@ -5,7 +5,7 @@
-
From ebca12097988c917c5c75979997107b87f442dcb Mon Sep 17 00:00:00 2001
From: Yasder5 <102179445+Yasder5@users.noreply.github.com>
Date: Tue, 24 Feb 2026 08:54:45 +0100
Subject: [PATCH 08/23] la page about en plus hehe
---
views/about.tpl | 161 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 161 insertions(+)
create mode 100644 views/about.tpl
diff --git a/views/about.tpl b/views/about.tpl
new file mode 100644
index 0000000..6466218
--- /dev/null
+++ b/views/about.tpl
@@ -0,0 +1,161 @@
+{extends file="views/layout.tpl"}
+
+{assign var='strPage' value='about'}
+
+{block name="title" append}À propos{/block}
+{block name="h2"}À propos de FOLLIOW{/block}
+{block name="p"}Plateforme de partage de projets – Projet pédagogique{/block}
+
+{block name="content"}
+
+
+
+
+
+
+
+
+
+
+ Présentation du projet
+
+
+
+ FOLLIOW est une plateforme web développée dans le cadre d’un projet pédagogique.
+ Elle permet aux utilisateurs de publier, consulter et partager des projets numériques
+ à travers une interface simple et structurée.
+
+
+
+ Ce projet a été conçu afin de mettre en pratique les compétences acquises en
+ développement web, notamment l’architecture MVC, la gestion des bases de données
+ et la sécurisation des échanges.
+
+
+
+
+
+
+ Fonctionnalités principales
+
+
+
+ Création et gestion de projets
+ Affichage dynamique des contenus
+ Gestion des utilisateurs
+ Partage d’un projet par email
+ Interface responsive et accessible
+
+
+
+
+
+
+ Objectifs pédagogiques
+
+
+
+ L’objectif principal de FOLLIOW est de démontrer la capacité à concevoir
+ une application web complète, structurée et sécurisée.
+
+
+
+ Structuration d’un projet en architecture MVC
+ Manipulation de bases de données relationnelles
+ Validation et sécurisation des données
+ Implémentation d’un système d’envoi d’emails
+ Respect des bonnes pratiques (RGPD, accessibilité, organisation du code)
+
+
+
+
+
+
+ Technologies utilisées
+
+
+
+
+
+
+
Backend
+
+ PHP orienté objet – Architecture MVC – MySQL
+
+
+
+
+
+
+
+
+
Frontend
+
+ HTML5 – CSS3 – Bootstrap – Smarty
+
+
+
+
+
+
+
+
+
Emails
+
+ PHPMailer – SMTP – Brevo
+
+
+
+
+
+
+
+
+
Sécurité
+
+ Validation des données – Protection des formulaires – Gestion des sessions
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Projet pédagogique
+
+
+
+ FOLLIOW a été réalisé dans le cadre d’une formation en développement web.
+ Il s’agit d’un projet démonstratif à visée éducative.
+
+
+
+
+
+
+ Contact
+
+
+
+ Pour toute question :
+
+
+
+ projet.folliow@hotmail.com
+
+
+
+
+
+
+
+
+{/block}
\ No newline at end of file
From e7830a516a958db3242182c1d469774cbf924383 Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:01:13 +0100
Subject: [PATCH 09/23] Changer le regex, et ranger les fonctions.php
---
controllers/user_controller.php | 362 ++++++++++++++++++++++----------
1 file changed, 255 insertions(+), 107 deletions(-)
diff --git a/controllers/user_controller.php b/controllers/user_controller.php
index ccba625..9b8e5dd 100644
--- a/controllers/user_controller.php
+++ b/controllers/user_controller.php
@@ -7,63 +7,15 @@
require("./entities/project_entity.php");
class UserCtrl extends MotherCtrl {
-
- public function login(){
-
- $strMail = $_POST['user_mail']??"";
- $strPwd = $_POST['user_password']??"";
-
- // Tester le formulaire
- $arrError = [];
- if (count($_POST) > 0) {
- // Vérifier le formulaire
- if ($strMail == ""){
- $arrError['mail'] = "Le mail est obligatoire";
- }
- if ($strPwd == ""){
- $arrError['pwd'] = "Le mot de passe est obligatoire";
- }
-
- // Si le formulaire est rempli correctement
- if (count($arrError) == 0){
- // Vérifier l'utilisateur en BDD
- $objUserModel = new UserModel;
- $arrResult = $objUserModel->verifUser($strMail, $strPwd);
- //var_dump($arrResult);
- if ($arrResult === false){ // Si la base de données ne renvoie rien
- $arrError[] = "Mail ou mot de passe invalide";
- }else{
- // Ajoute l'utilisateur en session
- $_SESSION['user'] = $arrResult;
- $_SESSION['success'] = "Bienvenue, vous êtes bien connecté";
-
- header("Location:index.php");
- exit;
- }
- }
- }
- $this->_arrData['arrError'] = $arrError;
- $this->_display("login");
-
- }
-
-
- public function logout(){
- session_start();
- /*session_destroy();
- session_start();*/
-
- // on supprime l'utilisateur en session
- unset($_SESSION['user']);
-
- $_SESSION['success'] = "Vous êtes bien déconnecté";
-
- header("Location:index.php");
- exit;
-
- }
-
- public function signin(){
+
+ /**
+ * Fonction d'inscription d'un utilisateur
+ * Effectue les validations du formulaire,
+ * vérifie l'unicité du mail et du pseudo,
+ * puis insère l'utilisateur en base de données
+ * @return void
+ */
+ public function signup(){
// Entité pour réafficher les valeurs dans le formulaire
$objUser = new User();
@@ -101,33 +53,40 @@ class UserCtrl extends MotherCtrl {
}
if (trim($objUser->getMail()) === "") {
- $arrError['user_mail'] = "Le mail est obligatoire";
+ $arrError['user_mail'] = "L'adresse e-mail est obligatoire";
} elseif (!filter_var($objUser->getMail(), FILTER_VALIDATE_EMAIL)) {
- $arrError['user_mail'] = "Le format du mail n'est pas correct";
+ $arrError['user_mail'] = "Le format de l'adresse e-mail est invalide";
}
if (trim($objUser->getPseudo()) === "") {
$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())){
- $arrError['user_password'] = "Le mot de passe ne correspond pas aux règles";
+ $arrError['user_password'] = "Le mot de passe ne respecte pas les critères";
}else if($objUser->getPwd() != $strPwdConfirm){
- $arrError['pwd_confirm'] = "Le mot de passe et sa confirmation ne sont pas identiques";
+ $arrError['pwd_confirm'] = "La confirmation du mot de passe ne correspond pas";
}
-
// Si pas d'erreurs => insertion
if (count($arrError) === 0) {
$objUserModel = new UserModel();
+ // Vérif mail
if ($objUserModel->mailExists($objUser->getMail())) {
+ $arrError['user_mail'] = "Impossible de créer le compte avec ces informations";
+ }
- $arrError['user_mail'] = "Ce mail existe déjà";
- } else {
+ // Vérif pseudo
+ if ($objUserModel->pseudoExists($objUser->getPseudo())) {
+ $arrError['user_pseudo'] = "Ce pseudo existe déjà";
+ }
+
+ // Si aucune erreur => insert
+ if (count($arrError) === 0) {
$boolInsert = $objUserModel->insert($objUser);
if ($boolInsert === true) {
@@ -142,47 +101,236 @@ class UserCtrl extends MotherCtrl {
}
// Affichage de la vue inscription
- $this->_arrData["arrError"] = $arrError;
- $this->_display("inscription");
- }
-
- /**
- * le controlleur affichage de la page user
- */
- public function user(){
-
- $intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
-
- if ($intId <= 0) {
- header("Location:index.php");
- exit;
- }
-
- //affichage info utilisateur
- $objUserModel = new UserModel;
- $arrUserData = $objUserModel->findUserById($intId);
-
- if ($arrUserData === false) {
- header("Location:index.php");
- exit;
- }
- $objUser = new User;
- $objUser->hydrate($arrUserData);
-
- //affichage projet de l'utilisateur
- $objProjectModel = new ProjectModel;
- $arrProjects = $objProjectModel->findAll(0,'',$intId);
-
- $arrProjectToDisplay = array();
- foreach($arrProjects as $projectData) {
- $objProject = new Project();
- $objProject->hydrate($projectData);
- $arrProjectToDisplay[] = $objProject;
- }
-
- $this->_arrData['user'] = $objUser;
- $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
- $this->_display("user");
- }
+ $this->_arrData['objUser'] = $objUser;
+ $this->_arrData['arrError'] = $arrError;
+ $this->_display("signup");
+ }
+ /**
+ * Fonction de connexion d'un utilisateur
+ * Vérifie les informations envoyées par le formulaire
+ * et crée la session si les identifiants sont valides
+ * @return void
+ */
+ public function login(){
+
+ $strMail = $_POST['user_mail']??"";
+ $strPwd = $_POST['user_password']??"";
+
+ // Tester le formulaire
+ $arrError = [];
+ if (count($_POST) > 0) {
+ // Vérifier le formulaire
+ if ($strMail == ""){
+ $arrError['mail'] = "L'adresse e-mail est obligatoire";
+ }
+ if ($strPwd == ""){
+ $arrError['pwd'] = "Le mot de passe est obligatoire";
+ }
+
+ // Si le formulaire est rempli correctement
+ if (count($arrError) == 0){
+ // Vérifier l'utilisateur en BDD
+ $objUserModel = new UserModel;
+ $arrResult = $objUserModel->verifUser($strMail, $strPwd);
+ //var_dump($arrResult);
+ if ($arrResult === false){ // Si la base de données ne renvoie rien
+ $arrError[] = "Identifiants incorrects";
+ }else{
+ // Ajoute l'utilisateur en session
+ $_SESSION['user'] = $arrResult;
+ $_SESSION['success'] = "Bienvenue, vous êtes bien connecté";
+
+ header("Location:index.php");
+ exit;
+ }
+ }
+ }
+ $this->_arrData['arrError'] = $arrError;
+ $this->_display("login");
+
+ }
+
+
+ public function logout(){
+ session_start();
+ /*session_destroy();
+ session_start();*/
+
+ // on supprime l'utilisateur en session
+ unset($_SESSION['user']);
+
+ $_SESSION['success'] = "Vous êtes bien déconnecté";
+
+ header("Location:index.php");
+ exit;
+
+ }
+
+
+
+ /**
+ * le controlleur affichage de la page user
+ */
+ public function user(){
+
+ /**$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
+
+ if ($intId <= 0) {
+ header("Location: index.php");
+ exit;
+ }
+
+ //affichage info utilisateur
+ $objUserModel = new UserModel;
+ $arrUserData = $objUserModel->findUserById($intId);
+
+ if ($arrUserData === false) {
+ header("Location: index.php");
+ exit;
+ }*/
+
+ $strPseudo = $_GET['pseudo']??'';
+
+ $objUserModel = new UserModel;
+ $arrUserData = $objUserModel->findUserByPseudo($strPseudo);
+
+ if ($arrUserData === false) {
+ header("Location: index.php");
+ exit;
+ }
+
+ $objUser = new User;
+ $objUser->hydrate($arrUserData);
+
+ //affichage projet de l'utilisateur
+ $objProjectModel = new ProjectModel;
+ $arrProjects = $objProjectModel->findAll(0,'',$objUser->getId());
+
+ $arrProjectToDisplay = array();
+ foreach($arrProjects as $projectData) {
+ $objProject = new Project();
+ $objProject->hydrate($projectData);
+ $arrProjectToDisplay[] = $objProject;
+ }
+
+ $this->_arrData['user'] = $objUser;
+ $this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
+ $this->_display("user");
+ }
+
+ public function edit(){
+ if(!isset($_SESSION['user'])){
+ header("Location: index.php");
+ exit;
+ }
+
+ $objUserModel = new UserModel;
+ $arrError = [];
+ $objUser = new User;
+ $arrUserData = $objUserModel->findUserById($_SESSION['user']['user_id']);
+ $objUser->hydrate($arrUserData);
+ if (!empty($_POST)) {
+ if ($objUserModel->mailExists($_POST['user_mail']) && ($_POST['user_mail'] != $objUser->getMail())) {
+
+ $arrError['user_mail'] = "Ce mail est déjà associé";
+ } else {
+ if ($objUserModel->pseudoExists($_POST['user_pseudo']) && ($_POST['user_pseudo'] != $objUser->getPseudo())){
+ $arrError['user_pseudo'] = "Ce pseudo est déjà utiliser";
+ }else{
+ $objUser->hydrate($_POST);
+ $objUser->setId($_SESSION['user']['user_id']);
+
+ // Vérification de l'image
+ $arrTypeAllowed = array('image/jpeg', 'image/png', 'image/webp');
+ $boolImageOk = true;
+
+ if ($_FILES['image']['error'] != 4) {
+ if (!in_array($_FILES['image']['type'], $arrTypeAllowed)) {
+ $arrError['image'] = "Le type de fichier n'est pas autorisé";
+ } else {
+ switch ($_FILES['image']['error']) {
+ case 0:
+ $strImageName = uniqid() . ".webp";
+ $strOldImg = $objUser->getImage();
+ $objUser->setImage($strImageName);
+ break;
+ case 1:
+ case 2:
+ $arrError['image'] = "Le fichier est trop volumineux";
+ break;
+ case 3:
+ $arrError['image'] = "Le fichier a été partiellement téléchargé";
+ break;
+ case 6:
+ $arrError['image'] = "Le répertoire temporaire est manquant";
+ break;
+ default:
+ $arrError['image'] = "Erreur sur l'image";
+ break;
+ }
+ }
+ }
+
+ // Traitement de l'image si pas d'erreur
+ if (count($arrError) == 0 && isset($strImageName)) {
+ $strDest = $_ENV['IMG_USER_PATH'] . $strImageName;
+ $strSource = $_FILES['image']['tmp_name'];
+ list($intWidth, $intHeight) = getimagesize($strSource);
+
+ $intDestWidth = 200; $intDestHeight = 200;
+ $fltDestRatio = $intDestWidth / $intDestHeight;
+ $fltSourceRatio = $intWidth / $intHeight;
+
+ if ($fltSourceRatio > $fltDestRatio) {
+ $intCropHeight = $intHeight;
+ $intCropWidth = (int)round($intHeight * $fltDestRatio);
+ $intCropX = (int)(($intWidth - $intCropWidth) / 2);
+ $intCropY = 0;
+ } else {
+ $intCropWidth = $intWidth;
+ $intCropHeight = (int)round($intWidth / $fltDestRatio);
+ $intCropX = 0;
+ $intCropY = (int)(($intHeight - $intCropHeight) / 2);
+ }
+
+ $objDest = imagecreatetruecolor($intDestWidth, $intDestHeight);
+ switch ($_FILES['image']['type']) {
+ case 'image/jpeg': $objSource = imagecreatefromjpeg($strSource); break;
+ case 'image/png': $objSource = imagecreatefrompng($strSource); break;
+ case 'image/webp': $objSource = imagecreatefromwebp($strSource); break;
+ }
+
+ imagecopyresampled($objDest, $objSource, 0, 0, $intCropX, $intCropY, $intDestWidth, $intDestHeight, $intCropWidth, $intCropHeight);
+ $boolImageOk = imagewebp($objDest, $strDest);
+ imagedestroy($objDest);
+ imagedestroy($objSource);
+ }
+
+
+ $boolInsert = $objUserModel->update($objUser);
+
+ if ($boolInsert === true) {
+ if (isset($strOldImg) && !empty($strOldImg) && isset($strImageName)) {
+ $strOldFile = $_ENV['IMG_USER_PATH'] . $strOldImg;
+ if (file_exists($strOldFile)) unlink($strOldFile);
+ }
+ $arrNewInfo = $objUserModel->findUserByPseudo($objUser->getPseudo());
+ $_SESSION['user'] = $arrNewInfo;
+ $_SESSION['success'] = "Compte modifier avec succès";
+ header("Location:?ctrl=user&action=user&pseudo=".$objUser->getPseudo());
+ exit;
+ } else {
+ $arrError['global'] = "Erreur lors de l'update";
+ }
+ }
+ }
+ }
+
+ $this->_arrData["arrError"] = $arrError;
+ $this->_arrData['objUser'] = $objUser;
+ $this->_display("useredit");
+
+ }
+
}
From c62302dc375c37cd416bbd19a395a993ac837548 Mon Sep 17 00:00:00 2001
From: "laura.chevillet"
Date: Tue, 24 Feb 2026 13:02:23 +0100
Subject: [PATCH 10/23] =?UTF-8?q?modif=20recherche=20requete=20pr=C3=A9par?=
=?UTF-8?q?=C3=A9e=20et=20ajout=20confirmation=20suppression=20projet?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
entities/project_entity.php | 2 +-
env | 6 ++-
models/mother_model.php | 16 +++---
models/project_model.php | 98 +++++++++++++++++++++----------------
views/_partial/preview.tpl | 3 +-
5 files changed, 72 insertions(+), 53 deletions(-)
diff --git a/entities/project_entity.php b/entities/project_entity.php
index cb8548a..fc9ba31 100644
--- a/entities/project_entity.php
+++ b/entities/project_entity.php
@@ -17,7 +17,7 @@ class Project extends Entity{
private int $_user;
private int $_category;
private string $_creatorname;
- private string $_user_image;
+ private ?string $_user_image;
/**
diff --git a/env b/env
index af95f41..1ba2754 100644
--- a/env
+++ b/env
@@ -4,4 +4,8 @@ DB_CONNECTION=mysql
DB_HOSTNAME=boulayoune.com
DB_DATABASE=projet_folliow
DB_USERNAME=
-DB_PASSWORD=
\ No newline at end of file
+DB_PASSWORD=
+
+# image path
+IMG_PROJECT_PATH = uploads/projects/
+IMG_USER_PATH = uploads/profiles/
\ No newline at end of file
diff --git a/models/mother_model.php b/models/mother_model.php
index 59eea4f..9b58aba 100644
--- a/models/mother_model.php
+++ b/models/mother_model.php
@@ -23,14 +23,14 @@
}
/**
- Pour passer sur le serveur de YASS:
+ *Pour passer sur le serveur de YASS:
*"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
- "projet_user", //Nom d'utilisateur de la base de données
- "F0lliowRules!",// Mot de passe de la base de données
- Site pour BDD: https://phpmyadmin.boulayoune.com/index.php?route=/sql&pos=0&db=projet_folliow&table=project
+ *"projet_user", //Nom d'utilisateur de la base de données
+ *"F0lliowRules!",// Mot de passe de la base de données
+ *Site pour BDD: https://phpmyadmin.boulayoune.com/index.php?route=/sql&pos=0&db=projet_folliow&table=project
- Pour passer en local:
- "mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD
- "root", //Nom d'utilisateur de la base de données
- "",// Mot de passe de la base de données
+ *Pour passer en local:
+ *"mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD
+ *"root", //Nom d'utilisateur de la base de données
+ *"",// Mot de passe de la base de données
*/
\ No newline at end of file
diff --git a/models/project_model.php b/models/project_model.php
index 56b88d2..6b16644 100644
--- a/models/project_model.php
+++ b/models/project_model.php
@@ -16,72 +16,90 @@
* @return array
*/
public function findAll(int $intLimit=0, string $strKeywords='', int $intAuthor=0,
- int $intPeriod=0, string $strDate='', string $strStartDate='',
- string $strEndDate='', int $intCategory=0, bool $bool6Months=false):array{
+ int $intPeriod=0, string $strDate='', string $strStartDate='',
+ string $strEndDate='', int $intCategory=0, bool $boolOlderThan6Months=false): array {
+
- $strRq = "SELECT project.*,
+ $strRq = "SELECT project.*,
CONCAT(user_firstname, ' ', user_name) AS 'project_creatorname',
user_image
FROM project
- INNER JOIN users ON user_id = project_user_id";
-
- $strWhere = " WHERE ";
+ INNER JOIN users ON user_id = project_user_id
+ WHERE 1=1";
- // Recherche par mot clé avec quote pour éviter bug du '
if ($strKeywords != '') {
-
- $strSafeKeywords = $this->_db->quote("%" . $strKeywords . "%");
-
- $strRq .= " WHERE (project_title LIKE ".$strSafeKeywords."
- OR project_content LIKE ".$strSafeKeywords.") ";
-
- //$boolWhere = true;
- $strWhere = " AND ";
+ $strRq .= " AND (project_title LIKE :keywords OR project_content LIKE :keywords)";
}
-
- // Recherche par auteur
+
if ($intAuthor > 0){
- $strRq .= $strWhere." user_id = ".$intAuthor;
- $strWhere = " AND ";
+ $strRq .= " AND project_user_id = :author";
}
- // Recherche par catégorie
if ($intCategory > 0){
- $strRq .= $strWhere." project_category = ".$intCategory;
- $strWhere = " AND ";
+ $strRq .= " AND project_category = :category";
}
- //recherche par ancienneté
- if ($bool6Months === true) {
- $strRq .= $strWhere . " project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH) ";
- $strWhere = " AND ";
+ if ($boolOlderThan6Months === true) {
+ $strRq .= " AND project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH)";
}
-
- // Recherche par dates
+
if ($intPeriod == 0){
if ($strDate != ''){
- $strRq .= $strWhere." project_creation_date = '".$strDate."'";
+ $strRq .= " AND project_creation_date = :date_exacte";
}
- }else{
+ } else {
if ($strStartDate != '' && $strEndDate != ''){
- $strRq .= $strWhere." project_creation_date BETWEEN '".$strStartDate."' AND '".$strEndDate."'";
- }else{
+ $strRq .= " AND project_creation_date BETWEEN :date_debut AND :date_fin";
+ } else {
if ($strStartDate != ''){
- $strRq .= $strWhere." project_creation_date >= '".$strStartDate."'";
- }else if ($strEndDate != ''){
- $strRq .= $strWhere." project_creation_date <= '".$strEndDate."'";
+ $strRq .= " AND project_creation_date >= :date_debut";
+ } else if ($strEndDate != ''){
+ $strRq .= " AND project_creation_date <= :date_fin";
}
}
}
-
+
$strRq .= " ORDER BY project_creation_date DESC";
if ($intLimit > 0){
- $strRq .= " LIMIT ".$intLimit;
+ $strRq .= " LIMIT :limit";
}
- return $this->_db->query($strRq)->fetchAll();
+ $rqPrep = $this->_db->prepare($strRq);
+
+ if ($strKeywords != '') {
+ $rqPrep->bindValue(':keywords', '%' . $strKeywords . '%', PDO::PARAM_STR);
+ }
+ if ($intAuthor > 0){
+ $rqPrep->bindValue(':author', $intAuthor, PDO::PARAM_INT);
+ }
+ if ($intCategory > 0){
+ $rqPrep->bindValue(':category', $intCategory, PDO::PARAM_INT);
+ }
+ if ($intPeriod == 0){
+ if ($strDate != ''){
+ $rqPrep->bindValue(':date_exacte', $strDate, PDO::PARAM_STR);
+ }
+ } else {
+ if ($strStartDate != '' && $strEndDate != ''){
+ $rqPrep->bindValue(':date_debut', $strStartDate, PDO::PARAM_STR);
+ $rqPrep->bindValue(':date_fin', $strEndDate, PDO::PARAM_STR);
+ } else {
+ if ($strStartDate != ''){
+ $rqPrep->bindValue(':date_debut', $strStartDate, PDO::PARAM_STR);
+ } else if ($strEndDate != ''){
+ $rqPrep->bindValue(':date_fin', $strEndDate, PDO::PARAM_STR);
+ }
+ }
+ }
+ if ($intLimit > 0){
+ $rqPrep->bindValue(':limit', $intLimit, PDO::PARAM_INT);
+ }
+
+ $rqPrep->execute();
+ return $rqPrep->fetchAll();
}
+
/**
* Fonction d'insertion d'un nouveau projet dans la bdd
@@ -128,12 +146,10 @@
public function accept(int $id){
- //SQL pour changer le status en accept
$strRq = "UPDATE project
SET project_status= 'publié'
WHERE project_id =".$id;
- //retourne la commande
return $this->_db->query($strRq);
}
@@ -171,8 +187,6 @@
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
-
- // Executer la requête
return $rqPrep->execute();
}
}
\ No newline at end of file
diff --git a/views/_partial/preview.tpl b/views/_partial/preview.tpl
index 026293b..201a922 100644
--- a/views/_partial/preview.tpl
+++ b/views/_partial/preview.tpl
@@ -61,7 +61,8 @@
{elseif $projectStatus eq "refusé"}
Portfolio refusé
From 4d68b83e97301c861183b45d26ff057afbe9fc04 Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:02:48 +0100
Subject: [PATCH 11/23] Ajouter le titre dans browser.tpl
---
views/login.tpl | 164 +++++++++++++++++++-----------------------------
1 file changed, 66 insertions(+), 98 deletions(-)
diff --git a/views/login.tpl b/views/login.tpl
index 2ea1286..02f9390 100644
--- a/views/login.tpl
+++ b/views/login.tpl
@@ -1,116 +1,84 @@
{extends file="views/layout.tpl"}
+{block name="title" append} - Connexion{/block}
{block name="content"}
- {* Affichage des erreurs *}
- {if $arrError|count > 0}
-
- {foreach from=$arrError item=strError}
-
{$strError}
- {/foreach}
-
- {/if}
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
-
-
+
+
Connexion
-
-
Connexion
+
+
+ Connectez-vous à votre compte.
+
-
-
- Connectez-vous à votre compte.
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-{/block}
\ No newline at end of file
+{/block}
From 778f6dd48db8c04a0a9de4e9bf8509f94aba6112 Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:03:14 +0100
Subject: [PATCH 12/23] Delete views/inscription.tpl
---
views/inscription.tpl | 197 ------------------------------------------
1 file changed, 197 deletions(-)
delete mode 100644 views/inscription.tpl
diff --git a/views/inscription.tpl b/views/inscription.tpl
deleted file mode 100644
index 7b82e77..0000000
--- a/views/inscription.tpl
+++ /dev/null
@@ -1,197 +0,0 @@
-{extends file="views/layout.tpl"}
-
-{block name="content"}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Inscription
-
-
-
- Créez votre compte utilisateur.
-
- {if (isset($arrError) && count($arrError) > 0) }
-
- {foreach $arrError as $strError}
-
{$strError}
- {/foreach}
-
- {/if}
-
-
-
-
-
-
-
-
-
- Prénom *
-
-
-
-
-
-
-
- Nom *
-
-
-
-
-
-
-
- Pseudo *
-
-
- @
-
-
-
-
-
-
-
- Adresse e-mail *
-
-
-
-
-
-
-
- Mot de passe *
-
-
-
-
-
-
- Confirmer le Mot de passe *
-
-
-
-
-
-
-
- Téléphone
-
-
-
-
-
-
-
- Profession
-
-
-
-
-
-
-
- Localisation
-
-
-
-
-
-
-
- Phrase d'accroche
-
-
-
-
-
-
-
- Créer mon compte
-
-
-
-
-
-
- Déjà un compte ?
- Se connecter
-
-
-
-
-
-
-
-
-
-
-
-
-{/block}
\ No newline at end of file
From 2edc3fde76ab1848501699c3debed1866b5dd18f Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:04:09 +0100
Subject: [PATCH 13/23] Add files via upload
---
views/signup.tpl | 202 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 202 insertions(+)
create mode 100644 views/signup.tpl
diff --git a/views/signup.tpl b/views/signup.tpl
new file mode 100644
index 0000000..21ec90a
--- /dev/null
+++ b/views/signup.tpl
@@ -0,0 +1,202 @@
+{extends file="views/layout.tpl"}
+{block name="title" append} - Inscription{/block}
+
+{block name="content"}
+
+
+
+
+
+
+
+
+
+
+
+
+
Inscription
+
+
+
+ Créez votre compte utilisateur.
+
+
+
+
+
+
+
+
+
+
+ Prénom *
+
+
+
+
+
+
+
+ Nom *
+
+
+
+
+
+
+
+ Pseudo *
+
+
+ @
+
+
+
+
+
+
+
+ Adresse e-mail *
+
+
+
+
+
+
+
+ Mot de passe *
+
+
+
+
+
+
+
+ Confirmer le mot de passe *
+
+
+
+
+
+
+
+ Téléphone
+
+
+
+
+
+
+
+ Profession
+
+
+
+
+
+
+
+ Localisation
+
+
+
+
+
+
+
+ Phrase d'accroche
+
+
+
+
+
+
+
+ Créer mon compte
+
+
+
+
+
+
+ Déjà un compte ?
+
+ Se connecter
+
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
\ No newline at end of file
From fe300a6591d592854eab94ae05d6a1514d66ee70 Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:05:31 +0100
Subject: [PATCH 14/23] Afiche titre mentions.tpl
---
views/mentions.tpl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/views/mentions.tpl b/views/mentions.tpl
index ad5d4c9..9e23a03 100644
--- a/views/mentions.tpl
+++ b/views/mentions.tpl
@@ -1,6 +1,7 @@
{extends file="views/layout.tpl"}
-{block name="title" append}Mentions légales{/block}
+{block name="title" append} - Mentions légales{/block}
+
{block name="h2"}Mentions légales{/block}
{block name="p"}Informations légales et politique de confidentialité{/block}
@@ -284,4 +285,4 @@
-{/block}
\ No newline at end of file
+{/block}
From 197aba7c613ddb8fb4c8e4e0ae5e8906002a5e50 Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:06:09 +0100
Subject: [PATCH 15/23] Add files via upload
---
views/about.tpl | 160 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 160 insertions(+)
create mode 100644 views/about.tpl
diff --git a/views/about.tpl b/views/about.tpl
new file mode 100644
index 0000000..6b43f89
--- /dev/null
+++ b/views/about.tpl
@@ -0,0 +1,160 @@
+{extends file="views/layout.tpl"}
+
+{block name="title" append} - À propos{/block}
+
+{block name="h2"}À propos de FOLLIOW{/block}
+{block name="p"}Plateforme de partage de projets – Projet pédagogique{/block}
+
+{block name="content"}
+
+
+
+
+
+
+
+
+
+
+ Présentation du projet
+
+
+
+ FOLLIOW est une plateforme web développée dans le cadre d’un projet pédagogique.
+ Elle permet aux utilisateurs de publier, consulter et partager des projets numériques
+ à travers une interface simple et structurée.
+
+
+
+ Ce projet a été conçu afin de mettre en pratique les compétences acquises en
+ développement web, notamment l’architecture MVC, la gestion des bases de données
+ et la sécurisation des échanges.
+
+
+
+
+
+
+ Fonctionnalités principales
+
+
+
+ Création et gestion de projets
+ Affichage dynamique des contenus
+ Gestion des utilisateurs
+ Partage d’un projet par email
+ Interface responsive et accessible
+
+
+
+
+
+
+ Objectifs pédagogiques
+
+
+
+ L’objectif principal de FOLLIOW est de démontrer la capacité à concevoir
+ une application web complète, structurée et sécurisée.
+
+
+
+ Structuration d’un projet en architecture MVC
+ Manipulation de bases de données relationnelles
+ Validation et sécurisation des données
+ Implémentation d’un système d’envoi d’emails
+ Respect des bonnes pratiques (RGPD, accessibilité, organisation du code)
+
+
+
+
+
+
+ Technologies utilisées
+
+
+
+
+
+
+
Backend
+
+ PHP orienté objet – Architecture MVC – MySQL
+
+
+
+
+
+
+
+
+
Frontend
+
+ HTML5 – CSS3 – Bootstrap – Smarty
+
+
+
+
+
+
+
+
+
Emails
+
+ PHPMailer – SMTP – Brevo
+
+
+
+
+
+
+
+
+
Sécurité
+
+ Validation des données – Protection des formulaires – Gestion des sessions
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Projet pédagogique
+
+
+
+ FOLLIOW a été réalisé dans le cadre d’une formation en développement web.
+ Il s’agit d’un projet démonstratif à visée éducative.
+
+
+
+
+
+
+ Contact
+
+
+
+ Pour toute question :
+
+
+
+ projet.folliow@hotmail.com
+
+
+
+
+
+
+
+
+{/block}
\ No newline at end of file
From 6c0475d26c7258e77684bf918a95a8d532ea2c1e Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:09:14 +0100
Subject: [PATCH 16/23] Affiche titre header.tpl
---
views/_partial/header.tpl | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/views/_partial/header.tpl b/views/_partial/header.tpl
index f64fd9c..06911af 100644
--- a/views/_partial/header.tpl
+++ b/views/_partial/header.tpl
@@ -7,7 +7,7 @@
- Folliow
+ Folliow{block name="title"}{/block}
@@ -27,7 +27,7 @@
- À propos
+ À propos
@@ -51,7 +51,7 @@
{* Utilisateur non connecté *}
-
+
S'inscrire
@@ -65,15 +65,15 @@
{* Utilisateur connecté *}
-
-
+
-
+
Se déconnecter
From 4d9703fdecedd74336fcb42b1306b0414f0bd179 Mon Sep 17 00:00:00 2001
From: Bess1k
Date: Tue, 24 Feb 2026 13:10:04 +0100
Subject: [PATCH 17/23] Update search.tpl
---
views/search.tpl | 48 +++++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 23 deletions(-)
diff --git a/views/search.tpl b/views/search.tpl
index 0ea9964..8f459c4 100644
--- a/views/search.tpl
+++ b/views/search.tpl
@@ -1,4 +1,5 @@
{extends file="views/layout.tpl"}
+{block name="title" append} - Rechercher{/block}
{block name="content"}