diff options
Diffstat (limited to 'controller/ajax.php')
-rw-r--r-- | controller/ajax.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/controller/ajax.php b/controller/ajax.php index 1a4909e..96df9cb 100644 --- a/controller/ajax.php +++ b/controller/ajax.php | |||
@@ -4,12 +4,12 @@ | |||
4 | // traitement des requêtes AJAX | 4 | // traitement des requêtes AJAX |
5 | 5 | ||
6 | 6 | ||
7 | // -> insertion d'une image dans l'éditeur | 7 | // éditeur |
8 | // -> insertion d'une image | ||
8 | if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_image') | 9 | if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_image') |
9 | { | 10 | { |
10 | // sécurité !! | 11 | // sécurité !! |
11 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1 | 12 | if(!isset($_SESSION) || !isset($_FILES['upload']) || empty($_FILES['upload'])) |
12 | || !isset($_FILES['upload']) || empty($_FILES['upload'])) | ||
13 | { | 13 | { |
14 | // sans effet? | 14 | // sans effet? |
15 | header('Location: index.php?erreur=image_ajax'); | 15 | header('Location: index.php?erreur=image_ajax'); |
@@ -48,7 +48,7 @@ if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_ | |||
48 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' | 48 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' |
49 | && isset($_GET['file_name']) && isset($_GET['file_size'])) | 49 | && isset($_GET['file_name']) && isset($_GET['file_size'])) |
50 | { | 50 | { |
51 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) | 51 | if(!isset($_SESSION)) |
52 | { | 52 | { |
53 | header('Location: index.php?erreur=file_infos_ajax'); | 53 | header('Location: index.php?erreur=file_infos_ajax'); |
54 | } | 54 | } |
@@ -56,8 +56,6 @@ if(isset($_GET['action']) && $_GET['action'] == 'restauration' | |||
56 | { | 56 | { |
57 | $_SESSION['fileSize'] = $_GET['file_size']; | 57 | $_SESSION['fileSize'] = $_GET['file_size']; |
58 | $_SESSION['fileName'] = $_GET['file_name']; | 58 | $_SESSION['fileName'] = $_GET['file_name']; |
59 | //echo("file infos send"); | ||
60 | //var_dump($_SESSION['fileName']); | ||
61 | exit(); // stop !! | 59 | exit(); // stop !! |
62 | } | 60 | } |
63 | } | 61 | } |
@@ -65,8 +63,7 @@ if(isset($_GET['action']) && $_GET['action'] == 'restauration' | |||
65 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' | 63 | if(isset($_GET['action']) && $_GET['action'] == 'restauration' |
66 | && isset($_GET['chunk_name']) && isset($_FILES['blob'])) | 64 | && isset($_GET['chunk_name']) && isset($_FILES['blob'])) |
67 | { | 65 | { |
68 | 66 | if(!isset($_SESSION)) | |
69 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1) | ||
70 | { | 67 | { |
71 | header('Location: index.php?erreur=upload_ajax'); | 68 | header('Location: index.php?erreur=upload_ajax'); |
72 | } | 69 | } |
@@ -79,7 +76,7 @@ if(isset($_GET['action']) && $_GET['action'] == 'restauration' | |||
79 | } | 76 | } |
80 | } | 77 | } |
81 | 78 | ||
82 | // nettoyage | 79 | // nettoyage systématique |
83 | if(!isset($_GET['action']) || $_GET['action'] != 'restauration') | 80 | if(!isset($_GET['action']) || $_GET['action'] != 'restauration') |
84 | { | 81 | { |
85 | if(isset($_SESSION['fileName'])) | 82 | if(isset($_SESSION['fileName'])) |