From 7772e9da450798661fe140db2953a5aa7ddc1ea0 Mon Sep 17 00:00:00 2001
From: Leo Tuaillon
Date: Sun, 5 Nov 2023 21:16:35 +0100
Subject: [PATCH] new archi + inscription fonctionnel (sans les gestions
d'erreur)
---
php/.htaccess | 6 +++++
php/index.php | 16 -----------
php/{ => public}/css/.DS_Store | Bin
php/{ => public}/css/accueil.css | 0
php/{ => public}/css/connexion.css | 0
php/{ => public}/css/erreur.css | 0
php/{ => public}/css/inscription.css | 0
php/public/index.php | 16 +++++++++++
php/src/Autoloader.php | 17 ++++++++++++
php/src/config/config.php | 4 +--
php/src/controleur/UtilisateurControleur.php | 4 +--
php/src/{dal => }/gateway/AlumniGateway.php | 16 ++++++-----
php/src/{dal => gateway}/Connection.php | 3 ++-
.../{dal => }/gateway/EvenementGateway.php | 6 ++---
php/src/{dal => }/gateway/OffreGateway.php | 6 ++---
php/src/{models => modele}/AdminModele.php | 7 ++---
php/src/{metier => modele}/Alumni.php | 2 +-
php/src/{metier => modele}/Article.php | 3 ++-
php/src/{metier => modele}/Evenement.php | 3 ++-
php/src/{metier => modele}/Experience.php | 3 ++-
php/src/{metier => modele}/Formation.php | 3 ++-
php/src/{models => modele}/MembreModele.php | 2 +-
php/src/{metier => modele}/Offre.php | 25 +++++++++---------
php/src/{metier => modele}/Profil.php | 3 ++-
php/src/{metier => modele}/Role.php | 2 +-
.../{models => modele}/UtilisateurModele.php | 24 ++++++++---------
php/src/models/ModerateurControleur.php | 8 ------
php/{vues => templates}/accueil.html | 4 +--
php/{vues => templates}/connexion.html | 4 +--
php/{vues => templates}/erreur.html | 4 +--
php/{vues => templates}/inscription.html | 4 +--
php/vendor/composer/installed.php | 4 +--
php/vues/.DS_Store | Bin 6148 -> 0 bytes
33 files changed, 110 insertions(+), 89 deletions(-)
create mode 100644 php/.htaccess
delete mode 100755 php/index.php
rename php/{ => public}/css/.DS_Store (100%)
rename php/{ => public}/css/accueil.css (100%)
rename php/{ => public}/css/connexion.css (100%)
rename php/{ => public}/css/erreur.css (100%)
rename php/{ => public}/css/inscription.css (100%)
create mode 100755 php/public/index.php
create mode 100644 php/src/Autoloader.php
rename php/src/{dal => }/gateway/AlumniGateway.php (85%)
rename php/src/{dal => gateway}/Connection.php (97%)
rename php/src/{dal => }/gateway/EvenementGateway.php (64%)
rename php/src/{dal => }/gateway/OffreGateway.php (64%)
rename php/src/{models => modele}/AdminModele.php (90%)
rename php/src/{metier => modele}/Alumni.php (97%)
rename php/src/{metier => modele}/Article.php (97%)
rename php/src/{metier => modele}/Evenement.php (98%)
rename php/src/{metier => modele}/Experience.php (98%)
rename php/src/{metier => modele}/Formation.php (98%)
rename php/src/{models => modele}/MembreModele.php (97%)
rename php/src/{metier => modele}/Offre.php (81%)
rename php/src/{metier => modele}/Profil.php (98%)
rename php/src/{metier => modele}/Role.php (77%)
rename php/src/{models => modele}/UtilisateurModele.php (61%)
delete mode 100755 php/src/models/ModerateurControleur.php
rename php/{vues => templates}/accueil.html (75%)
rename php/{vues => templates}/connexion.html (90%)
rename php/{vues => templates}/erreur.html (74%)
rename php/{vues => templates}/inscription.html (91%)
delete mode 100755 php/vues/.DS_Store
diff --git a/php/.htaccess b/php/.htaccess
new file mode 100644
index 0000000..095bf2a
--- /dev/null
+++ b/php/.htaccess
@@ -0,0 +1,6 @@
+
+ RewriteEngine On
+ RewriteBase /php/public/
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^(.*)$ index.php [QSA,L]
+
diff --git a/php/index.php b/php/index.php
deleted file mode 100755
index 242d196..0000000
--- a/php/index.php
+++ /dev/null
@@ -1,16 +0,0 @@
- false,
- 'debug' => true
-]);
-
-$cont = new App\controleur\FrontControleur();
diff --git a/php/css/.DS_Store b/php/public/css/.DS_Store
similarity index 100%
rename from php/css/.DS_Store
rename to php/public/css/.DS_Store
diff --git a/php/css/accueil.css b/php/public/css/accueil.css
similarity index 100%
rename from php/css/accueil.css
rename to php/public/css/accueil.css
diff --git a/php/css/connexion.css b/php/public/css/connexion.css
similarity index 100%
rename from php/css/connexion.css
rename to php/public/css/connexion.css
diff --git a/php/css/erreur.css b/php/public/css/erreur.css
similarity index 100%
rename from php/css/erreur.css
rename to php/public/css/erreur.css
diff --git a/php/css/inscription.css b/php/public/css/inscription.css
similarity index 100%
rename from php/css/inscription.css
rename to php/public/css/inscription.css
diff --git a/php/public/index.php b/php/public/index.php
new file mode 100755
index 0000000..8a015ce
--- /dev/null
+++ b/php/public/index.php
@@ -0,0 +1,16 @@
+ false,
+ 'debug' => true
+]);
+
+$cont = new \App\controleur\FrontControleur();
\ No newline at end of file
diff --git a/php/src/Autoloader.php b/php/src/Autoloader.php
new file mode 100644
index 0000000..7d6ac76
--- /dev/null
+++ b/php/src/Autoloader.php
@@ -0,0 +1,17 @@
+inscription($email, $motDePasse);
// Si l'inscription a réussi, redirigez l'utilisateur vers une page de confirmation
// Vous pouvez également gérer les erreurs ici en cas d'échec de l'inscription
- if ($nouvelUtilisateur instanceof \App\metier\Alumni) {
+ if ($nouvelUtilisateur instanceof \App\modele\Alumni) {
// L'inscription a réussi, redirigez l'utilisateur vers une page de confirmation
// par exemple :
header('Location: index.php?action=inscription_success');
diff --git a/php/src/dal/gateway/AlumniGateway.php b/php/src/gateway/AlumniGateway.php
similarity index 85%
rename from php/src/dal/gateway/AlumniGateway.php
rename to php/src/gateway/AlumniGateway.php
index 7819d4b..1a00ff4 100644
--- a/php/src/dal/gateway/AlumniGateway.php
+++ b/php/src/gateway/AlumniGateway.php
@@ -1,26 +1,28 @@
con = $con;
}
public function insert(string $email, string $motDePasse, string $role){
- $query='INSERT INTO Alumni VALUES (:e, :m, :r)';
+ $query = 'INSERT INTO Alumni (mail, mdp, role) VALUES (:mail, :mdp, :role)';
return $this->con->executeQuery($query, array(
- ':e' => array($email, PDO::PARAM_STR),
- ':m' => array($motDePasse, PDO::PARAM_STR),
- ':r' => array($role, PDO::PARAM_STR)
+ ':mail' => array($email, PDO::PARAM_STR),
+ ':mdp' => array($motDePasse, PDO::PARAM_STR),
+ ':role' => array($role, PDO::PARAM_STR)
));
}
+
public function updateEmail(int $id, string $newEmail){
$query='UPDATE Alumni SET email=:new WHERE id=:i';
$this->con->executeQuery($query, array(
diff --git a/php/src/dal/Connection.php b/php/src/gateway/Connection.php
similarity index 97%
rename from php/src/dal/Connection.php
rename to php/src/gateway/Connection.php
index e8c1e83..1389c2a 100755
--- a/php/src/dal/Connection.php
+++ b/php/src/gateway/Connection.php
@@ -1,6 +1,7 @@
con = $con;
}
diff --git a/php/src/dal/gateway/OffreGateway.php b/php/src/gateway/OffreGateway.php
similarity index 64%
rename from php/src/dal/gateway/OffreGateway.php
rename to php/src/gateway/OffreGateway.php
index d783846..85e4aab 100755
--- a/php/src/dal/gateway/OffreGateway.php
+++ b/php/src/gateway/OffreGateway.php
@@ -1,13 +1,13 @@
con = $con;
}
diff --git a/php/src/models/AdminModele.php b/php/src/modele/AdminModele.php
similarity index 90%
rename from php/src/models/AdminModele.php
rename to php/src/modele/AdminModele.php
index 21bdcdb..5cc4474 100755
--- a/php/src/models/AdminModele.php
+++ b/php/src/modele/AdminModele.php
@@ -1,9 +1,6 @@
id = $id;
$this->offreur = $offreur;
@@ -161,7 +162,7 @@ class Offre
return $this->imageUrl;
}
- public function getTypeContrat(): TypeContrat
+ public function getTypeContrat(): \App\metier\TypeContrat
{
return $this->typeContrat;
}
@@ -191,7 +192,7 @@ class Offre
return $this->experience;
}
- public function getNiveauEtudes(): NiveauEtudes
+ public function getNiveauEtudes(): \App\metier\NiveauEtudes
{
return $this->niveauEtudes;
}
diff --git a/php/src/metier/Profil.php b/php/src/modele/Profil.php
similarity index 98%
rename from php/src/metier/Profil.php
rename to php/src/modele/Profil.php
index a05b32e..69e5bc5 100644
--- a/php/src/metier/Profil.php
+++ b/php/src/modele/Profil.php
@@ -1,5 +1,6 @@
insert($email, $hashpassword, $role)) {
// L'insertion a réussi, retournez le nouvel utilisateur
- $nouvelUtilisateur = new \App\metier\Alumni($email, $hashpassword, $role);
+ $nouvelUtilisateur = new \App\modele\Alumni($email, $hashpassword, $role);
return $nouvelUtilisateur;
} else {
// L'insertion a échoué, renvoyez un utilisateur vide pour indiquer l'échec
- return new \App\metier\Alumni(null, null, null);
+ return new \App\modele\Alumni(null, null, null);
}
}
}
diff --git a/php/src/models/ModerateurControleur.php b/php/src/models/ModerateurControleur.php
deleted file mode 100755
index 608bf52..0000000
--- a/php/src/models/ModerateurControleur.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
+
Alica - Accueil
@@ -15,7 +15,7 @@
Vous pouvez aussi consulter les articles
Vous pouvez aussi consulter les annonces
Connexion :
-