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 :

-
+
diff --git a/php/vues/connexion.html b/php/templates/connexion.html similarity index 90% rename from php/vues/connexion.html rename to php/templates/connexion.html index d3508c5..2dd061a 100755 --- a/php/vues/connexion.html +++ b/php/templates/connexion.html @@ -4,7 +4,7 @@ Alica - Connexion - +
@@ -37,7 +37,7 @@
-
+
diff --git a/php/vues/erreur.html b/php/templates/erreur.html similarity index 74% rename from php/vues/erreur.html rename to php/templates/erreur.html index c3fcde6..740cace 100755 --- a/php/vues/erreur.html +++ b/php/templates/erreur.html @@ -3,7 +3,7 @@ - + Alica - Erreur @@ -14,7 +14,7 @@

{{value}}

{% endfor %} {% endif %} -
+
diff --git a/php/vues/inscription.html b/php/templates/inscription.html similarity index 91% rename from php/vues/inscription.html rename to php/templates/inscription.html index cfee55a..b86bcea 100755 --- a/php/vues/inscription.html +++ b/php/templates/inscription.html @@ -4,7 +4,7 @@ Alica - Inscription - +
@@ -45,7 +45,7 @@
-
+
diff --git a/php/vendor/composer/installed.php b/php/vendor/composer/installed.php index 9500923..295225e 100644 --- a/php/vendor/composer/installed.php +++ b/php/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '68bdbc2afe49996b3ceec196c42f5e25b3edec96', + 'reference' => 'ca79f102cff2316dd789a28ba980fe14643acaa0', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '68bdbc2afe49996b3ceec196c42f5e25b3edec96', + 'reference' => 'ca79f102cff2316dd789a28ba980fe14643acaa0', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/php/vues/.DS_Store b/php/vues/.DS_Store deleted file mode 100755 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0