aboutsummaryrefslogtreecommitdiff
path: root/src/router.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/router.php')
-rw-r--r--src/router.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/router.php b/src/router.php
index 15d5a4c..228fae2 100644
--- a/src/router.php
+++ b/src/router.php
@@ -38,6 +38,12 @@ if($request->getMethod() === 'GET'){
38 CalendarController::getData($entityManager); 38 CalendarController::getData($entityManager);
39 } 39 }
40 40
41 // pages interdites
42 if(!$_SESSION['admin'] && in_array(CURRENT_PAGE, ['menu_paths', 'new_page', 'user_edit', 'emails'])){
43 header('Location: ' . new URL);
44 die;
45 }
46
41 if($_SESSION['admin'] === true){ 47 if($_SESSION['admin'] === true){
42 // ... 48 // ...
43 } 49 }
@@ -106,6 +112,9 @@ elseif($request->getMethod() === 'POST'){
106 } 112 }
107 113
108 /* -- bloc Formulaire -- */ 114 /* -- bloc Formulaire -- */
115 elseif($_GET['action'] === 'keep_emails'){
116 ContactFormController::keepEmails($entityManager, $json);
117 }
109 elseif($_GET['action'] === 'set_email_param'){ 118 elseif($_GET['action'] === 'set_email_param'){
110 ContactFormController::setEmailParam($entityManager, $json); 119 ContactFormController::setEmailParam($entityManager, $json);
111 } 120 }
@@ -113,6 +122,13 @@ elseif($request->getMethod() === 'POST'){
113 ContactFormController::sendTestEmail($entityManager, $json); 122 ContactFormController::sendTestEmail($entityManager, $json);
114 } 123 }
115 124
125 /* -- page emails -- */
126 elseif($_GET['action'] === 'delete_email'){
127 ContactFormController::deleteEmail($entityManager, $json);
128 }
129 elseif($_GET['action'] === 'toggle_sensitive_email'){
130 ContactFormController::toggleSensitiveEmail($entityManager, $json);
131 }
116 132
117 /* -- upload d'image dans tinymce par copier-coller -- */ 133 /* -- upload d'image dans tinymce par copier-coller -- */
118 // collage de HTML contenant une ou plusieurs balises <img> 134 // collage de HTML contenant une ou plusieurs balises <img>