@@ 46-49 (lines=4) @@ | ||
43 | switch ($ajaxAction) { |
|
44 | case 'delete': |
|
45 | ||
46 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
47 | echo $PMF_LANG['err_NotAuth']; |
|
48 | exit(1); |
|
49 | } |
|
50 | ||
51 | if ($attachment->delete()) { |
|
52 | echo $PMF_LANG['msgAttachmentsDeleted']; |
@@ 50-53 (lines=4) @@ | ||
47 | ||
48 | case 'add_instance': |
|
49 | ||
50 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
51 | $http->sendJsonWithHeaders(['error' => $PMF_LANG['err_NotAuth']]); |
|
52 | exit(1); |
|
53 | } |
|
54 | ||
55 | $url = Filter::filterInput(INPUT_GET, 'url', FILTER_SANITIZE_STRING); |
|
56 | $instance = Filter::filterInput(INPUT_GET, 'instance', FILTER_SANITIZE_STRING); |
|
@@ 128-131 (lines=4) @@ | ||
125 | ||
126 | case 'delete_instance': |
|
127 | ||
128 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
129 | $http->sendJsonWithHeaders(['error' => $PMF_LANG['err_NotAuth']]); |
|
130 | exit(1); |
|
131 | } |
|
132 | ||
133 | if (null !== $instanceId) { |
|
134 | $faqInstance = new Instance($faqConfig); |
|
@@ 174-177 (lines=4) @@ | ||
171 | ||
172 | case 'save_stop_word': |
|
173 | ||
174 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
175 | $http->sendJsonWithHeaders(['error' => $PMF_LANG['err_NotAuth']]); |
|
176 | exit(1); |
|
177 | } |
|
178 | ||
179 | if (null != $stopword && Language::isASupportedLanguage($stopwordsLang)) { |
|
180 | $stopwords->setLanguage($stopwordsLang); |
|
@@ 191-194 (lines=4) @@ | ||
188 | ||
189 | case 'add_meta': |
|
190 | ||
191 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
192 | $http->sendJsonWithHeaders(['error' => $PMF_LANG['err_NotAuth']]); |
|
193 | exit(1); |
|
194 | } |
|
195 | ||
196 | $meta = new Meta($faqConfig); |
|
197 | $entity = new MetaEntity(); |
|
@@ 217-220 (lines=4) @@ | ||
214 | ||
215 | case 'delete_meta': |
|
216 | ||
217 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
218 | $http->sendJsonWithHeaders(['error' => $PMF_LANG['err_NotAuth']]); |
|
219 | exit(1); |
|
220 | } |
|
221 | ||
222 | $meta = new Meta($faqConfig); |
|
223 | $metaId = Filter::filterInput(INPUT_GET, 'meta_id', FILTER_SANITIZE_STRING); |
@@ 43-46 (lines=4) @@ | ||
40 | ||
41 | $csrfToken = (is_null($csrfTokenPost) ? $csrfTokenGet : $csrfTokenPost); |
|
42 | ||
43 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
44 | echo $PMF_LANG['err_NotAuth']; |
|
45 | exit(1); |
|
46 | } |
|
47 | ||
48 | $items = isset($_GET['items']) && is_array($_GET['items']) ? $_GET['items'] : []; |
|
49 |
@@ 78-81 (lines=4) @@ | ||
75 | $tag = Filter::filterInput(INPUT_POST, 'tag', FILTER_SANITIZE_STRING); |
|
76 | $csrfToken = Filter::filterInput(INPUT_POST, 'csrf', FILTER_SANITIZE_STRING); |
|
77 | ||
78 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
79 | echo json_encode($PMF_LANG['err_NotAuth']); |
|
80 | exit(1); |
|
81 | } |
|
82 | ||
83 | $entity = new TagEntity(); |
|
84 | $entity->setId($id); |
@@ 78-81 (lines=4) @@ | ||
75 | break; |
|
76 | ||
77 | case 'activate_user': |
|
78 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
79 | $http->sendJsonWithHeaders(array('error' => $PMF_LANG['err_NotAuth'])); |
|
80 | exit(1); |
|
81 | } |
|
82 | ||
83 | $user->getUserById($userId, true); |
|
84 | $user->setStatus('active'); |
|
@@ 90-93 (lines=4) @@ | ||
87 | break; |
|
88 | ||
89 | case 'delete_user': |
|
90 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
91 | $http->sendJsonWithHeaders(array('error' => $PMF_LANG['err_NotAuth'])); |
|
92 | exit(1); |
|
93 | } |
|
94 | ||
95 | $user->getUserById($userId, true); |
|
96 | if ($user->getStatus() == 'protected' || $userId == 1) { |
|
@@ 123-126 (lines=4) @@ | ||
120 | $newPassword = Filter::filterInput(INPUT_POST, 'npass', FILTER_SANITIZE_STRING); |
|
121 | $retypedPassword = Filter::filterInput(INPUT_POST, 'bpass', FILTER_SANITIZE_STRING); |
|
122 | ||
123 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
|
124 | $http->sendJsonWithHeaders(array('error' => $PMF_LANG['err_NotAuth'])); |
|
125 | exit(1); |
|
126 | } |
|
127 | ||
128 | $user->getUserById($userId, true); |
|
129 | $auth = new Auth($faqConfig); |