Ajax headers for alert forms #3432

Merged
merged 5 commits into from Apr 29, 2016

Projects

None yet

3 participants

@pblasquez
Contributor

Please see #3113 for context, this is the alert logical grouping.

pblasquez added some commits Apr 22, 2016
@pblasquez pblasquez Merge remote-tracking branch 'refs/remotes/librenms/master' 4510811
@pblasquez pblasquez Merge remote-tracking branch 'refs/remotes/librenms/master' add7aeb
@pblasquez pblasquez Ajax Headers for Alert Forms
d4d2736
@laf laf commented on an outdated diff Apr 28, 2016
html/includes/forms/parse-alert-map.inc.php
@@ -11,6 +11,7 @@
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
+header('Content-type: application/json');
if (is_admin() === false) {
die('ERROR: You need to be admin');
@laf
laf Apr 28, 2016 Member

This would be none-json output. We need to fix that :(

@laf laf commented on an outdated diff Apr 28, 2016
html/includes/forms/parse-alert-rule.inc.php
@@ -11,6 +11,7 @@
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
+header('Content-type: application/json');
if (is_admin() === false) {
die('ERROR: You need to be admin');
@laf
laf Apr 28, 2016 Member

This would be none-json output. We need to fix that :(

@laf laf commented on an outdated diff Apr 28, 2016
html/includes/forms/parse-alert-template.inc.php
@@ -11,6 +11,7 @@
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
+header('Content-type: application/json');
if (is_admin() === false) {
die('ERROR: You need to be admin');
@laf
laf Apr 28, 2016 Member

This would be none-json output. We need to fix that :(

@laf
Member
laf commented Apr 28, 2016

Aside from the two I've commented on this is all good.

Either remove the header being set and we can fix another time or just output the errors as json (although we'd need to check the ajax calls to see how they handle it)

@laf laf added the WebUI label Apr 28, 2016
pblasquez added some commits Apr 28, 2016
@pblasquez pblasquez Merge remote-tracking branch 'refs/remotes/librenms/master' into ajax…
…_headers_1
c295283
@pblasquez pblasquez Allow for separate headers upon conditional
71a57b6
@laf laf merged commit 8b1841f into librenms:master Apr 29, 2016

3 checks passed

Auto-Deploy Build finished. No test results found.
Details
Scrutinizer No new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment