diff options
author | polo <ordipolo@gmx.fr> | 2021-11-29 03:25:19 +0100 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2021-11-29 03:25:19 +0100 |
commit | 29df6f1362745eabf4fbcaedf309eb63795152fa (patch) | |
tree | 8c2f4839c119db193eca4f35aeac96356a8ef439 /index.php | |
parent | b97a68343ec5c4ff1fae25ff5dc41f1a2ce6a17f (diff) | |
download | melaine-29df6f1362745eabf4fbcaedf309eb63795152fa.zip |
discographie
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 39 |
1 files changed, 20 insertions, 19 deletions
@@ -47,6 +47,12 @@ | |||
47 | // infos: https://fr.wikipedia.org/wiki/Cross-site_request_forgery | 47 | // infos: https://fr.wikipedia.org/wiki/Cross-site_request_forgery |
48 | session_start(); | 48 | session_start(); |
49 | 49 | ||
50 | if(!empty($_SESSION['erreur'])) | ||
51 | { | ||
52 | echo('<script>alert(\'' . $_SESSION['erreur'] . '\');</script>'); | ||
53 | unset($_SESSION['erreur']); | ||
54 | } | ||
55 | |||
50 | // au premier démarrage du site | 56 | // au premier démarrage du site |
51 | // l'explication des éventuels problèmes de droits en lecture/écriture est à chercher ici: | 57 | // l'explication des éventuels problèmes de droits en lecture/écriture est à chercher ici: |
52 | require('controller/installation.php'); | 58 | require('controller/installation.php'); |
@@ -58,8 +64,10 @@ installation(); | |||
58 | if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_image') | 64 | if(isset($_GET['action']) && isset($_GET['page']) && $_GET['action'] == 'upload_image') |
59 | { | 65 | { |
60 | // et une backdoor de fermée! | 66 | // et une backdoor de fermée! |
61 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1 || !isset($_FILES['upload']) || empty($_FILES['upload'])) | 67 | if(!isset($_SESSION['admin']) || $_SESSION['admin'] != 1 |
68 | || !isset($_FILES['upload']) || empty($_FILES['upload'])) | ||
62 | { | 69 | { |
70 | // sans effet? | ||
63 | header('Location: index.php?erreur=image_ajax'); | 71 | header('Location: index.php?erreur=image_ajax'); |
64 | } | 72 | } |
65 | else | 73 | else |
@@ -90,9 +98,9 @@ if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1 | |||
90 | } | 98 | } |
91 | 99 | ||
92 | // modification | 100 | // modification |
93 | if(isset($_SESSION['nomFichier'])) | 101 | if(isset($_SESSION['target'])) |
94 | { | 102 | { |
95 | submitCKeditor($_SESSION['nomFichier']); | 103 | submitCKeditor($_SESSION['target']); |
96 | } | 104 | } |
97 | // nouvel article | 105 | // nouvel article |
98 | else | 106 | else |
@@ -179,10 +187,8 @@ if(isset($_GET['page'])) | |||
179 | else | 187 | else |
180 | { | 188 | { |
181 | // par sécurité | 189 | // par sécurité |
182 | if(isset($_SESSION['nomFichier'])) | 190 | unset($_SESSION['nomFichier']); |
183 | { | 191 | |
184 | unset($_SESSION['nomFichier']); | ||
185 | } | ||
186 | melaineEdit(0, 0); | 192 | melaineEdit(0, 0); |
187 | } | 193 | } |
188 | } | 194 | } |
@@ -202,29 +208,24 @@ if(isset($_GET['page'])) | |||
202 | if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'edition') | 208 | if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'edition') |
203 | { | 209 | { |
204 | // modification | 210 | // modification |
205 | if(isset($_GET['album']) && is_numeric($_GET['album']) && $_GET['album'] > 0) | 211 | if(isset($_GET['album_code']) || !empty($_GET['album_code'])) |
206 | { | 212 | { |
207 | if(!isset($_GET['album_code'])) | 213 | discoEdit($_GET['album_code'], 0); |
208 | { | ||
209 | $_GET['album_code'] = ''; | ||
210 | } | ||
211 | discoEdit($_GET['album'], $_GET['album_code'], 0); | ||
212 | } | 214 | } |
213 | // nouvel article | 215 | // nouvel article |
214 | else | 216 | else |
215 | { | 217 | { |
216 | // par sécurité | 218 | // par sécurité |
217 | if(isset($_SESSION['nomFichier'])) | 219 | $_GET['album_code'] = ''; |
218 | { | 220 | unset($_SESSION['nomFichier']); |
219 | unset($_SESSION['nomFichier']); | 221 | |
220 | } | 222 | discoEdit('', 0); |
221 | discoEdit(0, '', 0); | ||
222 | } | 223 | } |
223 | } | 224 | } |
224 | // suppression | 225 | // suppression |
225 | else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'suppression') | 226 | else if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'suppression') |
226 | { | 227 | { |
227 | discoEdit($_GET['album'], '', 1); | 228 | discoEdit($_GET['album_code'], 1); |
228 | } | 229 | } |
229 | else | 230 | else |
230 | { | 231 | { |