From c06fe37d69298a44f9abcfeb8e9fdcf1e9e9e328 Mon Sep 17 00:00:00 2001 From: nox Date: Tue, 19 Nov 2019 23:09:14 +0100 Subject: [PATCH 01/10] Corrections connexion user et affichage dans produits des boutons Actions - Renommage dossier ajax en models --- .gitignore | 1 + public/index.php | 4 ++-- public/js/connex.js | 5 ++-- public/js/script.js | 24 +++++++++---------- public/{ajax => models}/addRecord.php | 0 public/{ajax => models}/addRecord2.php | 0 public/{ajax => models}/connexion.php | 0 public/{ajax => models}/deleteProduits.php | 0 public/{ajax => models}/deleteRecherches.php | 0 public/{ajax => models}/getG1PubKey.php | 0 .../{ajax => models}/readProduitsDetails.php | 0 .../readRecherchesDetails.php | 0 public/{ajax => models}/readRecords.php | 5 ++-- public/{ajax => models}/readRecords2.php | 5 ++-- public/{ajax => models}/readRecords2_sav.php | 0 .../updateProduitsDetails.php | 0 .../updateRecherchesDetails.php | 0 public/{ajax => models}/upload.php | 0 src/Account/views/signup.twig | 2 +- src/Auth/Action/LoginAttemptAction.php | 5 +++- views/layout.twig | 2 +- 21 files changed, 29 insertions(+), 24 deletions(-) rename public/{ajax => models}/addRecord.php (100%) rename public/{ajax => models}/addRecord2.php (100%) rename public/{ajax => models}/connexion.php (100%) rename public/{ajax => models}/deleteProduits.php (100%) rename public/{ajax => models}/deleteRecherches.php (100%) rename public/{ajax => models}/getG1PubKey.php (100%) rename public/{ajax => models}/readProduitsDetails.php (100%) rename public/{ajax => models}/readRecherchesDetails.php (100%) rename public/{ajax => models}/readRecords.php (97%) rename public/{ajax => models}/readRecords2.php (96%) rename public/{ajax => models}/readRecords2_sav.php (100%) rename public/{ajax => models}/updateProduitsDetails.php (100%) rename public/{ajax => models}/updateRecherchesDetails.php (100%) rename public/{ajax => models}/upload.php (100%) diff --git a/.gitignore b/.gitignore index 422241c..39725e2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ config/conf.php vendor composer.json composer.lock +/src/Framework/SwiftMailerFactory.php \ No newline at end of file diff --git a/public/index.php b/public/index.php index 933cb55..6f24e7e 100644 --- a/public/index.php +++ b/public/index.php @@ -24,8 +24,8 @@ require 'vendor/autoload.php'; $chemin = $_SERVER['DOCUMENT_ROOT']; $chemin_new = substr($chemin,0,-6); -$app = (new \Framework\App( $chemin_new .'/config/config.php')) -//$app = (new \Framework\App( '../config/config.php')) +$app = (new \Framework\App( $chemin_new .'config/config.php')) +//$app = (new \Framework\App( $chemin .'config/config.php')) ->addModule(AdminModule::class) ->addModule(ContactModule::class) ->addModule(ProductModule::class) diff --git a/public/js/connex.js b/public/js/connex.js index 85fca62..bd7bc43 100644 --- a/public/js/connex.js +++ b/public/js/connex.js @@ -1,6 +1,5 @@ -function connexion(nom_connecte, mdp) { - - $.post("/ajax/connexion.php", { +function connexion(nom_connecte, mdp, chemin) { + $.post('/models/connexion.php', { nom_connecte: nom_connecte, mdp: mdp }, function (data, status) { diff --git a/public/js/script.js b/public/js/script.js index fe77086..f344981 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -9,7 +9,7 @@ function addRecord(antenne_slug, antenne_id, nom_connecte, id_user) { var quantite = $("#quantite").val(); var prix = $("#prix").val(); // Add record - $.post("/ajax/addRecord.php", { + $.post("/models/addRecord.php", { produit: produit, image: nom_image, vendeur: vendeur, @@ -46,7 +46,7 @@ function addRecord2(antenne_slug, antenne_id, nom_connecte, id_user) { var quantite = $("#quantite").val(); var prix = $("#prix").val(); // Add record - $.post("/ajax/addRecord2.php", { + $.post("/models/addRecord2.php", { produit: produit, image: nom_image, acheteur: acheteur, @@ -75,7 +75,7 @@ function addRecord2(antenne_slug, antenne_id, nom_connecte, id_user) { // READ records function readRecords(antenne_slug, nom_connecte) { - $.get("/ajax/readRecords.php", { + $.get("/models/readRecords.php", { antenne_slug: antenne_slug, nom_connecte: nom_connecte }, function (data, status) { @@ -84,7 +84,7 @@ function readRecords(antenne_slug, nom_connecte) { } // READ records2 function readRecords2(antenne_slug, nom_connecte) { - $.get("/ajax/readRecords2.php", { + $.get("/models/readRecords2.php", { antenne_slug: antenne_slug, nom_connecte: nom_connecte }, function (data, status) { @@ -96,7 +96,7 @@ function DeleteProduits(id, antenne_slug, nom_image) { $("#hidden_antenne_slug").val(antenne_slug); var conf = confirm("Etes-vous sûr(e) de vouloir supprimer ce bien ou service ?"); if (conf == true) { - $.post("/ajax/deleteProduits.php", { + $.post("/models/deleteProduits.php", { id: id, antenne_slug: antenne_slug, nom_image: nom_image @@ -114,7 +114,7 @@ function DeleteRecherches(id, antenne_slug, nom_image) { $("#hidden_antenne_slug_r").val(antenne_slug); var conf = confirm("Etes-vous sûr(e) de vouloir supprimer ce bien ou service ?"); if (conf == true) { - $.post("/ajax/deleteRecherches.php", { + $.post("/models/deleteRecherches.php", { id_r: id, antenne_slug: antenne_slug, nom_image: nom_image @@ -132,7 +132,7 @@ function GetProduitsDetails(id, antenne_slug, nom_image) { $("#hidden_user_id").val(id); $("#hidden_antenne_slug").val(antenne_slug); $("#hidden_image_name").val(nom_image); - $.post("/ajax/readProduitsDetails.php", { + $.post("/models/readProduitsDetails.php", { id: id }, function (data, status) { @@ -153,7 +153,7 @@ function GetRecherchesDetails(id, antenne_slug, nom_image) { $("#hidden_user_id_r").val(id); $("#hidden_antenne_slug_r").val(antenne_slug); $("#hidden_image_name_r").val(nom_image); - $.post("/ajax/readRecherchesDetails.php", { + $.post("/models/readRecherchesDetails.php", { id_r: id }, function (data, status) { @@ -180,7 +180,7 @@ function UpdateProduitsDetails(nom_connecte) { // Champs cachés var id = $("#hidden_user_id").val(); var antenne_slug = $("#hidden_antenne_slug").val(); - $.post("/ajax/updateProduitsDetails.php", { + $.post("/models/updateProduitsDetails.php", { id: id, produit: produit, image: nom_image, @@ -208,7 +208,7 @@ function UpdateRecherchesDetails(nom_connecte) { var id = $("#hidden_user_id_r").val(); var antenne_slug = $("#hidden_antenne_slug_r").val(); // Update the details by requesting to the server using ajax - $.post("/ajax/updateRecherchesDetails.php", { + $.post("/models/updateRecherchesDetails.php", { id: id, produit: produit, image: nom_image, @@ -252,7 +252,7 @@ $(document).ready(function () { // requête AJAX pour copier la photo et l'afficher $.ajax({ - url: '/ajax/upload.php', + url: '/models/upload.php', type: 'post', data: fd_add, contentType: false, @@ -283,7 +283,7 @@ $(document).ready(function () { fd.append('source',source); // requête AJAX pour copier la photo et l'afficher $.ajax({ - url: '/ajax/upload.php', + url: '/models/upload.php', type: 'post', data: fd, contentType: false, diff --git a/public/ajax/addRecord.php b/public/models/addRecord.php similarity index 100% rename from public/ajax/addRecord.php rename to public/models/addRecord.php diff --git a/public/ajax/addRecord2.php b/public/models/addRecord2.php similarity index 100% rename from public/ajax/addRecord2.php rename to public/models/addRecord2.php diff --git a/public/ajax/connexion.php b/public/models/connexion.php similarity index 100% rename from public/ajax/connexion.php rename to public/models/connexion.php diff --git a/public/ajax/deleteProduits.php b/public/models/deleteProduits.php similarity index 100% rename from public/ajax/deleteProduits.php rename to public/models/deleteProduits.php diff --git a/public/ajax/deleteRecherches.php b/public/models/deleteRecherches.php similarity index 100% rename from public/ajax/deleteRecherches.php rename to public/models/deleteRecherches.php diff --git a/public/ajax/getG1PubKey.php b/public/models/getG1PubKey.php similarity index 100% rename from public/ajax/getG1PubKey.php rename to public/models/getG1PubKey.php diff --git a/public/ajax/readProduitsDetails.php b/public/models/readProduitsDetails.php similarity index 100% rename from public/ajax/readProduitsDetails.php rename to public/models/readProduitsDetails.php diff --git a/public/ajax/readRecherchesDetails.php b/public/models/readRecherchesDetails.php similarity index 100% rename from public/ajax/readRecherchesDetails.php rename to public/models/readRecherchesDetails.php diff --git a/public/ajax/readRecords.php b/public/models/readRecords.php similarity index 97% rename from public/ajax/readRecords.php rename to public/models/readRecords.php index 8077419..21d686b 100644 --- a/public/ajax/readRecords.php +++ b/public/models/readRecords.php @@ -1,8 +1,9 @@ '.$cle_pub_format.''; $data .= ''.$row['quantite'].''; $data .= ''.$prix.''; - if ($row['username'] == $_GET['nom_connecte'] ) { + if ($row['username'] == $nom_connecte ) { $data .= ''; $data .= ' + onclick="connexion(document.getElementById('pseudo').value,document.getElementById('mdp').value)">Valider From 24d3336d007c3e6daf5b8c2dd04c29507174f88b Mon Sep 17 00:00:00 2001 From: poka Date: Wed, 20 Nov 2019 21:59:17 +0100 Subject: [PATCH 02/10] Change config var names, fusion config, remove prefix in url routing --- .gitignore | 1 - config.php | 4 ---- config/conf-sample.php | 9 +++++---- config/{config-sample.php => config.php} | 9 +++++---- public/ajax/addRecord.php | 2 +- public/ajax/addRecord2.php | 2 +- public/ajax/connexion.php | 2 +- public/ajax/deleteProduits.php | 2 +- public/ajax/deleteRecherches.php | 2 +- public/ajax/readProduitsDetails.php | 2 +- public/ajax/readRecherchesDetails.php | 2 +- public/ajax/readRecords.php | 2 +- public/ajax/readRecords2.php | 2 +- public/ajax/updateProduitsDetails.php | 2 +- public/ajax/updateRecherchesDetails.php | 2 +- src/Framework/Middleware/TrailingSlashMiddleware.php | 4 ++-- src/Gmarche/config.php | 2 +- 17 files changed, 24 insertions(+), 27 deletions(-) delete mode 100644 config.php rename config/{config-sample.php => config.php} (91%) diff --git a/.gitignore b/.gitignore index 422241c..e77ceac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -config/config.php config/conf.php .idea /public/uploads diff --git a/config.php b/config.php deleted file mode 100644 index 212f5fc..0000000 --- a/config.php +++ /dev/null @@ -1,4 +0,0 @@ - '/news' -]; \ No newline at end of file diff --git a/config/conf-sample.php b/config/conf-sample.php index d322285..be493eb 100644 --- a/config/conf-sample.php +++ b/config/conf-sample.php @@ -1,5 +1,6 @@ \DI\env('ENV', 'production'), - 'database.host' => '', - 'database.username' => '', - 'database.password' => '', - 'database.name' => '', + 'database.host' => "$db_server", + 'database.username' => "$db_username", + 'database.password' => "$db_password", + 'database.name' => "$db_name", 'views.path' => dirname(__DIR__) . '/views', 'twig.extensions' => [ \DI\get(RouterTwigExtension::class), diff --git a/public/ajax/addRecord.php b/public/ajax/addRecord.php index 34883c8..35a7060 100644 --- a/public/ajax/addRecord.php +++ b/public/ajax/addRecord.php @@ -4,7 +4,7 @@ ini_set('display_errors', 0); if ($_POST['produit']!== '' && $_POST['vendeur']!== null && $_POST['quantite']>0 && $_POST['prix']>=0) { // Connexion à la base de données include '../../config/conf.php'; - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); // Récupération des informations du formulaire $params = array(); diff --git a/public/ajax/addRecord2.php b/public/ajax/addRecord2.php index a4a107d..0513b8d 100644 --- a/public/ajax/addRecord2.php +++ b/public/ajax/addRecord2.php @@ -4,7 +4,7 @@ { // Connexion à la base de données include '../../config/conf.php'; - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); // Récupération des informations du formulaire $params = array(); diff --git a/public/ajax/connexion.php b/public/ajax/connexion.php index 075bfc7..3595c80 100644 --- a/public/ajax/connexion.php +++ b/public/ajax/connexion.php @@ -4,7 +4,7 @@ include '../../config/conf.php'; try { - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); if (isset($_POST['nom_connecte']) && isset($_POST['mdp']) != "") { $params["username"] = $_POST['nom_connecte']; diff --git a/public/ajax/deleteProduits.php b/public/ajax/deleteProduits.php index 444e62e..80faed5 100644 --- a/public/ajax/deleteProduits.php +++ b/public/ajax/deleteProduits.php @@ -4,7 +4,7 @@ include '../../config/conf.php'; if($_POST['id'] !== null) { // Connexion à la base de données - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); $params['product_id'] = $_POST['id']; $filename = $_POST['nom_image']; diff --git a/public/ajax/deleteRecherches.php b/public/ajax/deleteRecherches.php index 521e9ff..35dd406 100644 --- a/public/ajax/deleteRecherches.php +++ b/public/ajax/deleteRecherches.php @@ -4,7 +4,7 @@ include '../../config/conf.php'; if($_POST['id_r'] !== null) { // Connexion à la base de données - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); $params['souhait_id'] = $_POST['id_r']; $filename = $_POST['nom_image']; diff --git a/public/ajax/readProduitsDetails.php b/public/ajax/readProduitsDetails.php index 76d3b59..c616086 100644 --- a/public/ajax/readProduitsDetails.php +++ b/public/ajax/readProduitsDetails.php @@ -4,7 +4,7 @@ try { - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); if (isset($_POST['id']) && isset($_POST['id']) != "") { $product_id = $_POST['id']; diff --git a/public/ajax/readRecherchesDetails.php b/public/ajax/readRecherchesDetails.php index e5358cf..1f3d931 100644 --- a/public/ajax/readRecherchesDetails.php +++ b/public/ajax/readRecherchesDetails.php @@ -4,7 +4,7 @@ include '../../config/conf.php'; try { - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); if (isset($_POST['id_r']) && isset($_POST['id_r']) != "") { $souhait_id = $_POST['id_r']; diff --git a/public/ajax/readRecords.php b/public/ajax/readRecords.php index 8077419..36b524f 100644 --- a/public/ajax/readRecords.php +++ b/public/ajax/readRecords.php @@ -3,7 +3,7 @@ include '../../config/conf.php'; $antenne_slug = $_GET['antenne_slug']; $nom_connecte = $_GET['nom_connecte']; - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); // Affichage des intitulés de colonnes $data = ' diff --git a/public/ajax/readRecords2.php b/public/ajax/readRecords2.php index e810520..3ea2bda 100644 --- a/public/ajax/readRecords2.php +++ b/public/ajax/readRecords2.php @@ -3,7 +3,7 @@ include '../../config/conf.php'; $antenne_slug = $_GET['antenne_slug']; $nom_connecte = $_GET['nom_connecte']; - $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); + $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); // Affichage des intitulés de colonnes $data = '
diff --git a/public/ajax/updateProduitsDetails.php b/public/ajax/updateProduitsDetails.php index cfdd1f4..bf9d4cb 100644 --- a/public/ajax/updateProduitsDetails.php +++ b/public/ajax/updateProduitsDetails.php @@ -2,7 +2,7 @@ include '../../config/conf.php'; -$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); +$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); if(isset($_POST)) { diff --git a/public/ajax/updateRecherchesDetails.php b/public/ajax/updateRecherchesDetails.php index bfabd95..c4d4a35 100644 --- a/public/ajax/updateRecherchesDetails.php +++ b/public/ajax/updateRecherchesDetails.php @@ -2,7 +2,7 @@ include '../../config/conf.php'; -$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); +$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); if(isset($_POST)) { diff --git a/src/Framework/Middleware/TrailingSlashMiddleware.php b/src/Framework/Middleware/TrailingSlashMiddleware.php index 262a188..4c0917d 100644 --- a/src/Framework/Middleware/TrailingSlashMiddleware.php +++ b/src/Framework/Middleware/TrailingSlashMiddleware.php @@ -8,7 +8,7 @@ class TrailingSlashMiddleware { public function __invoke(ServerRequestInterface $request, callable $next) { $uri = $request->getUri()->getPath(); - if (!empty($uri) && $uri[-1] === "/") { + if (!empty($uri) && $uri[-1] === "/" && $uri !== "/") { return (new \GuzzleHttp\Psr7\Response()) ->withStatus(301) ->withHeader('Location', substr($uri, 0, -1)); @@ -16,4 +16,4 @@ class TrailingSlashMiddleware { return $next($request); } -} \ No newline at end of file +} diff --git a/src/Gmarche/config.php b/src/Gmarche/config.php index 20f652a..561c078 100644 --- a/src/Gmarche/config.php +++ b/src/Gmarche/config.php @@ -5,5 +5,5 @@ use function \Di\object; use function \Di\get; /* Chemin */ return [ - 'gmarche.prefix' => '/france' + 'gmarche.prefix' => '/' ]; From 6cdfb46025577f4ca099ff01c55231894c483d04 Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 21 Nov 2019 12:57:32 +0100 Subject: [PATCH 03/10] Improve configs files --- .gitignore | 2 +- config/{config.php => apply.php} | 4 ++-- config/{conf-sample.php => config-sample.php} | 1 + public/ajax/addRecord.php | 2 +- public/ajax/addRecord2.php | 2 +- public/ajax/connexion.php | 2 +- public/ajax/deleteProduits.php | 2 +- public/ajax/deleteRecherches.php | 2 +- public/ajax/getG1PubKey.php | 2 +- public/ajax/readProduitsDetails.php | 2 +- public/ajax/readRecherchesDetails.php | 2 +- public/ajax/readRecords.php | 2 +- public/ajax/readRecords2.php | 2 +- public/ajax/updateProduitsDetails.php | 2 +- public/ajax/updateRecherchesDetails.php | 2 +- public/index.php | 4 ++-- 16 files changed, 18 insertions(+), 17 deletions(-) rename config/{config.php => apply.php} (96%) rename config/{conf-sample.php => config-sample.php} (87%) diff --git a/.gitignore b/.gitignore index e77ceac..7a4fc65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -config/conf.php +config/config.php .idea /public/uploads /tmp diff --git a/config/config.php b/config/apply.php similarity index 96% rename from config/config.php rename to config/apply.php index 77e89ad..80827d1 100644 --- a/config/config.php +++ b/config/apply.php @@ -1,5 +1,5 @@ 'admin@gmarche-testmail.com', - 'mail.from' => 'no-reply@admin.fr', + 'mail.from' => '$mail_from', Swift_Mailer::class => \DI\factory(\Framework\SwiftMailerFactory::class) ]; diff --git a/config/conf-sample.php b/config/config-sample.php similarity index 87% rename from config/conf-sample.php rename to config/config-sample.php index be493eb..be398a3 100644 --- a/config/conf-sample.php +++ b/config/config-sample.php @@ -3,4 +3,5 @@ $db_username = ''; $db_password = ''; $db_name = ''; + $mail_from = ''; $g1_node = 'https://duniter-g1.p2p.legal'; diff --git a/public/ajax/addRecord.php b/public/ajax/addRecord.php index 35a7060..6c81824 100644 --- a/public/ajax/addRecord.php +++ b/public/ajax/addRecord.php @@ -3,7 +3,7 @@ ini_set('display_errors', 0); if ($_POST['produit']!== '' && $_POST['vendeur']!== null && $_POST['quantite']>0 && $_POST['prix']>=0) { // Connexion à la base de données - include '../../config/conf.php'; + include '../../config/config.php'; $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); // Récupération des informations du formulaire diff --git a/public/ajax/addRecord2.php b/public/ajax/addRecord2.php index 0513b8d..1101410 100644 --- a/public/ajax/addRecord2.php +++ b/public/ajax/addRecord2.php @@ -3,7 +3,7 @@ if(isset($_POST['produit']) && isset($_POST['acheteur']) && isset($_POST['quantite']) ) { // Connexion à la base de données - include '../../config/conf.php'; + include '../../config/config.php'; $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); // Récupération des informations du formulaire diff --git a/public/ajax/connexion.php b/public/ajax/connexion.php index 3595c80..951db35 100644 --- a/public/ajax/connexion.php +++ b/public/ajax/connexion.php @@ -1,6 +1,6 @@ addModule(AdminModule::class) ->addModule(ContactModule::class) ->addModule(ProductModule::class) From bf21fcf39628f3d5ec9317232778f81f20eb03f7 Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 21 Nov 2019 13:00:35 +0100 Subject: [PATCH 04/10] Improve README.md --- README.md | 4 ++++ readme.md | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 README.md delete mode 100644 readme.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7fd8f62 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Plateforme évènementielle de mise en relation des Ḡmarchés. + +## Site en construction +### TODO: README diff --git a/readme.md b/readme.md deleted file mode 100644 index 03b8dd8..0000000 --- a/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -test -commit du fichier \ No newline at end of file From 8eeafbe1fb8a7e668dd843abc721acb529e77b4b Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 21 Nov 2019 13:02:18 +0100 Subject: [PATCH 05/10] typo readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fd8f62..3d8a652 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Plateforme évènementielle de mise en relation des Ḡmarchés. +# Plateforme événementielle de mise en relation des Ḡmarchés. ## Site en construction ### TODO: README From 7e3d9537c7bde3ef37328daf5d41eb45ca174d34 Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 21 Nov 2019 13:40:50 +0100 Subject: [PATCH 06/10] Comment check if (->matches()) line 94 in vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php --- .../src/DataGenerator/RegexBasedAbstract.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php b/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php index 6457290..b3e42ed 100644 --- a/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php +++ b/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php @@ -91,12 +91,12 @@ abstract class RegexBasedAbstract implements DataGenerator if (isset($this->methodToRegexToRoutesMap[$httpMethod])) { foreach ($this->methodToRegexToRoutesMap[$httpMethod] as $route) { - if ($route->matches($routeStr)) { - throw new BadRouteException(sprintf( - 'Static route "%s" is shadowed by previously defined variable route "%s" for method "%s"', - $routeStr, $route->regex, $httpMethod - )); - } + // if ($route->matches($routeStr)) { + // throw new BadRouteException(sprintf( + // 'Static route "%s" is shadowed by previously defined variable route "%s" for method "%s"', + // $routeStr, $route->regex, $httpMethod + // )); + // } } } From 6296f10b3f16b29ebf6f1b052a3613d9232dc46f Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 21 Nov 2019 13:42:06 +0100 Subject: [PATCH 07/10] Fix home button with standard location --- src/Framework/Middleware/NotFoundMiddleware.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Framework/Middleware/NotFoundMiddleware.php b/src/Framework/Middleware/NotFoundMiddleware.php index 125d19b..f34b422 100644 --- a/src/Framework/Middleware/NotFoundMiddleware.php +++ b/src/Framework/Middleware/NotFoundMiddleware.php @@ -14,7 +14,7 @@ class NotFoundMiddleware { background:url(\'/images/bildreich_1275.jpg\') no-repeat;background-size: cover;">

Erreur 404


Cette url n\'existe pas.

- + Retour à l\'accueil
'); } -} \ No newline at end of file +} From f37184721490312596f447c45d650cc6d8bd5d27 Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 21 Nov 2019 13:43:48 +0100 Subject: [PATCH 08/10] Fix regions link in home page by removing / in src/Gmarche/GmarcheModule.php line 24 --- src/Gmarche/GmarcheModule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gmarche/GmarcheModule.php b/src/Gmarche/GmarcheModule.php index ad076b9..3adde69 100644 --- a/src/Gmarche/GmarcheModule.php +++ b/src/Gmarche/GmarcheModule.php @@ -20,7 +20,7 @@ class GmarcheModule extends Module $gmarchePrefix = $container->get('gmarche.prefix'); $container->get(RendererInterface::class)->addPath('gmarche', __DIR__ . '/views'); $router = $container->get(Router::class); - $router->get( "$gmarchePrefix", RegionIndexAction::class, 'gmarche.index'); - $router->get("$gmarchePrefix/{slug:[a-z\-0-9]+}", AntenneShowAction::class, 'gmarche.antenne'); + $router->get("$gmarchePrefix", RegionIndexAction::class, 'gmarche.index'); + $router->get("$gmarchePrefix{slug:[a-z\-0-9]+}", AntenneShowAction::class, 'gmarche.antenne'); } } From b42726ff2d73b6f38a921e4a5967bf7f2d4c95ad Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 21 Nov 2019 14:16:02 +0100 Subject: [PATCH 09/10] Fix produits and recherches routes --- src/Product/ProductModule.php | 4 ++-- src/Product/views/admin/products/index.twig | 4 ++-- src/Product/views/admin/recherches/index.twig | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Product/ProductModule.php b/src/Product/ProductModule.php index 010edab..93b5275 100644 --- a/src/Product/ProductModule.php +++ b/src/Product/ProductModule.php @@ -20,8 +20,8 @@ class ProductModule extends Module $container->get(RendererInterface::class)->addPath('product', __DIR__ . '/views'); $router = $container->get(Router::class); - $router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/produits", ProductIndexAction::class, 'product.ville'); - $router->get("$gmarchePrefix/{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/recherches", RechIndexAction::class, 'product.recherches'); + $router->get("$gmarchePrefix{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/produits", ProductIndexAction::class, 'product.ville'); + $router->get("$gmarchePrefix{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/recherches", RechIndexAction::class, 'product.recherches'); // $router->crud("$gmarchePrefix/{region:[a-z\-]+}/{slug:[a-z\-0-9]+}/{antenne:[0-9]{1,}}",[LoggedInMiddleware::class, ProductCrudAction::class],'product.admin'); } diff --git a/src/Product/views/admin/products/index.twig b/src/Product/views/admin/products/index.twig index fb258fc..cf4e4d9 100644 --- a/src/Product/views/admin/products/index.twig +++ b/src/Product/views/admin/products/index.twig @@ -93,7 +93,7 @@