Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 208398 | Differences between
and this patch

Collapse All | Expand All

(-)a/cgi/avail.c (-4 / +4 lines)
Lines 511-521 int main(int argc, char **argv){ Link Here
511
			if(display_type==DISPLAY_HOSTGROUP_AVAIL)
511
			if(display_type==DISPLAY_HOSTGROUP_AVAIL)
512
				printf("<input type='hidden' name='hostgroup' value='%s'>\n",hostgroup_name);
512
				printf("<input type='hidden' name='hostgroup' value='%s'>\n",hostgroup_name);
513
			if(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_SERVICE_AVAIL)
513
			if(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_SERVICE_AVAIL)
514
				printf("<input type='hidden' name='host' value='%s'>\n",host_name);
514
				printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
515
			if(display_type==DISPLAY_SERVICE_AVAIL)
515
			if(display_type==DISPLAY_SERVICE_AVAIL)
516
				printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
516
				printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
517
			if(display_type==DISPLAY_SERVICEGROUP_AVAIL)
517
			if(display_type==DISPLAY_SERVICEGROUP_AVAIL)
518
				printf("<input type='hidden' name='servicegroup' value='%s'>\n",servicegroup_name);
518
				printf("<input type='hidden' name='servicegroup' value='%s'>\n",url_encode(servicegroup_name));
519
519
520
			printf("<input type='hidden' name='assumeinitialstates' value='%s'>\n",(assume_initial_states==TRUE)?"yes":"no");
520
			printf("<input type='hidden' name='assumeinitialstates' value='%s'>\n",(assume_initial_states==TRUE)?"yes":"no");
521
			printf("<input type='hidden' name='assumestateretention' value='%s'>\n",(assume_state_retention==TRUE)?"yes":"no");
521
			printf("<input type='hidden' name='assumestateretention' value='%s'>\n",(assume_state_retention==TRUE)?"yes":"no");
Lines 646-656 int main(int argc, char **argv){ Link Here
646
		if(display_type==DISPLAY_HOSTGROUP_AVAIL)
646
		if(display_type==DISPLAY_HOSTGROUP_AVAIL)
647
			printf("<input type='hidden' name='hostgroup' value='%s'>\n",hostgroup_name);
647
			printf("<input type='hidden' name='hostgroup' value='%s'>\n",hostgroup_name);
648
		if(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_SERVICE_AVAIL)
648
		if(display_type==DISPLAY_HOST_AVAIL || display_type==DISPLAY_SERVICE_AVAIL)
649
			printf("<input type='hidden' name='host' value='%s'>\n",host_name);
649
			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
650
		if(display_type==DISPLAY_SERVICE_AVAIL)
650
		if(display_type==DISPLAY_SERVICE_AVAIL)
651
			printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
651
			printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
652
		if(display_type==DISPLAY_SERVICEGROUP_AVAIL)
652
		if(display_type==DISPLAY_SERVICEGROUP_AVAIL)
653
			printf("<input type='hidden' name='servicegroup' value='%s'>\n",servicegroup_name);
653
			printf("<input type='hidden' name='servicegroup' value='%s'>\n",url_encode(servicegroup_name));
654
654
655
		printf("<table border=0 cellpadding=5>\n");
655
		printf("<table border=0 cellpadding=5>\n");
656
656
(-)a/cgi/cgiutils.c (-11 / +13 lines)
Lines 128-134 lifo *lifo_list=NULL; Link Here
128
char            *my_strtok_buffer=NULL;
128
char            *my_strtok_buffer=NULL;
129
char            *original_my_strtok_buffer=NULL;
129
char            *original_my_strtok_buffer=NULL;
130
130
131
char encoded_url_string[MAX_INPUT_BUFFER];
131
char encoded_url_string[2][MAX_INPUT_BUFFER]; // 2 to be able use url_encode twice
132
char encoded_html_string[MAX_INPUT_BUFFER];
132
char encoded_html_string[MAX_INPUT_BUFFER];
133
133
134
#ifdef HAVE_TZNAME
134
#ifdef HAVE_TZNAME
Lines 1297-1342 char * url_encode(char *input){ Link Here
1297
	int len,output_len;
1297
	int len,output_len;
1298
	int x,y;
1298
	int x,y;
1299
	char temp_expansion[4];
1299
	char temp_expansion[4];
1300
	static int i = 0;
1301
	char* str = encoded_url_string[i];
1300
1302
1301
	len=(int)strlen(input);
1303
	len=(int)strlen(input);
1302
	output_len=(int)sizeof(encoded_url_string);
1304
	output_len=(int)sizeof(encoded_url_string[0]);
1303
1305
1304
	encoded_url_string[0]='\x0';
1306
	str[0]='\x0';
1305
1307
1306
	for(x=0,y=0;x<=len && y<output_len-1;x++){
1308
	for(x=0,y=0;x<=len && y<output_len-1;x++){
1307
1309
1308
		/* end of string */
1310
		/* end of string */
1309
		if((char)input[x]==(char)'\x0'){
1311
		if((char)input[x]==(char)'\x0'){
1310
			encoded_url_string[y]='\x0';
1312
			str[y]='\x0';
1311
			break;
1313
			break;
1312
		        }
1314
		        }
1313
1315
1314
		/* alpha-numeric characters and a few other characters don't get encoded */
1316
		/* alpha-numeric characters and a few other characters don't get encoded */
1315
		else if(((char)input[x]>='0' && (char)input[x]<='9') || ((char)input[x]>='A' && (char)input[x]<='Z') || ((char)input[x]>=(char)'a' && (char)input[x]<=(char)'z') || (char)input[x]==(char)'.' || (char)input[x]==(char)'-' || (char)input[x]==(char)'_'){
1317
		else if(((char)input[x]>='0' && (char)input[x]<='9') || ((char)input[x]>='A' && (char)input[x]<='Z') || ((char)input[x]>=(char)'a' && (char)input[x]<=(char)'z') || (char)input[x]==(char)'.' || (char)input[x]==(char)'-' || (char)input[x]==(char)'_'){
1316
			encoded_url_string[y]=input[x];
1318
			str[y]=input[x];
1317
			y++;
1319
			y++;
1318
		        }
1320
		        }
1319
1321
1320
		/* spaces are pluses */
1322
		/* spaces are pluses */
1321
		else if((char)input[x]<=(char)' '){
1323
		else if((char)input[x]<=(char)' '){
1322
			encoded_url_string[y]='+';
1324
			str[y]='+';
1323
			y++;
1325
			y++;
1324
		        }
1326
		        }
1325
1327
1326
		/* anything else gets represented by its hex value */
1328
		/* anything else gets represented by its hex value */
1327
		else{
1329
		else{
1328
			encoded_url_string[y]='\x0';
1330
			str[y]='\x0';
1329
			if((int)strlen(encoded_url_string)<(output_len-3)){
1331
			if((int)strlen(str)<(output_len-3)){
1330
				sprintf(temp_expansion,"%%%02X",(unsigned int)input[x]);
1332
				sprintf(temp_expansion,"%%%02X",(unsigned int)input[x]);
1331
				strcat(encoded_url_string,temp_expansion);
1333
				strcat(str,temp_expansion);
1332
				y+=3;
1334
				y+=3;
1333
			        }
1335
			        }
1334
		        }
1336
		        }
1335
	        }
1337
	        }
1336
1338
1337
	encoded_url_string[sizeof(encoded_url_string)-1]='\x0';
1339
	str[sizeof(encoded_url_string[0])-1]='\x0';
1338
1340
1339
	return &encoded_url_string[0];
1341
	return str;
1340
        }
1342
        }
1341
1343
1342
1344
(-)a/cgi/cmd.c (-8 / +8 lines)
Lines 949-958 void request_command_data(int cmd){ Link Here
949
		printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
949
		printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
950
		printf("</b></td></tr>\n");
950
		printf("</b></td></tr>\n");
951
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
951
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
952
		printf("<INPUT TYPE'TEXT' NAME='com_author' VALUE='%s'>",comment_author);
952
		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s'>",url_encode(comment_author));
953
		printf("</b></td></tr>\n");
953
		printf("</b></td></tr>\n");
954
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
954
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
955
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",comment_data);
955
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
956
		printf("</b></td></tr>\n");
956
		printf("</b></td></tr>\n");
957
		break;
957
		break;
958
		
958
		
Lines 975-984 void request_command_data(int cmd){ Link Here
975
		printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
975
		printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
976
		printf("</b></td></tr>\n");
976
		printf("</b></td></tr>\n");
977
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
977
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
978
		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s'>",comment_author);
978
		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s'>",url_encode(comment_author));
979
		printf("</b></td></tr>\n");
979
		printf("</b></td></tr>\n");
980
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
980
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
981
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",comment_data);
981
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
982
		printf("</b></td></tr>\n");
982
		printf("</b></td></tr>\n");
983
		break;
983
		break;
984
984
Lines 1158-1167 void request_command_data(int cmd){ Link Here
1158
			printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
1158
			printf("<INPUT TYPE='TEXT' NAME='service' VALUE='%s'>",service_desc);
1159
		        }
1159
		        }
1160
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
1160
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
1161
		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s'>",comment_author);
1161
		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s'>",url_encode(comment_author));
1162
		printf("</b></td></tr>\n");
1162
		printf("</b></td></tr>\n");
1163
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
1163
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
1164
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",comment_data);
1164
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
1165
		printf("</b></td></tr>\n");
1165
		printf("</b></td></tr>\n");
1166
1166
1167
		printf("<tr><td CLASS='optBoxItem'><br></td></tr>\n");
1167
		printf("<tr><td CLASS='optBoxItem'><br></td></tr>\n");
Lines 1290-1299 void request_command_data(int cmd){ Link Here
1290
			printf("</b></td></tr>\n");
1290
			printf("</b></td></tr>\n");
1291
		        }
1291
		        }
1292
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
1292
		printf("<tr><td CLASS='optBoxRequiredItem'>Author (Your Name):</td><td><b>");
1293
		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s'>",comment_author);
1293
		printf("<INPUT TYPE='TEXT' NAME='com_author' VALUE='%s'>",url_encode(comment_author));
1294
		printf("</b></td></tr>\n");
1294
		printf("</b></td></tr>\n");
1295
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
1295
		printf("<tr><td CLASS='optBoxRequiredItem'>Comment:</td><td><b>");
1296
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",comment_data);
1296
		printf("<INPUT TYPE='TEXT' NAME='com_data' VALUE='%s' SIZE=40>",url_encode(comment_data));
1297
		printf("</b></td></tr>\n");
1297
		printf("</b></td></tr>\n");
1298
		time(&t);
1298
		time(&t);
1299
		get_time_string(&t,buffer,sizeof(buffer)-1,SHORT_DATE_TIME);
1299
		get_time_string(&t,buffer,sizeof(buffer)-1,SHORT_DATE_TIME);
(-)a/cgi/histogram.c (-4 / +4 lines)
Lines 406-414 int main(int argc, char **argv){ Link Here
406
			printf("<form method=\"GET\" action=\"%s\">\n",HISTOGRAM_CGI);
406
			printf("<form method=\"GET\" action=\"%s\">\n",HISTOGRAM_CGI);
407
			printf("<input type='hidden' name='t1' value='%lu'>\n",(unsigned long)t1);
407
			printf("<input type='hidden' name='t1' value='%lu'>\n",(unsigned long)t1);
408
			printf("<input type='hidden' name='t2' value='%lu'>\n",(unsigned long)t2);
408
			printf("<input type='hidden' name='t2' value='%lu'>\n",(unsigned long)t2);
409
			printf("<input type='hidden' name='host' value='%s'>\n",host_name);
409
			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
410
			if(display_type==DISPLAY_SERVICE_HISTOGRAM)
410
			if(display_type==DISPLAY_SERVICE_HISTOGRAM)
411
				printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
411
				printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
412
412
413
413
414
			printf("<tr><td CLASS='optBoxItem' valign=top align=left>Report period:</td><td CLASS='optBoxItem' valign=top align=left>Assume state retention:</td></tr>\n");
414
			printf("<tr><td CLASS='optBoxItem' valign=top align=left>Report period:</td><td CLASS='optBoxItem' valign=top align=left>Assume state retention:</td></tr>\n");
Lines 788-796 int main(int argc, char **argv){ Link Here
788
788
789
			printf("<TABLE BORDER=0 cellpadding=5>\n");
789
			printf("<TABLE BORDER=0 cellpadding=5>\n");
790
			printf("<form method=\"GET\" action=\"%s\">\n",HISTOGRAM_CGI);
790
			printf("<form method=\"GET\" action=\"%s\">\n",HISTOGRAM_CGI);
791
			printf("<input type='hidden' name='host' value='%s'>\n",host_name);
791
			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
792
			if(display_type==DISPLAY_SERVICE_HISTOGRAM)
792
			if(display_type==DISPLAY_SERVICE_HISTOGRAM)
793
				printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
793
				printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
794
794
795
			printf("<tr><td class='reportSelectSubTitle' align=right>Report Period:</td>\n");
795
			printf("<tr><td class='reportSelectSubTitle' align=right>Report Period:</td>\n");
796
			printf("<td class='reportSelectItem'>\n");
796
			printf("<td class='reportSelectItem'>\n");
(-)a/cgi/history.c (-2 / +2 lines)
Lines 201-209 int main(void){ Link Here
201
201
202
		printf("<table border=0 CLASS='optBox'>\n");
202
		printf("<table border=0 CLASS='optBox'>\n");
203
		printf("<form method=\"GET\" action=\"%s\">\n",HISTORY_CGI);
203
		printf("<form method=\"GET\" action=\"%s\">\n",HISTORY_CGI);
204
		printf("<input type='hidden' name='host' value='%s'>\n",(show_all_hosts==TRUE)?"all":host_name);
204
		printf("<input type='hidden' name='host' value='%s'>\n",(show_all_hosts==TRUE)?"all":url_encode(host_name));
205
		if(display_type==DISPLAY_SERVICES)
205
		if(display_type==DISPLAY_SERVICES)
206
			printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
206
			printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
207
		printf("<input type='hidden' name='archive' value='%d'>\n",log_archive);
207
		printf("<input type='hidden' name='archive' value='%d'>\n",log_archive);
208
208
209
		printf("<tr>\n");
209
		printf("<tr>\n");
(-)a/cgi/notifications.c (-3 / +3 lines)
Lines 212-222 int main(void){ Link Here
212
		printf("<table border=0 CLASS='optBox'>\n");
212
		printf("<table border=0 CLASS='optBox'>\n");
213
		printf("<form method='GET' action='%s'>\n",NOTIFICATIONS_CGI);
213
		printf("<form method='GET' action='%s'>\n",NOTIFICATIONS_CGI);
214
		if(query_type==FIND_SERVICE){
214
		if(query_type==FIND_SERVICE){
215
			printf("<input type='hidden' name='host' value='%s'>\n",query_host_name);
215
			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(query_host_name));
216
			printf("<input type='hidden' name='service' value='%s'>\n",query_svc_description);
216
			printf("<input type='hidden' name='service' value='%s'>\n",url_encode(query_svc_description));
217
	                }
217
	                }
218
		else
218
		else
219
			printf("<input type='hidden' name='%s' value='%s'>\n",(query_type==FIND_HOST)?"host":"contact",(query_type==FIND_HOST)?query_host_name:query_contact_name);
219
			printf("<input type='hidden' name='%s' value='%s'>\n",(query_type==FIND_HOST)?"host":"contact",url_encode((query_type==FIND_HOST)?query_host_name:query_contact_name));
220
		printf("<input type='hidden' name='archive' value='%d'>\n",log_archive);
220
		printf("<input type='hidden' name='archive' value='%d'>\n",log_archive);
221
		printf("<tr>\n");
221
		printf("<tr>\n");
222
		if(query_type==FIND_SERVICE)
222
		if(query_type==FIND_SERVICE)
(-)a/cgi/status.c (-44 / +44 lines)
Lines 821-831 void show_service_status_totals(void){ Link Here
821
	printf("<TH CLASS='serviceTotals'>");
821
	printf("<TH CLASS='serviceTotals'>");
822
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
822
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
823
	if(display_type==DISPLAY_HOSTS)
823
	if(display_type==DISPLAY_HOSTS)
824
		printf("host=%s",host_name);
824
		printf("host=%s",url_encode(host_name));
825
	else if(display_type==DISPLAY_SERVICEGROUPS)
825
	else if(display_type==DISPLAY_SERVICEGROUPS)
826
		printf("servicegroup=%s&style=detail",servicegroup_name);
826
		printf("servicegroup=%s&style=detail",url_encode(servicegroup_name));
827
	else
827
	else
828
		printf("hostgroup=%s&style=detail",hostgroup_name);
828
		printf("hostgroup=%s&style=detail",url_encode(hostgroup_name));
829
	printf("&servicestatustypes=%d",SERVICE_OK);
829
	printf("&servicestatustypes=%d",SERVICE_OK);
830
	printf("&hoststatustypes=%d'>",host_status_types);
830
	printf("&hoststatustypes=%d'>",host_status_types);
831
	printf("Ok</A></TH>\n");
831
	printf("Ok</A></TH>\n");
Lines 833-843 void show_service_status_totals(void){ Link Here
833
	printf("<TH CLASS='serviceTotals'>");
833
	printf("<TH CLASS='serviceTotals'>");
834
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
834
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
835
	if(display_type==DISPLAY_HOSTS)
835
	if(display_type==DISPLAY_HOSTS)
836
		printf("host=%s",host_name);
836
		printf("host=%s",url_encode(host_name));
837
	else if(display_type==DISPLAY_SERVICEGROUPS)
837
	else if(display_type==DISPLAY_SERVICEGROUPS)
838
		printf("servicegroup=%s&style=detail",servicegroup_name);
838
		printf("servicegroup=%s&style=detail",url_encode(servicegroup_name));
839
	else
839
	else
840
		printf("hostgroup=%s&style=detail",hostgroup_name);
840
		printf("hostgroup=%s&style=detail",url_encode(hostgroup_name));
841
	printf("&servicestatustypes=%d",SERVICE_WARNING);
841
	printf("&servicestatustypes=%d",SERVICE_WARNING);
842
	printf("&hoststatustypes=%d'>",host_status_types);
842
	printf("&hoststatustypes=%d'>",host_status_types);
843
	printf("Warning</A></TH>\n");
843
	printf("Warning</A></TH>\n");
Lines 845-855 void show_service_status_totals(void){ Link Here
845
	printf("<TH CLASS='serviceTotals'>");
845
	printf("<TH CLASS='serviceTotals'>");
846
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
846
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
847
	if(display_type==DISPLAY_HOSTS)
847
	if(display_type==DISPLAY_HOSTS)
848
		printf("host=%s",host_name);
848
		printf("host=%s",url_encode(host_name));
849
	else if(display_type==DISPLAY_SERVICEGROUPS)
849
	else if(display_type==DISPLAY_SERVICEGROUPS)
850
		printf("servicegroup=%s&style=detail",servicegroup_name);
850
		printf("servicegroup=%s&style=detail",url_encode(servicegroup_name));
851
	else
851
	else
852
		printf("hostgroup=%s&style=detail",hostgroup_name);
852
		printf("hostgroup=%s&style=detail",url_encode(hostgroup_name));
853
	printf("&servicestatustypes=%d",SERVICE_UNKNOWN);
853
	printf("&servicestatustypes=%d",SERVICE_UNKNOWN);
854
	printf("&hoststatustypes=%d'>",host_status_types);
854
	printf("&hoststatustypes=%d'>",host_status_types);
855
	printf("Unknown</A></TH>\n");
855
	printf("Unknown</A></TH>\n");
Lines 857-867 void show_service_status_totals(void){ Link Here
857
	printf("<TH CLASS='serviceTotals'>");
857
	printf("<TH CLASS='serviceTotals'>");
858
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
858
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
859
	if(display_type==DISPLAY_HOSTS)
859
	if(display_type==DISPLAY_HOSTS)
860
		printf("host=%s",host_name);
860
		printf("host=%s",url_encode(host_name));
861
	else if(display_type==DISPLAY_SERVICEGROUPS)
861
	else if(display_type==DISPLAY_SERVICEGROUPS)
862
		printf("servicegroup=%s&style=detail",servicegroup_name);
862
		printf("servicegroup=%s&style=detail",url_encode(servicegroup_name));
863
	else
863
	else
864
		printf("hostgroup=%s&style=detail",hostgroup_name);
864
		printf("hostgroup=%s&style=detail",url_encode(hostgroup_name));
865
	printf("&servicestatustypes=%d",SERVICE_CRITICAL);
865
	printf("&servicestatustypes=%d",SERVICE_CRITICAL);
866
	printf("&hoststatustypes=%d'>",host_status_types);
866
	printf("&hoststatustypes=%d'>",host_status_types);
867
	printf("Critical</A></TH>\n");
867
	printf("Critical</A></TH>\n");
Lines 869-879 void show_service_status_totals(void){ Link Here
869
	printf("<TH CLASS='serviceTotals'>");
869
	printf("<TH CLASS='serviceTotals'>");
870
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
870
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
871
	if(display_type==DISPLAY_HOSTS)
871
	if(display_type==DISPLAY_HOSTS)
872
		printf("host=%s",host_name);
872
		printf("host=%s",url_encode(host_name));
873
	else if(display_type==DISPLAY_SERVICEGROUPS)
873
	else if(display_type==DISPLAY_SERVICEGROUPS)
874
		printf("servicegroup=%s&style=detail",servicegroup_name);
874
		printf("servicegroup=%s&style=detail",url_encode(servicegroup_name));
875
	else
875
	else
876
		printf("hostgroup=%s&style=detail",hostgroup_name);
876
		printf("hostgroup=%s&style=detail",url_encode(hostgroup_name));
877
	printf("&servicestatustypes=%d",SERVICE_PENDING);
877
	printf("&servicestatustypes=%d",SERVICE_PENDING);
878
	printf("&hoststatustypes=%d'>",host_status_types);
878
	printf("&hoststatustypes=%d'>",host_status_types);
879
	printf("Pending</A></TH>\n");
879
	printf("Pending</A></TH>\n");
Lines 910-920 void show_service_status_totals(void){ Link Here
910
	printf("<TH CLASS='serviceTotals'>");
910
	printf("<TH CLASS='serviceTotals'>");
911
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
911
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
912
	if(display_type==DISPLAY_HOSTS)
912
	if(display_type==DISPLAY_HOSTS)
913
		printf("host=%s",host_name);
913
		printf("host=%s",url_encode(host_name));
914
	else if(display_type==DISPLAY_SERVICEGROUPS)
914
	else if(display_type==DISPLAY_SERVICEGROUPS)
915
		printf("servicegroup=%s&style=detail",servicegroup_name);
915
		printf("servicegroup=%s&style=detail",url_encode(servicegroup_name));
916
	else
916
	else
917
		printf("hostgroup=%s&style=detail",hostgroup_name);
917
		printf("hostgroup=%s&style=detail",url_encode(hostgroup_name));
918
	printf("&servicestatustypes=%d",SERVICE_UNKNOWN|SERVICE_WARNING|SERVICE_CRITICAL);
918
	printf("&servicestatustypes=%d",SERVICE_UNKNOWN|SERVICE_WARNING|SERVICE_CRITICAL);
919
	printf("&hoststatustypes=%d'>",host_status_types);
919
	printf("&hoststatustypes=%d'>",host_status_types);
920
	printf("<I>All Problems</I></A></TH>\n");
920
	printf("<I>All Problems</I></A></TH>\n");
Lines 922-932 void show_service_status_totals(void){ Link Here
922
	printf("<TH CLASS='serviceTotals'>");
922
	printf("<TH CLASS='serviceTotals'>");
923
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
923
	printf("<A CLASS='serviceTotals' HREF='%s?",STATUS_CGI);
924
	if(display_type==DISPLAY_HOSTS)
924
	if(display_type==DISPLAY_HOSTS)
925
		printf("host=%s",host_name);
925
		printf("host=%s",url_encode(host_name));
926
	else if(display_type==DISPLAY_SERVICEGROUPS)
926
	else if(display_type==DISPLAY_SERVICEGROUPS)
927
		printf("servicegroup=%s&style=detail",servicegroup_name);
927
		printf("servicegroup=%s&style=detail",url_encode(servicegroup_name));
928
	else
928
	else
929
		printf("hostgroup=%s&style=detail",hostgroup_name);
929
		printf("hostgroup=%s&style=detail",url_encode(hostgroup_name));
930
	printf("&hoststatustypes=%d'>",host_status_types);
930
	printf("&hoststatustypes=%d'>",host_status_types);
931
	printf("<I>All Types</I></A></TH>\n");
931
	printf("<I>All Types</I></A></TH>\n");
932
932
Lines 1035-1045 void show_host_status_totals(void){ Link Here
1035
	printf("<TH CLASS='hostTotals'>");
1035
	printf("<TH CLASS='hostTotals'>");
1036
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1036
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1037
	if(display_type==DISPLAY_HOSTS)
1037
	if(display_type==DISPLAY_HOSTS)
1038
		printf("host=%s",host_name);
1038
		printf("host=%s",url_encode(host_name));
1039
	else if(display_type==DISPLAY_SERVICEGROUPS)
1039
	else if(display_type==DISPLAY_SERVICEGROUPS)
1040
		printf("servicegroup=%s",servicegroup_name);
1040
		printf("servicegroup=%s",url_encode(servicegroup_name));
1041
	else{
1041
	else{
1042
		printf("hostgroup=%s",hostgroup_name);
1042
		printf("hostgroup=%s",url_encode(hostgroup_name));
1043
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1043
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1044
			printf("&style=detail");
1044
			printf("&style=detail");
1045
		else if(group_style_type==STYLE_HOST_DETAIL)
1045
		else if(group_style_type==STYLE_HOST_DETAIL)
Lines 1053-1063 void show_host_status_totals(void){ Link Here
1053
	printf("<TH CLASS='hostTotals'>");
1053
	printf("<TH CLASS='hostTotals'>");
1054
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1054
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1055
	if(display_type==DISPLAY_HOSTS)
1055
	if(display_type==DISPLAY_HOSTS)
1056
		printf("host=%s",host_name);
1056
		printf("host=%s",url_encode(host_name));
1057
	else if(display_type==DISPLAY_SERVICEGROUPS)
1057
	else if(display_type==DISPLAY_SERVICEGROUPS)
1058
		printf("servicegroup=%s",servicegroup_name);
1058
		printf("servicegroup=%s",url_encode(servicegroup_name));
1059
	else{
1059
	else{
1060
		printf("hostgroup=%s",hostgroup_name);
1060
		printf("hostgroup=%s",url_encode(hostgroup_name));
1061
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1061
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1062
			printf("&style=detail");
1062
			printf("&style=detail");
1063
		else if(group_style_type==STYLE_HOST_DETAIL)
1063
		else if(group_style_type==STYLE_HOST_DETAIL)
Lines 1071-1081 void show_host_status_totals(void){ Link Here
1071
	printf("<TH CLASS='hostTotals'>");
1071
	printf("<TH CLASS='hostTotals'>");
1072
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1072
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1073
	if(display_type==DISPLAY_HOSTS)
1073
	if(display_type==DISPLAY_HOSTS)
1074
		printf("host=%s",host_name);
1074
		printf("host=%s",url_encode(host_name));
1075
	else if(display_type==DISPLAY_SERVICEGROUPS)
1075
	else if(display_type==DISPLAY_SERVICEGROUPS)
1076
		printf("servicegroup=%s",servicegroup_name);
1076
		printf("servicegroup=%s",url_encode(servicegroup_name));
1077
	else{
1077
	else{
1078
		printf("hostgroup=%s",hostgroup_name);
1078
		printf("hostgroup=%s",url_encode(hostgroup_name));
1079
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1079
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1080
			printf("&style=detail");
1080
			printf("&style=detail");
1081
		else if(group_style_type==STYLE_HOST_DETAIL)
1081
		else if(group_style_type==STYLE_HOST_DETAIL)
Lines 1089-1099 void show_host_status_totals(void){ Link Here
1089
	printf("<TH CLASS='hostTotals'>");
1089
	printf("<TH CLASS='hostTotals'>");
1090
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1090
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1091
	if(display_type==DISPLAY_HOSTS)
1091
	if(display_type==DISPLAY_HOSTS)
1092
		printf("host=%s",host_name);
1092
		printf("host=%s",url_encode(host_name));
1093
	else if(display_type==DISPLAY_SERVICEGROUPS)
1093
	else if(display_type==DISPLAY_SERVICEGROUPS)
1094
		printf("servicegroup=%s",servicegroup_name);
1094
		printf("servicegroup=%s",url_encode(servicegroup_name));
1095
	else{
1095
	else{
1096
		printf("hostgroup=%s",hostgroup_name);
1096
		printf("hostgroup=%s",url_encode(hostgroup_name));
1097
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1097
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1098
			printf("&style=detail");
1098
			printf("&style=detail");
1099
		else if(group_style_type==STYLE_HOST_DETAIL)
1099
		else if(group_style_type==STYLE_HOST_DETAIL)
Lines 1132-1142 void show_host_status_totals(void){ Link Here
1132
	printf("<TH CLASS='hostTotals'>");
1132
	printf("<TH CLASS='hostTotals'>");
1133
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1133
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1134
	if(display_type==DISPLAY_HOSTS)
1134
	if(display_type==DISPLAY_HOSTS)
1135
		printf("host=%s",host_name);
1135
		printf("host=%s",url_encode(host_name));
1136
	else if(display_type==DISPLAY_SERVICEGROUPS)
1136
	else if(display_type==DISPLAY_SERVICEGROUPS)
1137
		printf("servicegroup=%s",servicegroup_name);
1137
		printf("servicegroup=%s",url_encode(servicegroup_name));
1138
	else{
1138
	else{
1139
		printf("hostgroup=%s",hostgroup_name);
1139
		printf("hostgroup=%s",url_encode(hostgroup_name));
1140
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1140
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1141
			printf("&style=detail");
1141
			printf("&style=detail");
1142
		else if(group_style_type==STYLE_HOST_DETAIL)
1142
		else if(group_style_type==STYLE_HOST_DETAIL)
Lines 1150-1160 void show_host_status_totals(void){ Link Here
1150
	printf("<TH CLASS='hostTotals'>");
1150
	printf("<TH CLASS='hostTotals'>");
1151
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1151
	printf("<A CLASS='hostTotals' HREF='%s?",STATUS_CGI);
1152
	if(display_type==DISPLAY_HOSTS)
1152
	if(display_type==DISPLAY_HOSTS)
1153
		printf("host=%s",host_name);
1153
		printf("host=%s",url_encode(host_name));
1154
	else if(display_type==DISPLAY_SERVICEGROUPS)
1154
	else if(display_type==DISPLAY_SERVICEGROUPS)
1155
		printf("servicegroup=%s",servicegroup_name);
1155
		printf("servicegroup=%s",url_encode(servicegroup_name));
1156
	else{
1156
	else{
1157
		printf("hostgroup=%s",hostgroup_name);
1157
		printf("hostgroup=%s",url_encode(hostgroup_name));
1158
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1158
		if((service_status_types!=all_service_status_types) || group_style_type==STYLE_DETAIL)
1159
			printf("&style=detail");
1159
			printf("&style=detail");
1160
		else if(group_style_type==STYLE_HOST_DETAIL)
1160
		else if(group_style_type==STYLE_HOST_DETAIL)
Lines 1261-1267 void show_service_detail(void){ Link Here
1261
		if(show_all_servicegroups==TRUE)
1261
		if(show_all_servicegroups==TRUE)
1262
			printf("All Service Groups");
1262
			printf("All Service Groups");
1263
		else
1263
		else
1264
			printf("Service Group '%s'",servicegroup_name);
1264
			printf("Service Group '%s'",url_encode(servicegroup_name));
1265
	        }
1265
	        }
1266
	else{
1266
	else{
1267
		if(show_all_hostgroups==TRUE)
1267
		if(show_all_hostgroups==TRUE)
Lines 1308-1318 void show_service_detail(void){ Link Here
1308
	snprintf(temp_url,sizeof(temp_url)-1,"%s?",STATUS_CGI);
1308
	snprintf(temp_url,sizeof(temp_url)-1,"%s?",STATUS_CGI);
1309
	temp_url[sizeof(temp_url)-1]='\x0';
1309
	temp_url[sizeof(temp_url)-1]='\x0';
1310
	if(display_type==DISPLAY_HOSTS)
1310
	if(display_type==DISPLAY_HOSTS)
1311
		snprintf(temp_buffer,sizeof(temp_buffer)-1,"host=%s",host_name);
1311
		snprintf(temp_buffer,sizeof(temp_buffer)-1,"host=%s",url_encode(host_name));
1312
	else if(display_type==DISPLAY_SERVICEGROUPS)
1312
	else if(display_type==DISPLAY_SERVICEGROUPS)
1313
		snprintf(temp_buffer,sizeof(temp_buffer)-1,"servicegroup=%s&style=detail",servicegroup_name);
1313
		snprintf(temp_buffer,sizeof(temp_buffer)-1,"servicegroup=%s&style=detail",url_encode(servicegroup_name));
1314
	else
1314
	else
1315
		snprintf(temp_buffer,sizeof(temp_buffer)-1,"hostgroup=%s&style=detail",hostgroup_name);
1315
		snprintf(temp_buffer,sizeof(temp_buffer)-1,"hostgroup=%s&style=detail",url_encode(hostgroup_name));
1316
	temp_buffer[sizeof(temp_buffer)-1]='\x0';
1316
	temp_buffer[sizeof(temp_buffer)-1]='\x0';
1317
	strncat(temp_url,temp_buffer,sizeof(temp_url)-strlen(temp_url)-1);
1317
	strncat(temp_url,temp_buffer,sizeof(temp_url)-strlen(temp_url)-1);
1318
	temp_url[sizeof(temp_url)-1]='\x0';
1318
	temp_url[sizeof(temp_url)-1]='\x0';
Lines 1859-1865 void show_host_detail(void){ Link Here
1859
1859
1860
	snprintf(temp_url,sizeof(temp_url)-1,"%s?",STATUS_CGI);
1860
	snprintf(temp_url,sizeof(temp_url)-1,"%s?",STATUS_CGI);
1861
	temp_url[sizeof(temp_url)-1]='\x0';
1861
	temp_url[sizeof(temp_url)-1]='\x0';
1862
	snprintf(temp_buffer,sizeof(temp_buffer)-1,"hostgroup=%s&style=hostdetail",hostgroup_name);
1862
	snprintf(temp_buffer,sizeof(temp_buffer)-1,"hostgroup=%s&style=hostdetail",url_encode(hostgroup_name));
1863
	temp_buffer[sizeof(temp_buffer)-1]='\x0';
1863
	temp_buffer[sizeof(temp_buffer)-1]='\x0';
1864
	strncat(temp_url,temp_buffer,sizeof(temp_url)-strlen(temp_url)-1);
1864
	strncat(temp_url,temp_buffer,sizeof(temp_url)-strlen(temp_url)-1);
1865
	temp_url[sizeof(temp_url)-1]='\x0';
1865
	temp_url[sizeof(temp_url)-1]='\x0';
(-)a/cgi/statusmap.c (-1 / +1 lines)
Lines 698-704 void display_page_header(void){ Link Here
698
		printf("<table border=0 CLASS='optBox'>\n");
698
		printf("<table border=0 CLASS='optBox'>\n");
699
		printf("<tr><td valign=top>\n");
699
		printf("<tr><td valign=top>\n");
700
		printf("<form method=\"POST\" action=\"%s\">\n",STATUSMAP_CGI);
700
		printf("<form method=\"POST\" action=\"%s\">\n",STATUSMAP_CGI);
701
		printf("<input type='hidden' name='host' value='%s'>\n",host_name);
701
		printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
702
		printf("<input type='hidden' name='layout' value='%d'>\n",layout_method);
702
		printf("<input type='hidden' name='layout' value='%d'>\n",layout_method);
703
703
704
		printf("</td><td valign=top>\n");
704
		printf("</td><td valign=top>\n");
(-)a/cgi/statuswml.c (-20 / +20 lines)
Lines 621-627 void display_hostgroup_overview(void){ Link Here
621
	printf("<card id='card1' title='Status Overview'>\n");
621
	printf("<card id='card1' title='Status Overview'>\n");
622
	printf("<p align='center' mode='nowrap'>\n");
622
	printf("<p align='center' mode='nowrap'>\n");
623
623
624
	printf("<b><anchor title='Status Overview'>Status Overview<go href='%s' method='post'><postfield name='hostgroup' value='%s'/><postfield name='style' value='summary'/></go></anchor></b><br/><br/>\n",STATUSWML_CGI,hostgroup_name);
624
	printf("<b><anchor title='Status Overview'>Status Overview<go href='%s' method='post'><postfield name='hostgroup' value='%s'/><postfield name='style' value='summary'/></go></anchor></b><br/><br/>\n",STATUSWML_CGI,url_encode(hostgroup_name));
625
625
626
	/* check all hostgroups */
626
	/* check all hostgroups */
627
	for(temp_hostgroup=hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){
627
	for(temp_hostgroup=hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){
Lines 704-710 void display_hostgroup_summary(void){ Link Here
704
	printf("<card id='card1' title='Status Summary'>\n");
704
	printf("<card id='card1' title='Status Summary'>\n");
705
	printf("<p align='center' mode='nowrap'>\n");
705
	printf("<p align='center' mode='nowrap'>\n");
706
706
707
	printf("<b><anchor title='Status Summary'>Status Summary<go href='%s' method='post'><postfield name='hostgroup' value='%s'/><postfield name='style' value='overview'/></go></anchor></b><br/><br/>\n",STATUSWML_CGI,hostgroup_name);
707
	printf("<b><anchor title='Status Summary'>Status Summary<go href='%s' method='post'><postfield name='hostgroup' value='%s'/><postfield name='style' value='overview'/></go></anchor></b><br/><br/>\n",STATUSWML_CGI,url_encode(hostgroup_name));
708
708
709
	/* check all hostgroups */
709
	/* check all hostgroups */
710
	for(temp_hostgroup=hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){
710
	for(temp_hostgroup=hostgroup_list;temp_hostgroup!=NULL;temp_hostgroup=temp_hostgroup->next){
Lines 926-932 void display_host(void){ Link Here
926
926
927
	printf("</table>\n");
927
	printf("</table>\n");
928
	printf("<br/>\n");
928
	printf("<br/>\n");
929
	printf("<b><anchor title='View Services'>View Services<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='style' value='servicedetail'/></go></anchor></b>\n",STATUSWML_CGI,host_name);
929
	printf("<b><anchor title='View Services'>View Services<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='style' value='servicedetail'/></go></anchor></b>\n",STATUSWML_CGI,url_encode(host_name));
930
	printf("<b><anchor title='Host Commands'>Host Commands<go href='#card2'/></anchor></b>\n");
930
	printf("<b><anchor title='Host Commands'>Host Commands<go href='#card2'/></anchor></b>\n");
931
	printf("</p>\n");
931
	printf("</p>\n");
932
932
Lines 945-967 void display_host(void){ Link Here
945
		printf("<b><anchor title='Acknowledge Problem'>Acknowledge Problem<go href='#card3'/></anchor></b>\n");
945
		printf("<b><anchor title='Acknowledge Problem'>Acknowledge Problem<go href='#card3'/></anchor></b>\n");
946
946
947
	if(temp_hoststatus->checks_enabled==FALSE)
947
	if(temp_hoststatus->checks_enabled==FALSE)
948
		printf("<b><anchor title='Enable Host Checks'>Enable Host Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_ENABLE_HOST_CHECK,CMDMODE_COMMIT);
948
		printf("<b><anchor title='Enable Host Checks'>Enable Host Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_ENABLE_HOST_CHECK,CMDMODE_COMMIT);
949
	else
949
	else
950
		printf("<b><anchor title='Disable Host Checks'>Disable Host Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_DISABLE_HOST_CHECK,CMDMODE_COMMIT);
950
		printf("<b><anchor title='Disable Host Checks'>Disable Host Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_DISABLE_HOST_CHECK,CMDMODE_COMMIT);
951
951
952
	if(temp_hoststatus->notifications_enabled==FALSE)
952
	if(temp_hoststatus->notifications_enabled==FALSE)
953
		printf("<b><anchor title='Enable Host Notifications'>Enable Host Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_ENABLE_HOST_NOTIFICATIONS,CMDMODE_COMMIT);
953
		printf("<b><anchor title='Enable Host Notifications'>Enable Host Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_ENABLE_HOST_NOTIFICATIONS,CMDMODE_COMMIT);
954
	else
954
	else
955
		printf("<b><anchor title='Disable Host Notifications'>Disable Host Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_DISABLE_HOST_NOTIFICATIONS,CMDMODE_COMMIT);
955
		printf("<b><anchor title='Disable Host Notifications'>Disable Host Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_DISABLE_HOST_NOTIFICATIONS,CMDMODE_COMMIT);
956
956
957
957
958
	printf("<b><anchor title='Enable All Service Checks'>Enable All Service Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_ENABLE_HOST_SVC_CHECKS,CMDMODE_COMMIT);
958
	printf("<b><anchor title='Enable All Service Checks'>Enable All Service Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_ENABLE_HOST_SVC_CHECKS,CMDMODE_COMMIT);
959
959
960
	printf("<b><anchor title='Disable All Service Checks'>Disable All Service Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_DISABLE_HOST_SVC_CHECKS,CMDMODE_COMMIT);
960
	printf("<b><anchor title='Disable All Service Checks'>Disable All Service Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_DISABLE_HOST_SVC_CHECKS,CMDMODE_COMMIT);
961
961
962
	printf("<b><anchor title='Enable All Service Notifications'>Enable All Service Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_ENABLE_HOST_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
962
	printf("<b><anchor title='Enable All Service Notifications'>Enable All Service Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_ENABLE_HOST_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
963
963
964
	printf("<b><anchor title='Disable All Service Notifications'>Disable All Service Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,CMD_DISABLE_HOST_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
964
	printf("<b><anchor title='Disable All Service Notifications'>Disable All Service Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),CMD_DISABLE_HOST_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
965
965
966
	printf("</p>\n");
966
	printf("</p>\n");
967
967
Lines 981-987 void display_host(void){ Link Here
981
	printf("<input name='comment'/>\n");
981
	printf("<input name='comment'/>\n");
982
982
983
	printf("<do type='accept'>\n");
983
	printf("<do type='accept'>\n");
984
	printf("<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='com_author' value='$(name)'/><postfield name='com_data' value='$(comment)'/><postfield name='persistent' value=''/><postfield name='send_notification' value=''/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go>\n",COMMAND_CGI,host_name,CMD_ACKNOWLEDGE_HOST_PROBLEM,CMDMODE_COMMIT);
984
	printf("<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='com_author' value='$(name)'/><postfield name='com_data' value='$(comment)'/><postfield name='persistent' value=''/><postfield name='send_notification' value=''/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go>\n",COMMAND_CGI,url_encode(host_name),CMD_ACKNOWLEDGE_HOST_PROBLEM,CMDMODE_COMMIT);
985
	printf("</do>\n");
985
	printf("</do>\n");
986
986
987
	printf("</p>\n");
987
	printf("</p>\n");
Lines 1001-1007 void display_host_services(void){ Link Here
1001
	/**** MAIN SCREEN (CARD 1) ****/
1001
	/**** MAIN SCREEN (CARD 1) ****/
1002
	printf("<card id='card1' title='Host Services'>\n");
1002
	printf("<card id='card1' title='Host Services'>\n");
1003
	printf("<p align='center' mode='nowrap'>\n");
1003
	printf("<p align='center' mode='nowrap'>\n");
1004
	printf("<b>Host <anchor title='%s'>'%s'<go href='%s' method='post'><postfield name='host' value='%s'/></go></anchor> Services</b><br/>\n",host_name,host_name,STATUSWML_CGI,host_name);
1004
	printf("<b>Host <anchor title='%s'>'%s'<go href='%s' method='post'><postfield name='host' value='%s'/></go></anchor> Services</b><br/>\n",url_encode(host_name),host_name,STATUSWML_CGI,url_encode(host_name));
1005
1005
1006
	printf("<table columns='2' align='LL'>\n");
1006
	printf("<table columns='2' align='LL'>\n");
1007
1007
Lines 1142-1148 void display_service(void){ Link Here
1142
1142
1143
	printf("</table>\n");
1143
	printf("</table>\n");
1144
	printf("<br/>\n");
1144
	printf("<br/>\n");
1145
	printf("<b><anchor title='View Host'>View Host<go href='%s' method='post'><postfield name='host' value='%s'/></go></anchor></b>\n",STATUSWML_CGI,host_name);
1145
	printf("<b><anchor title='View Host'>View Host<go href='%s' method='post'><postfield name='host' value='%s'/></go></anchor></b>\n",STATUSWML_CGI,url_encode(host_name));
1146
	printf("<b><anchor title='Service Commands'>Svc. Commands<go href='#card2'/></anchor></b>\n");
1146
	printf("<b><anchor title='Service Commands'>Svc. Commands<go href='#card2'/></anchor></b>\n");
1147
	printf("</p>\n");
1147
	printf("</p>\n");
1148
1148
Lines 1158-1173 void display_service(void){ Link Here
1158
		printf("<b><anchor title='Acknowledge Problem'>Acknowledge Problem<go href='#card3'/></anchor></b>\n");
1158
		printf("<b><anchor title='Acknowledge Problem'>Acknowledge Problem<go href='#card3'/></anchor></b>\n");
1159
1159
1160
	if(temp_servicestatus->checks_enabled==FALSE)
1160
	if(temp_servicestatus->checks_enabled==FALSE)
1161
		printf("<b><anchor title='Enable Checks'>Enable Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,service_desc,CMD_ENABLE_SVC_CHECK,CMDMODE_COMMIT);
1161
		printf("<b><anchor title='Enable Checks'>Enable Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),url_encode(service_desc),CMD_ENABLE_SVC_CHECK,CMDMODE_COMMIT);
1162
	else{
1162
	else{
1163
		printf("<b><anchor title='Disable Checks'>Disable Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,service_desc,CMD_DISABLE_SVC_CHECK,CMDMODE_COMMIT);
1163
		printf("<b><anchor title='Disable Checks'>Disable Checks<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),url_encode(service_desc),CMD_DISABLE_SVC_CHECK,CMDMODE_COMMIT);
1164
		printf("<b><anchor title='Schedule Immediate Check'>Schedule Immediate Check<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='start_time' value='%lu'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,service_desc,(unsigned long)current_time,CMD_SCHEDULE_SVC_CHECK,CMDMODE_COMMIT);
1164
		printf("<b><anchor title='Schedule Immediate Check'>Schedule Immediate Check<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='start_time' value='%lu'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),url_encode(service_desc),(unsigned long)current_time,CMD_SCHEDULE_SVC_CHECK,CMDMODE_COMMIT);
1165
	        }
1165
	        }
1166
1166
1167
	if(temp_servicestatus->notifications_enabled==FALSE)
1167
	if(temp_servicestatus->notifications_enabled==FALSE)
1168
		printf("<b><anchor title='Enable Notifications'>Enable Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,service_desc,CMD_ENABLE_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
1168
		printf("<b><anchor title='Enable Notifications'>Enable Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),url_encode(service_desc),CMD_ENABLE_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
1169
	else
1169
	else
1170
		printf("<b><anchor title='Disable Notifications'>Disable Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,host_name,service_desc,CMD_DISABLE_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
1170
		printf("<b><anchor title='Disable Notifications'>Disable Notifications<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go></anchor></b><br/>\n",COMMAND_CGI,url_encode(host_name),url_encode(service_desc),CMD_DISABLE_SVC_NOTIFICATIONS,CMDMODE_COMMIT);
1171
1171
1172
	printf("</p>\n");
1172
	printf("</p>\n");
1173
1173
Lines 1187-1193 void display_service(void){ Link Here
1187
	printf("<input name='comment'/>\n");
1187
	printf("<input name='comment'/>\n");
1188
1188
1189
	printf("<do type='accept'>\n");
1189
	printf("<do type='accept'>\n");
1190
	printf("<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='com_author' value='$(name)'/><postfield name='com_data' value='$(comment)'/><postfield name='persistent' value=''/><postfield name='send_notification' value=''/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go>\n",COMMAND_CGI,host_name,service_desc,CMD_ACKNOWLEDGE_SVC_PROBLEM,CMDMODE_COMMIT);
1190
	printf("<go href='%s' method='post'><postfield name='host' value='%s'/><postfield name='service' value='%s'/><postfield name='com_author' value='$(name)'/><postfield name='com_data' value='$(comment)'/><postfield name='persistent' value=''/><postfield name='send_notification' value=''/><postfield name='cmd_typ' value='%d'/><postfield name='cmd_mod' value='%d'/><postfield name='content' value='wml'/></go>\n",COMMAND_CGI,url_encode(host_name),url_encode(service_desc),CMD_ACKNOWLEDGE_SVC_PROBLEM,CMDMODE_COMMIT);
1191
	printf("</do>\n");
1191
	printf("</do>\n");
1192
1192
1193
	printf("</p>\n");
1193
	printf("</p>\n");
(-)a/cgi/trends.c (-5 / +4 lines)
Lines 451-459 int main(int argc, char **argv){ Link Here
451
				printf("<input type='hidden' name='nomap' value=''>\n");
451
				printf("<input type='hidden' name='nomap' value=''>\n");
452
			printf("<input type='hidden' name='t1' value='%lu'>\n",(unsigned long)t1);
452
			printf("<input type='hidden' name='t1' value='%lu'>\n",(unsigned long)t1);
453
			printf("<input type='hidden' name='t2' value='%lu'>\n",(unsigned long)t2);
453
			printf("<input type='hidden' name='t2' value='%lu'>\n",(unsigned long)t2);
454
			printf("<input type='hidden' name='host' value='%s'>\n",host_name);
454
			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
455
			if(display_type==DISPLAY_SERVICE_TRENDS)
455
			if(display_type==DISPLAY_SERVICE_TRENDS)
456
				printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
456
				printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
457
457
458
			printf("<input type='hidden' name='assumeinitialstates' value='%s'>\n",(assume_initial_states==TRUE)?"yes":"no");
458
			printf("<input type='hidden' name='assumeinitialstates' value='%s'>\n",(assume_initial_states==TRUE)?"yes":"no");
459
			printf("<input type='hidden' name='assumestateretention' value='%s'>\n",(assume_state_retention==TRUE)?"yes":"no");
459
			printf("<input type='hidden' name='assumestateretention' value='%s'>\n",(assume_state_retention==TRUE)?"yes":"no");
Lines 897-905 int main(int argc, char **argv){ Link Here
897
897
898
			printf("<TABLE BORDER=0 CELLPADDING=5>\n");
898
			printf("<TABLE BORDER=0 CELLPADDING=5>\n");
899
			printf("<form method=\"GET\" action=\"%s\">\n",TRENDS_CGI);
899
			printf("<form method=\"GET\" action=\"%s\">\n",TRENDS_CGI);
900
			printf("<input type='hidden' name='host' value='%s'>\n",host_name);
900
			printf("<input type='hidden' name='host' value='%s'>\n",url_encode(host_name));
901
			if(display_type==DISPLAY_SERVICE_TRENDS)
901
			if(display_type==DISPLAY_SERVICE_TRENDS)
902
				printf("<input type='hidden' name='service' value='%s'>\n",svc_description);
902
				printf("<input type='hidden' name='service' value='%s'>\n",url_encode(svc_description));
903
903
904
			printf("<tr><td class='reportSelectSubTitle' align=right>Report period:</td>\n");
904
			printf("<tr><td class='reportSelectSubTitle' align=right>Report period:</td>\n");
905
			printf("<td class='reportSelectItem'>\n");
905
			printf("<td class='reportSelectItem'>\n");
906
- 

Return to bug 208398