int main(void) { /* get the arguments passed in the URL */ process_cgivars(); /* reset internal variables */ reset_cgi_vars(); cgi_init(document_header, document_footer, READ_ALL_OBJECT_DATA, READ_ALL_STATUS_DATA); document_header(TRUE); /* get authentication information */ get_authentication_information(¤t_authdata); if(display_header == TRUE) { /* begin top table */ printf("<table border=0 width=100%%>\n"); printf("<tr>\n"); /* left column of the first row */ printf("<td align=left valign=top width=33%%>\n"); display_info_table("Network Outages", TRUE, ¤t_authdata); printf("</td>\n"); /* middle column of top row */ printf("<td align=center valign=top width=33%%>\n"); printf("</td>\n"); /* right column of top row */ printf("<td align=right valign=bottom width=33%%>\n"); /* display context-sensitive help */ display_context_help(CONTEXTHELP_OUTAGES); printf("</td>\n"); /* end of top table */ printf("</tr>\n"); printf("</table>\n"); } /* display network outage info */ display_network_outages(); document_footer(); /* free memory allocated to comment data */ free_comment_data(); /* free all allocated memory */ free_memory(); return OK; }
int main(void) { int result = OK; /* get the arguments passed in the URL */ process_cgivars(); /* reset internal variables */ reset_cgi_vars(); /* read the CGI configuration file */ result = read_cgi_config_file(get_cgi_config_location()); if (result == ERROR) { document_header(CGI_ID, FALSE, "Error"); print_error(get_cgi_config_location(), ERROR_CGI_CFG_FILE, FALSE); document_footer(CGI_ID); free_html_request(html_request_list); return ERROR; } /* read the main configuration file */ result = read_main_config_file(main_config_file); if (result == ERROR) { document_header(CGI_ID, FALSE, "Error"); print_error(main_config_file, ERROR_CGI_MAIN_CFG, FALSE); document_footer(CGI_ID); free_html_request(html_request_list); return ERROR; } /* read all object configuration data */ result = read_all_object_configuration_data(main_config_file, READ_ALL_OBJECT_DATA); if (result == ERROR) { document_header(CGI_ID, FALSE, "Error"); print_error(NULL, ERROR_CGI_OBJECT_DATA, FALSE); document_footer(CGI_ID); free_html_request(html_request_list); return ERROR; } /* read all status data */ result = read_all_status_data(main_config_file, READ_ALL_STATUS_DATA); if (result == ERROR && daemon_check == TRUE) { document_header(CGI_ID, FALSE, "Error"); print_error(NULL, ERROR_CGI_STATUS_DATA, FALSE); document_footer(CGI_ID); free_html_request(html_request_list); free_memory(); return ERROR; } document_header(CGI_ID, TRUE, "Network Outages"); /* get authentication information */ get_authentication_information(¤t_authdata); if (display_header == TRUE) { /* begin top table */ printf("<table border='0' width='100%%'>\n"); printf("<tr>\n"); /* left column of the first row */ printf("<td align='left' valign='top' width='33%%'>\n"); display_info_table("Network Outages", ¤t_authdata, daemon_check); printf("</td>\n"); /* middle column of top row */ printf("<td align='center' valign='top' width='33%%'>\n"); printf("</td>\n"); /* right column of top row */ printf("<td align='right' valign='bottom' width='33%%'>\n"); printf("</td>\n"); /* end of top table */ printf("</tr>\n"); printf("</table>\n"); } /* display network outage info */ display_network_outages(); document_footer(CGI_ID); /* free memory allocated to comment data */ free_comment_data(); /* free all allocated memory */ free_html_request(html_request_list); free_memory(); return OK; }
int main(void) { int result = OK; /* get the arguments passed in the URL */ process_cgivars(); /* reset internal variables */ reset_cgi_vars(); /* read the CGI configuration file */ result = read_cgi_config_file(get_cgi_config_location()); if(result == ERROR) { document_header(FALSE); cgi_config_file_error(get_cgi_config_location()); document_footer(); return ERROR; } /* read the main configuration file */ result = read_main_config_file(main_config_file); if(result == ERROR) { document_header(FALSE); main_config_file_error(main_config_file); document_footer(); return ERROR; } /* read all object configuration data */ result = read_all_object_configuration_data(main_config_file, READ_ALL_OBJECT_DATA); if(result == ERROR) { document_header(FALSE); object_data_error(); document_footer(); return ERROR; } /* read all status data */ result = read_all_status_data(get_cgi_config_location(), READ_ALL_STATUS_DATA); if(result == ERROR) { document_header(FALSE); status_data_error(); document_footer(); free_memory(); return ERROR; } document_header(TRUE); /* get authentication information */ get_authentication_information(¤t_authdata); if(display_header == TRUE) { /* begin top table */ printf("<table border=0 width=100%%>\n"); printf("<tr>\n"); /* left column of the first row */ printf("<td align=left valign=top width=33%%>\n"); display_info_table("Network Outages", TRUE, ¤t_authdata); printf("</td>\n"); /* middle column of top row */ printf("<td align=center valign=top width=33%%>\n"); printf("</td>\n"); /* right column of top row */ printf("<td align=right valign=bottom width=33%%>\n"); /* display context-sensitive help */ display_context_help(CONTEXTHELP_OUTAGES); printf("</td>\n"); /* end of top table */ printf("</tr>\n"); printf("</table>\n"); } /* display network outage info */ display_network_outages(); document_footer(); /* free memory allocated to comment data */ free_comment_data(); /* free all allocated memory */ free_memory(); return OK; }