mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Merge pull request #3435 from pblasquez/ajax_headers_4
Ajax headers for miscellaneous forms
This commit is contained in:
		@@ -11,6 +11,7 @@
 | 
				
			|||||||
 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
					 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
				
			||||||
 * the source code distribution for details.
 | 
					 * the source code distribution for details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: text/plain');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(is_admin() === false) {
 | 
					if(is_admin() === false) {
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@
 | 
				
			|||||||
 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
					 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
				
			||||||
 * the source code distribution for details.
 | 
					 * the source code distribution for details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: text/plain');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(is_admin() === false) {
 | 
					if(is_admin() === false) {
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@
 | 
				
			|||||||
 * @package LibreNMS
 | 
					 * @package LibreNMS
 | 
				
			||||||
 * @subpackage Notifications
 | 
					 * @subpackage Notifications
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: application/json');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$status    = 'error';
 | 
					$status    = 'error';
 | 
				
			||||||
$message   = 'unknown error';
 | 
					$message   = 'unknown error';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (is_admin() === false) {
 | 
					if (is_admin() === false) {
 | 
				
			||||||
 | 
						header('Content-type: text/plain');
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,5 +25,6 @@ if (is_numeric($template_id) && $template_id > 0) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $output = array('rule_id' => $rules);
 | 
					    $output = array('rule_id' => $rules);
 | 
				
			||||||
 | 
						header('Content-type: application/json');
 | 
				
			||||||
    echo _json_encode($output);
 | 
					    echo _json_encode($output);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@
 | 
				
			|||||||
 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
					 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
				
			||||||
 * the source code distribution for details.
 | 
					 * the source code distribution for details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: application/json');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$status    = 'error';
 | 
					$status    = 'error';
 | 
				
			||||||
$message   = 'unknown error';
 | 
					$message   = 'unknown error';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (is_admin() === false) {
 | 
					if (is_admin() === false) {
 | 
				
			||||||
 | 
						header('Content-type: text/plain');
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -128,5 +129,5 @@ else if ($sub_type == 'del-maintenance') {
 | 
				
			|||||||
        'message' => $message,
 | 
					        'message' => $message,
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
}//end if
 | 
					}//end if
 | 
				
			||||||
 | 
					header('Content-type: application/json');
 | 
				
			||||||
echo _json_encode($response);
 | 
					echo _json_encode($response);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,7 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (is_admin() === false) {
 | 
					if (is_admin() === false) {
 | 
				
			||||||
 | 
						header('Content-type: text/plain');
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -50,5 +51,5 @@ if (file_exists($config['install_dir']."/includes/alerts/transport.".$transport.
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					header('Content-type: application/json');
 | 
				
			||||||
echo _json_encode(array('status' => $status));
 | 
					echo _json_encode(array('status' => $status));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@
 | 
				
			|||||||
 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
					 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
				
			||||||
 * the source code distribution for details.
 | 
					 * the source code distribution for details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: text/plain');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(is_admin() === false) {
 | 
					if(is_admin() === false) {
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@
 | 
				
			|||||||
 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
					 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
				
			||||||
 * the source code distribution for details.
 | 
					 * the source code distribution for details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: text/plain');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(is_admin() === false) {
 | 
					if(is_admin() === false) {
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,7 @@
 | 
				
			|||||||
 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
					 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
				
			||||||
 * the source code distribution for details.
 | 
					 * the source code distribution for details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: text/plain');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(is_admin() === false) {
 | 
					if(is_admin() === false) {
 | 
				
			||||||
    die('ERROR: You need to be admin');
 | 
					    die('ERROR: You need to be admin');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@
 | 
				
			|||||||
 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
					 * option) any later version.  Please see LICENSE.txt at the top level of
 | 
				
			||||||
 * the source code distribution for details.
 | 
					 * the source code distribution for details.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: application/json');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$status    = 'error';
 | 
					$status    = 'error';
 | 
				
			||||||
$message   = 'unknown error';
 | 
					$message   = 'unknown error';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@
 | 
				
			|||||||
 * @package LibreNMS
 | 
					 * @package LibreNMS
 | 
				
			||||||
 * @subpackage Widgets
 | 
					 * @subpackage Widgets
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					header('Content-type: application/json');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$status    = 'error';
 | 
					$status    = 'error';
 | 
				
			||||||
$message   = 'unknown error';
 | 
					$message   = 'unknown error';
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user