From 839981c313ee806ea8cc263a081e911a164d1c4f Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 30 Apr 2023 16:25:08 +0200 Subject: bricoles --- controller/ajax.php | 57 +++++++++++++---------------------------------------- 1 file changed, 14 insertions(+), 43 deletions(-) (limited to 'controller/ajax.php') diff --git a/controller/ajax.php b/controller/ajax.php index 26aa9c6..ed840cd 100644 --- a/controller/ajax.php +++ b/controller/ajax.php @@ -38,48 +38,6 @@ if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_ } -// inversion des positions de deux éléments d'une page -/*if(isset($_GET['action']) && isset($_GET['page']) && ($_GET['action'] == 'monter' || $_GET['action'] == 'descendre') && isset($_GET['file_code']) && !empty($_GET['file_code'])) -{ - // sécurité !! - if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) - { - header('Location: index.php?erreur=interdit'); - } - else - { - require('controller/admin.php'); - require('model/Article.php'); - - $pagesArticlesSimples = ['menu', 'melaine', 'musique', 'presse', 'livres', 'jaime', 'peinture', 'archives', 'legal']; - $sens = 0; - - if($_GET['action'] == 'monter') - { - $sens = 1; - } - if($_GET['action'] == 'descendre') - { - $sens = 0; - } - - if(in_array($_GET['page'], $pagesArticlesSimples)) - { - // 1 pour monter - inversionPositions($_GET['page'], $_GET['file_code'], 'Article', $sens); - } - elseif($_GET['page'] == 'discographie') - { - require('model/Album.php'); - - // 1 pour monter - inversionPositions($_GET['page'], $_GET['file_code'], 'Album', $sens); - } - } - exit(); // stop !! -}*/ - - // page restauration quand le fichier zip est lourd // -> input file onchange if(isset($_GET['action']) && $_GET['action'] == 'restauration' @@ -114,4 +72,17 @@ if(isset($_GET['action']) && $_GET['action'] == 'restauration' echo('file send'); exit(); // stop !! } -} \ No newline at end of file +} + +// nettoyage +if(!isset($_GET['action']) || $_GET['action'] != 'restauration') +{ + if(isset($_SESSION['fileName'])) + { + unset($_SESSION['fileName']); + } + if(isset($_SESSION['fileSize'])) + { + unset($_SESSION['fileSize']); + } +} -- cgit v1.2.3