[icinga-checkins] icinga.org: icinga-core/next: Only show command expander if backend is Icinga 1.x ( incompatible with Icinga 2)

git at icinga.org git at icinga.org
Wed Jun 4 17:30:52 CEST 2014


Module: icinga-core
Branch: next
Commit: 254aa51333d87c8b6352f924c39efc592026d04a
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=254aa51333d87c8b6352f924c39efc592026d04a

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Wed Jun  4 17:29:00 2014 +0200

Only show command expander if backend is Icinga 1.x (incompatible with Icinga 2)

Fixes #6408

---

 cgi/config.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/cgi/config.c b/cgi/config.c
index a2c9c14..9ac3487 100644
--- a/cgi/config.c
+++ b/cgi/config.c
@@ -163,6 +163,8 @@ void store_default_settings(void);
 
 authdata current_authdata;
 
+extern char		*status_file_icinga_version;
+
 int display_type = DISPLAY_NONE;
 int get_result_limit = -1;
 int result_start = 1;
@@ -4199,6 +4201,11 @@ void display_command_expansion(void) {
 	service *svc = NULL;
 	char *processed_command;
 
+	if (status_file_icinga_version != NULL && status_file_icinga_version[0] != '1') {
+		printf("<p><div align='center' class='dataTitle'>Sorry, command expander only available using Icinga 1.x.</div></p>\n");
+		return;
+	}
+
 	/* show host and/or service related raw command */
 	hst = find_host(host_name);
 	svc = find_service(host_name, service_desc);



More information about the icinga-checkins mailing list