Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #150 from CraftMyWebsite/Développement
Browse files Browse the repository at this point in the history
1.8.1
  • Loading branch information
Florentlife authored Dec 27, 2020
2 parents 5f64b44 + 2613bc8 commit 6de02da
Show file tree
Hide file tree
Showing 83 changed files with 1,498 additions and 937 deletions.
8 changes: 4 additions & 4 deletions admin/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{
switch ($_GET['action']) // on utilise ici un switch pour inclure telle ou telle page selon l'action.
{
case 'supprUpload':
require('admin/actions/supprUpload.php');
exit();
case 'editUploadImage':
if($_Permission_->verifPerm('PermsPanel', 'general', 'actions', 'editUploadImg')) {
$_Serveur_['uploadImage']['maxFileSize'] = intval($_POST['maxFileSize']);
Expand Down Expand Up @@ -416,10 +419,7 @@
case 'changeSlider':
require_once('admin/actions/changeSlider.php');
break;

case 'postSlider':
require_once('admin/actions/postSlider.php');
break;


case 'supprSlider':
require_once('admin/actions/supprSlider.php');
Expand Down
1 change: 1 addition & 0 deletions admin/actions/.htpasswd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cms:58d3eec4522c2da0726905295171549e
5 changes: 4 additions & 1 deletion admin/actions/addRapNav.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
{
break;
} else {
$lectureAccueil['Infos'][$i+1] = $lectureAccueil['Infos'][$i];
$lectureAccueil['Infos'][$i+1]['message'] = $lectureAccueil['Infos'][$i]['message'];
$lectureAccueil['Infos'][$i+1]['image'] = $lectureAccueil['Infos'][$i]['image'];
$lectureAccueil['Infos'][$i+1]['type'] = $lectureAccueil['Infos'][$i]['type'];
$lectureAccueil['Infos'][$i+1]['lien'] = $lectureAccueil['Infos'][$i]['lien'];
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions admin/actions/addSocial.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
if($_Permission_->verifPerm('PermsPanel', 'reseaux', 'showPage'))
if($_Permission_->verifPerm('PermsPanel', 'social', 'actions', 'addSocial'))
{
$nom = htmlspecialchars($_POST['nom']);
$req = $bddConnection->prepare('ALTER TABLE cmw_reseaux ADD :nom VARCHAR(30)');
$req->execute(array('nom' => $nom));
$req = $bddConnection->exec('ALTER TABLE cmw_reseaux ADD COLUMN '.$nom.' VARCHAR(30)');
}
?>
6 changes: 3 additions & 3 deletions admin/actions/editBoutique.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php
if($_Permission_->verifPerm('PermsPanel', 'shop', 'actions', 'editCategorieOffre')) {

require('modele/app/ckeditor.class.php');

$_POST['categorieNom'] = htmlspecialchars($_POST['categorieNom']);
$_POST['number'] = intval($_POST['number']);

require('modele/app/ckeditor.class.php');
$_POST['categorieInfo'] = ckeditor::verif($_POST['categorieInfo']);
$req = $bddConnection->prepare('UPDATE cmw_boutique_categories SET titre = :titre, message = :message, showNumber = :show WHERE id = :id');
$req->execute(Array (
Expand Down Expand Up @@ -58,8 +59,7 @@
} else {

$_POST['offresNom'.$offres[$j]['id']] = htmlspecialchars($_POST['offresNom'.$offres[$j]['id']]);
$_POST['offresDescription'.$offres[$j]['id']] = htmlspecialchars($_POST['offresDescription'.$offres[$j]['id']]);
require('modele/app/ckeditor.class.php');
$_POST['offresDescription'.$offres[$j]['id']] = htmlspecialchars($_POST['offresDescription'.$offres[$j]['id']]);
$_POST['offresDescription'.$offres[$j]['id']] = ckeditor::verif($_POST['offresDescription'.$offres[$j]['id']]);
$req = $bddConnection->prepare('UPDATE `cmw_boutique_offres` SET `nom`=:nom,`description`=:description,`prix`=:prix,`nbre_vente`=:nbre_vente,`categorie_id`=:categorie_id,`ordre`=:ordre,`evo`=:evo,`max_vente`=:max_vente WHERE id=:id');
$req->execute(Array (
Expand Down
1 change: 1 addition & 0 deletions admin/actions/editRapNav.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{
$lectureAccueil['Infos'][$_POST["ordre". $i]]['message'] = $_POST['message' . $i];
$lectureAccueil['Infos'][$_POST["ordre". $i]]['image'] = $_POST['image' . $i];
$lectureAccueil['Infos'][$_POST["ordre". $i]]['type'] = $_POST['typeLien'. $i];
if($_POST['typeLien'. $i] == 'page')
$lectureAccueil['Infos'][$_POST["ordre". $i]]['lien'] = '?page='. urlencode($_POST['page' . $i]);
else
Expand Down
25 changes: 20 additions & 5 deletions admin/actions/editResetVote.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,26 @@
}
$temp['etat'] = RecompenseAuto::configureNextDate($temp, $type);
$action = json_encode($temp);

$req = $bddConnection->query('SELECT * FROM cmw_votes_recompense_auto_config WHERE type=3');
$req = $req->fetch(PDO::FETCH_ASSOC);
if(isset($req) && !empty($req)) {
$req = $bddConnection->prepare('UPDATE cmw_votes_recompense_auto_config SET `valueType`=:type, `action`=:action WHERE type=3 ');
$req->execute(array(
'type' => $type,
'action' => $action
));
} else {
$req = $bddConnection->prepare('INSERT INTO cmw_votes_recompense_auto_config ( `type`, `valueType`, `action`) VALUES (3,:type,:action)');
$req->execute(array(
'type' => $type,
'action' => $action
));
}
}
$req = $bddConnection->prepare('UPDATE cmw_votes_recompense_auto_config SET `valueType`=:type, `action`=:action WHERE type=3 ');
$req->execute(array(
'type' => $type,
'action' => $action
));
else {
$bddConnection->exec('DELETE FROM cmw_votes_recompense_auto_config WHERE type=3 ');
}

}
?>
1 change: 0 additions & 1 deletion admin/actions/getJsonVoteHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
$lienData[$TemplienData['id']] = $TemplienData;
}

echo var_dump($lienData);

$i = 0;
while($VoteHistoryData = $VoteHistoryReq->fetch(PDO::FETCH_ASSOC))
Expand Down
8 changes: 4 additions & 4 deletions admin/actions/getRecompenseList.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php if($_Permission_->verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'resetRecompense')) {
<?php if($_Permission_->verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'editRecompense')) {
require_once('./admin/donnees/configVoter.php'); ?>
<div>
<table class="table table-striped table-hover">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Type</th>
Expand All @@ -20,7 +20,7 @@
echo $donnees[$o]['valueType'].' votes';
else
{
echo $donnees[$o]['valueType'];
echo $donnees[$o]['valueType'];
if(((int)$donnees[$o]['valueType'])==1) {
echo 'ier';
} else {
Expand Down Expand Up @@ -49,7 +49,7 @@
echo substr($f, 0, -5);
} ?>
</td>
<td><button onclick="sendDirectPost('?action=supprRecAuto&id=<?=$donnees[$o]['id'];?>', function(data) { if(data) { hide('rec-<?php echo $o; ?>'); }});" class="btn btn-outline-secondary">Supprimer</button></td>
<td><button onclick="sendDirectPost('admin.php?action=supprRecAuto&id=<?=$donnees[$o]['id'];?>', function(data) { if(data) { hide('rec-<?php echo $o; ?>'); }});" class="btn btn-outline-secondary">Supprimer</button></td>
</tr>
<?php
}
Expand Down
8 changes: 7 additions & 1 deletion admin/actions/postBG.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@


if($verif == 4)
{
$copie->Copie();
}
header('Location: admin.php?page=theme&upload='.$verif);
exit();
}
}
header('Location: ?page=theme');
header('Location: admin.php?page=theme&upload=5');
exit();

?>
8 changes: 7 additions & 1 deletion admin/actions/postNavRap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
$copie = new Copie('theme/upload/navRap/', $_FILES['img'], 10000000, $types, 2000, 2000);
$verif = $copie->Verification();


if($verif == 4)
{
$copie->Copie();
}

header('Location: admin.php?page=slidemini&upload='.$verif);
exit();
}
}
header('Location: admin.php?page=slidemini&upload=5');
exit();
?>
17 changes: 0 additions & 17 deletions admin/actions/postSlider.php

This file was deleted.

40 changes: 27 additions & 13 deletions admin/actions/supprMini.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,36 @@

if(isset($_GET['id']) && $_Permission_->verifPerm('PermsPanel', 'home', 'actions','editMiniature'))
{
$id = intval(htmlentities($_GET['id']));
$tmp = array(
'Infos' => array(),
'Slider' => $lectureAccueil['Slider'],
'SliderTitre' => $lectureAccueil['SliderTitre']
);
$i = 1;
$lectureAccueil = new Lire('modele/config/accueil.yml');
$lectureAccueil = $lectureAccueil->GetTableau();

$id = intval($_GET['id']);

$flag = 0;
$last = -1;

foreach($lectureAccueil['Infos'] as $key => $value)
{
if($key != $id)

if(intval($key) == $id)
{
$tmp['Infos'][strval($i)]['message'] = $value['message'];
$tmp['Infos'][strval($i)]['image'] = $value['image'];
$tmp['Infos'][strval($i)]['lien'] = $value['lien'];
$i++;
$flag = 1;
continue;
}
if($flag == 1 | $flag == 2) {
$flag = 2;
$lectureAccueil['Infos'][intval($key) - 1]['message'] = $lectureAccueil['Infos'][$key]['message'];
$lectureAccueil['Infos'][intval($key) - 1]['image'] = $lectureAccueil['Infos'][$key]['image'];
$lectureAccueil['Infos'][intval($key) - 1]['lien'] = $lectureAccueil['Infos'][$key]['lien'];
$lectureAccueil['Infos'][intval($key) - 1]['type'] = $lectureAccueil['Infos'][$key]['type'];
$last = intval($key);
}
}

if($flag == 1) {
unset($lectureAccueil['Infos'][$id]);
} else if($flag == 2) {
unset($lectureAccueil['Infos'][$last]);
}
$ecriture = new Ecrire('modele/config/accueil.yml', $tmp);
$ecriture = new Ecrire('modele/config/accueil.yml', $lectureAccueil);
}
2 changes: 1 addition & 1 deletion admin/actions/supprRecAuto.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

if($_Permission_->verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'resetRecompense'))
if($_Permission_->verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'editRecompense'))
{
if(isset($_GET['id']))
{
Expand Down
6 changes: 6 additions & 0 deletions admin/actions/supprUpload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
if($_Permission_->verifPerm('PermsPanel', 'upload', 'manage')) {

unlink('./theme/upload/panel/'.$_GET['file']);

}?>
4 changes: 2 additions & 2 deletions admin/assets/js/ckeditor.js

Large diffs are not rendered by default.

Loading

0 comments on commit 6de02da

Please sign in to comment.