diff --git a/admin/action.php b/admin/action.php index 580a6804..b5e67fb1 100644 --- a/admin/action.php +++ b/admin/action.php @@ -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']); @@ -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'); diff --git a/admin/actions/.htpasswd b/admin/actions/.htpasswd new file mode 100644 index 00000000..f1f89810 --- /dev/null +++ b/admin/actions/.htpasswd @@ -0,0 +1 @@ +cms:58d3eec4522c2da0726905295171549e \ No newline at end of file diff --git a/admin/actions/addRapNav.php b/admin/actions/addRapNav.php index ef6b8157..94e2dd05 100644 --- a/admin/actions/addRapNav.php +++ b/admin/actions/addRapNav.php @@ -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']; } } } diff --git a/admin/actions/addSocial.php b/admin/actions/addSocial.php index 73a7c884..783d078e 100644 --- a/admin/actions/addSocial.php +++ b/admin/actions/addSocial.php @@ -1,8 +1,7 @@ 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)'); } ?> \ No newline at end of file diff --git a/admin/actions/editBoutique.php b/admin/actions/editBoutique.php index daa75c12..ab38989a 100644 --- a/admin/actions/editBoutique.php +++ b/admin/actions/editBoutique.php @@ -1,10 +1,11 @@ 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 ( @@ -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 ( diff --git a/admin/actions/editRapNav.php b/admin/actions/editRapNav.php index 18b14e84..7e200a77 100644 --- a/admin/actions/editRapNav.php +++ b/admin/actions/editRapNav.php @@ -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 diff --git a/admin/actions/editResetVote.php b/admin/actions/editResetVote.php index be2e0272..e0db614f 100644 --- a/admin/actions/editResetVote.php +++ b/admin/actions/editResetVote.php @@ -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 '); + } + } ?> \ No newline at end of file diff --git a/admin/actions/getJsonVoteHistory.php b/admin/actions/getJsonVoteHistory.php index 42ab04a4..ce5e8216 100644 --- a/admin/actions/getJsonVoteHistory.php +++ b/admin/actions/getJsonVoteHistory.php @@ -13,7 +13,6 @@ $lienData[$TemplienData['id']] = $TemplienData; } - echo var_dump($lienData); $i = 0; while($VoteHistoryData = $VoteHistoryReq->fetch(PDO::FETCH_ASSOC)) diff --git a/admin/actions/getRecompenseList.php b/admin/actions/getRecompenseList.php index c5dc5b4c..91b1c71c 100644 --- a/admin/actions/getRecompenseList.php +++ b/admin/actions/getRecompenseList.php @@ -1,7 +1,7 @@ -verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'resetRecompense')) { +verifPerm('PermsPanel', 'vote', 'recompenseAuto', 'actions', 'editRecompense')) { require_once('./admin/donnees/configVoter.php'); ?>