Changeset 975
- Timestamp:
- 12/28/09 11:14:21 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/oscam-http.c
r974 r975 454 454 } 455 455 456 void send_oscam_config_camd35_do(FILE *f, char *uriparams[], char *urivalues[], int paramcount) { 456 void send_oscam_config_camd35(FILE *f, char *uriparams[], char *urivalues[], int paramcount) { 457 int i; 458 int found=0; 459 457 460 fprintf(f,"<BR><BR>"); 458 int i;459 461 460 462 if (paramcount>0){ 461 463 for(i=0;i<paramcount;i++){ 462 463 if ((strcmp(uriparams[i], "part")) && (strcmp(uriparams[i], "action"))){ 464 fprintf(f,"Parameter: %s set to Value: %s<BR>\r\n", uriparams[i], urivalues[i]); 465 chk_t_camd35(uriparams[i], urivalues[i]); 466 } 467 } 468 } 469 //Disclaimer 470 fprintf(f,"<BR><BR><B>Configuration camd35 *DONE*</B><BR><BR>"); 471 refresh_oscam(REFR_SERVER); 472 } 473 474 void send_oscam_config_camd35(FILE *f, char *uriparams[], char *urivalues[], int paramcount) { 475 int i; 476 477 if (paramcount>0){ 478 for(i=0;i<paramcount;i++){ 464 //check the params for execute flag 479 465 if (!strcmp(uriparams[i], "action") && (!strcmp(urivalues[i], "execute"))) { 480 send_oscam_config_camd35_do(f, uriparams, urivalues, paramcount); 481 return; 482 } 483 } 484 } 485 486 fprintf(f,"<BR><BR>"); 466 found=1; 467 break; 468 } 469 } 470 if (found==1){ 471 //we found the execute flag 472 for(i=0;i<paramcount;i++){ 473 if ((strcmp(uriparams[i], "part")) && (strcmp(uriparams[i], "action"))){ 474 fprintf(f,"Parameter: %s set to Value: %s<BR>\r\n", uriparams[i], urivalues[i]); 475 //we use the same function as used for parsing the config tokens 476 chk_t_camd35(uriparams[i], urivalues[i]); 477 } 478 } 479 480 //Disclaimer 481 fprintf(f,"<BR><BR><B>Configuration camd35 *DONE*</B><BR><BR>"); 482 refresh_oscam(REFR_SERVER); 483 return; 484 } 485 } 486 487 //if nothing above matches we show the form 487 488 fprintf(f,"<form action=\"/config.html\" method=\"get\">\r\n"); 488 489 fprintf(f,"<input name=\"part\" type=\"hidden\" value=\"camd35\">\r\n"); … … 492 493 493 494 //Port 494 fprintf(f,"\t<TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->c3 3_port);495 fprintf(f,"\t<TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->c35_port); 495 496 //ServerIP 496 497 fprintf(f,"\t<TR><TD>Serverip:</TD><TD><input name=\"serverip\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"%s\"></TD></TR>\r\n", inet_ntoa(*(struct in_addr *)&cfg->c35_tcp_srvip)); … … 841 842 #ifdef CS_ANTICASC 842 843 843 void send_oscam_config_anticasc_do(FILE *f, char *uriparams[], char *urivalues[], int paramcount) { 844 void send_oscam_config_anticasc(FILE *f, char *uriparams[], char *urivalues[], int paramcount) { 845 int i; 846 int found=0; 847 844 848 fprintf(f,"<BR><BR>"); 845 int i;846 847 if (paramcount>0){848 849 //set to 0 because an empty checkbox gives no parameter850 cfg->ac_enabled = 0;851 852 for(i=0;i<paramcount;i++){853 854 if ((strcmp(uriparams[i], "part")) && (strcmp(uriparams[i], "action"))){855 fprintf(f,"Parameter: %s set to Value: %s<BR>\r\n", uriparams[i], urivalues[i]);856 chk_t_ac(uriparams[i], urivalues[i]);857 }858 }859 }860 861 //Disclaimer862 fprintf(f,"<BR><BR><B>Configuration Anticascading *DONE*</B><BR><BR>");863 refresh_oscam(REFR_ANTICASC);864 }865 866 void send_oscam_config_anticasc(FILE *f, char *uriparams[], char *urivalues[], int paramcount) {867 int i;868 849 869 850 if (paramcount>0){ 870 851 for(i=0;i<paramcount;i++){ 852 //check the params for execute flag 871 853 if (!strcmp(uriparams[i], "action") && (!strcmp(urivalues[i], "execute"))) { 872 send_oscam_config_anticasc_do(f, uriparams, urivalues, paramcount); 873 return; 874 } 875 } 876 } 877 878 //Table & form head 879 fprintf(f,"<BR><BR>"); 854 found=1; 855 break; 856 } 857 } 858 if (found==1){ 859 //we found the execute flag 860 for(i=0;i<paramcount;i++){ 861 if ((strcmp(uriparams[i], "part")) && (strcmp(uriparams[i], "action"))){ 862 fprintf(f,"Parameter: %s set to Value: %s<BR>\r\n", uriparams[i], urivalues[i]); 863 //we use the same function as used for parsing the config tokens 864 chk_t_ac(uriparams[i], urivalues[i]); 865 } 866 } 867 868 //Disclaimer 869 fprintf(f,"<BR><BR><B>Configuration Anticascading *DONE*</B><BR><BR>"); 870 refresh_oscam(REFR_ANTICASC); 871 return; 872 } 873 } 874 875 //if nothing above matches we show the form 880 876 fprintf(f,"<form action=\"/config.html\" method=\"get\">\r\n"); 881 877 fprintf(f,"<input name=\"part\" type=\"hidden\" value=\"anticasc\">\r\n"); … … 1139 1135 } 1140 1136 1137 fprintf(f,"<BR><BR>\r\n"); 1138 1141 1139 for(i=0;i<paramcount;i++){ 1142 1140 if ((strcmp(uriparams[i], "action")) && (strcmp(uriparams[i], "user"))){ 1143 fprintf(f," Parameter: %s set to Value:%s<BR>\r\n", uriparams[i], urivalues[i]);1141 fprintf(f,"%s = %s<BR>\r\n", uriparams[i], urivalues[i]); 1144 1142 if (!strcmp(uriparams[i], "services")) 1145 1143 sprintf(servicelabels + strlen(servicelabels), "%s,", urivalues[i]); … … 1147 1145 chk_account(uriparams[i], urivalues[i], account); 1148 1146 } 1147 else if (!strcmp(uriparams[i], "user")) 1148 fprintf(f,"<B>User %s is reconfigured as follow</B><BR><BR>\r\n", urivalues[i]); 1149 1149 } 1150 1150
Note:
See TracChangeset
for help on using the changeset viewer.