Merge remote-tracking branch 'origin' into dev-new-conf

This commit is contained in:
poka 2019-11-21 16:37:05 +01:00
commit 7984a95d17
21 changed files with 28 additions and 24 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ config/config.php
vendor
composer.json
composer.lock
/src/Framework/SwiftMailerFactory.php

View File

@ -24,8 +24,7 @@ require 'vendor/autoload.php';
$chemin = $_SERVER['DOCUMENT_ROOT'];
$chemin_new = substr($chemin,0,-6);
$app = (new \Framework\App( $chemin_new .'/config/apply.php'))
//$app = (new \Framework\App( '../config/apply.php'))
$app = (new \Framework\App( $chemin_new .'config/apply.php'))
->addModule(AdminModule::class)
->addModule(ContactModule::class)
->addModule(ProductModule::class)

View File

@ -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) {

View File

@ -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,

View File

@ -1,8 +1,9 @@
<?php
session_start();
ini_set('display_errors', 0);
include '../../config/config.php';
$antenne_slug = $_GET['antenne_slug'];
$nom_connecte = $_GET['nom_connecte'];
$nom_connecte = $_SESSION['user'];
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
// Affichage des intitulés de colonnes
@ -61,7 +62,7 @@
$data .= '<td>'.$cle_pub_format.'</td>';
$data .= '<td>'.$row['quantite'].'</td>';
$data .= '<td>'.$prix.'</td>';
if ($row['username'] == $_GET['nom_connecte'] ) {
if ($row['username'] == $nom_connecte ) {
$data .= '<td>';
$data .= '<button onclick="GetProduitsDetails(\'';
$data .= $row['id'];

View File

@ -1,8 +1,9 @@
<?php
session_start();
ini_set('display_errors', 0);
include '../../config/config.php';
$antenne_slug = $_GET['antenne_slug'];
$nom_connecte = $_GET['nom_connecte'];
$nom_connecte = $_SESSION['user'];
$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
// Affichage des intitulés de colonnes
@ -59,7 +60,7 @@
$data .= '<td>'.$pubkeyShort.'...</td>';
$data .= '<td>'.$row['quantite'].'</td>';
$data .= '<td>'.$prix.'</td>';
if ($row['username'] == $_GET['nom_connecte'] ) {
if ($row['username'] == $nom_connecte ) {
$data .= '<td>';
$data .= '<button onclick="GetRecherchesDetails(\'';
$data .= $row['id'];

View File

@ -44,7 +44,7 @@ textInput.onkeyup = function (e) {
}
}
$body.addClass("loading");
xmlhttp.open("GET","/ajax/getG1PubKey.php?vendeur="+textInput.value,true);
xmlhttp.open("GET","/models/getG1PubKey.php?vendeur="+textInput.value,true);
xmlhttp.send();
}, 800);
};

View File

@ -50,7 +50,10 @@ class LoginAttemptAction
$params = $request->getParsedBody();
$user = $this->auth->login($params['username'], $params['password']);
if ($user) {
$path = $this->session->get('auth.redirect');
if(!isset($_SESSION)) {
session_start();
}
$nom_user = $_SESSION['user'] = $params['username'];
$path = $this->session->get('auth.redirect') ?? $this->router->generateUri('gmarche.index');
$this->session->delete('auth.redirect');
return new RedirectResponse($path);

View File

@ -115,7 +115,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
<button type="button" class="btn btn-primary"
onclick="connexion(document.getElementById('pseudo').value,document.getElementById('mdp').value)">Valider</button>
onclick="connexion(document.getElementById('pseudo').value,document.getElementById('mdp').value)">Valider</button>
</div>
</div>
</div>