Changeset 1022
- Timestamp:
- 01/01/10 15:33:39 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/oscam-http.c
r1021 r1022 61 61 62 62 fprintf(f,"<BR><BR>"); 63 63 64 64 if (strcmp(getParam(params, "action"), "execute") == 0){ 65 65 //we found the execute flag … … 83 83 fprintf(f,"<TABLE cellspacing=\"0\">"); 84 84 fprintf(f,"\t<TH> </TH><TH>Edit Global Config </TH>"); 85 85 86 86 //ServerIP 87 87 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->srvip)); … … 124 124 //preferlocalcards 125 125 fprintf(f,"\t<TR><TD>Preferlocalcards:</TD><TD><input name=\"preferlocalcards\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->preferlocalcards); 126 126 127 127 //Tablefoot and finish form 128 128 fprintf(f,"</TABLE>\r\n"); 129 129 fprintf(f,"<input type=\"submit\" value=\"OK\"></form>\r\n"); 130 130 131 131 //Disclaimer 132 132 fprintf(f,"<BR><BR>Configuration Global not yet implemented chengings havn't any effect<BR><BR>"); … … 160 160 fprintf(f,"<TABLE cellspacing=\"0\">"); 161 161 fprintf(f,"\t<TH> </TH><TH>Edit Camd33 Config </TH>"); 162 162 163 163 //Port 164 164 fprintf(f,"\t<TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->c33_port); … … 184 184 } 185 185 fprintf(f,"\">wrong, see Ticket #265</TD></TR>\r\n"); 186 186 187 187 //Tablefoot and finish form 188 188 fprintf(f,"</TABLE>\r\n"); 189 189 fprintf(f,"<input type=\"submit\" value=\"OK\"></form>\r\n"); 190 190 191 191 //Disclaimer 192 192 fprintf(f,"<BR><BR>Configuration camd33 not yet implemented<BR><BR>"); … … 219 219 fprintf(f,"<TABLE cellspacing=\"0\">"); 220 220 fprintf(f,"\t<TH> </TH><TH>Edit Camd35 Config </TH>"); 221 221 222 222 //Port 223 223 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); 224 224 //ServerIP 225 225 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)); 226 226 227 227 //Tablefoot and finish form 228 228 fprintf(f,"</TABLE>\r\n"); 229 229 fprintf(f,"<input type=\"submit\" value=\"OK\"></form>\r\n"); 230 230 231 231 //Disclaimer 232 232 fprintf(f,"<BR><BR>Configuration camd35 not yet implemented<BR><BR>"); … … 248 248 } 249 249 } 250 250 251 251 //Disclaimer 252 252 fprintf(f,"<BR><BR><B>Configuration newcamd *DONE*</B><BR><BR>"); … … 259 259 fprintf(f,"<TABLE cellspacing=\"0\">"); 260 260 fprintf(f,"\t<TH> </TH><TH>Edit Newcamd Config </TH>"); 261 261 262 262 //Port 263 263 fprintf(f,"\t<TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"80\" maxlength=\"200\" value=\""); … … 280 280 } 281 281 } 282 282 283 283 fprintf(f,"\"></TD></TR>\r\n"); 284 284 285 285 //ServerIP 286 286 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->ncd_srvip)); 287 287 //Key 288 288 fprintf(f,"\t<TR><TD>Key:</TD><TD><input name=\"key\" type=\"text\" size=\"35\" maxlength=\"28\" value=\""); 289 289 290 290 for (i=0;i<14;i++) 291 291 fprintf(f,"%02X",cfg->ncd_key[i]); 292 292 293 293 fprintf(f,"\"></TD></TR>\r\n"); 294 294 //Tablefoot and finish form … … 302 302 303 303 fprintf(f,"<BR><BR>"); 304 304 305 305 if (strcmp(getParam(params, "action"),"execute") == 0){ 306 306 //we found the execute flag … … 324 324 fprintf(f,"<TABLE cellspacing=\"0\">"); 325 325 fprintf(f,"\t<TH> </TH><TH>Edit Radegast Config </TH>"); 326 326 327 327 //Port 328 328 fprintf(f,"\t<TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->rad_port); … … 342 342 //Port 343 343 fprintf(f,"\t<TR><TD>User:</TD><TD><input name=\"user\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"%s\"></TD></TR>\r\n", cfg->rad_usr); 344 344 345 345 //Tablefoot and finish form 346 346 fprintf(f,"</TABLE>\r\n"); … … 375 375 fprintf(f,"<TABLE cellspacing=\"0\">"); 376 376 fprintf(f,"\t<TH> </TH><TH>Edit Cccam Config </TH>"); 377 378 377 378 379 379 //Tablefoot and finish form 380 380 fprintf(f,"</TABLE>\r\n"); 381 381 fprintf(f,"<input type=\"submit\" value=\"OK\"></form>\r\n"); 382 382 383 383 //Disclaimer 384 384 fprintf(f,"<BR><BR>Configuration Cccam not yet implemented<BR><BR>"); … … 412 412 fprintf(f,"<TABLE cellspacing=\"0\">"); 413 413 fprintf(f,"\t<TH> </TH><TH>Edit Gbox Config </TH>"); 414 414 415 415 //Password 416 416 fprintf(f,"\t<TR><TD>Password:</TD><TD><input name=\"password\" type=\"text\" size=\"10\" maxlength=\"8\" value=\""); … … 434 434 } 435 435 fprintf(f,"\"></TD></TR>\r\n"); 436 436 437 437 //Tablefoot and finish form 438 438 fprintf(f,"</TABLE>\r\n"); … … 467 467 fprintf(f,"<TABLE cellspacing=\"0\">"); 468 468 fprintf(f,"\t<TH> </TH><TH>Edit Monitor Config </TH>"); 469 469 470 470 //Port 471 471 fprintf(f,"\t<TR><TD>Port:</TD><TD><input name=\"port\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->mon_port); … … 506 506 //HTTPrefresh 507 507 fprintf(f,"\t<TR><TD>Httprefresh:</TD><TD><input name=\"httprefresh\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->http_refresh); 508 508 509 509 //Tablefoot and finish form 510 510 fprintf(f,"</TABLE>\r\n"); … … 541 541 fprintf(f,"<TABLE cellspacing=\"0\">"); 542 542 fprintf(f,"\t<TH> </TH><TH>Edit Anticascading Config </TH>"); 543 543 544 544 //Port 545 545 char *checked=""; … … 560 560 //denysamples 561 561 fprintf(f,"\t<TR><TD>Denysamples:</TD><TD><input name=\"denysamples\" type=\"text\" size=\"5\" maxlength=\"5\" value=\"%d\"></TD></TR>\r\n", cfg->ac_denysamples); 562 562 563 563 //Tablefoot and finish form 564 564 fprintf(f,"</TABLE>\r\n"); … … 753 753 tpl_addVar(vars, 1, "MESSAGE", "<b>New user has been added with default settings</b><BR>"); 754 754 if (write_userdb()==0) refresh_oscam(REFR_ACCOUNTS); 755 else tpl_addVar(vars, 1, "MESSAGE", "<b>Writing configuration to disk failed!</b><BR>"); 755 else tpl_addVar(vars, 1, "MESSAGE", "<b>Writing configuration to disk failed!</b><BR>"); 756 756 // need to reget account as writing to disk changes account! 757 757 for (account = cfg->account; account != NULL && strcmp(user, account->usr) != 0; account = account->next); … … 772 772 } 773 773 chk_account("services", servicelabels, account); 774 tpl_addVar(vars, 1, "MESSAGE", "<B>Settings updated</B><BR><BR>"); 774 tpl_addVar(vars, 1, "MESSAGE", "<B>Settings updated</B><BR><BR>"); 775 775 if (write_userdb()==0) refresh_oscam(REFR_ACCOUNTS); 776 776 else tpl_addVar(vars, 1, "MESSAGE", "<B>Write Config failed</B><BR><BR>"); … … 778 778 779 779 tpl_addVar(vars, 0, "USERNAME", account->usr); 780 tpl_addVar(vars, 0, "PASSWORD", account->pwd); 780 tpl_addVar(vars, 0, "PASSWORD", account->pwd); 781 781 782 782 //Expirationdate … … 798 798 //Hostname 799 799 tpl_addVar(vars, 0, "DYNDNS", (char *)account->dyndns); 800 800 801 801 //Uniq 802 802 tpl_printf(vars, 0, "TMP", "UNIQSELECTED%d", account->uniq); 803 803 tpl_addVar(vars, 0, tpl_getVar(vars, "TMP"), "selected"); 804 804 805 805 //Sleep 806 806 if(!account->tosleep) tpl_addVar(vars, 0, "SLEEP", "0"); … … 830 830 struct s_sidtab *sidtab = cfg->sidtab; 831 831 //build matrix 832 i=0; 832 833 while(sidtab != NULL){ 833 834 tpl_addVar(vars, 0, "SIDLABEL", sidtab->label); … … 839 840 tpl_addVar(vars, 1, "SIDS", tpl_getTpl(vars, "USEREDITSIDNOBIT")); 840 841 sidtab=sidtab->next; 842 i++; 841 843 } 842 844 /* CAID */ … … 885 887 886 888 void send_oscam_user_config(struct templatevars *vars, FILE *f, struct uriparams *params) { 887 struct s_auth *account, *account2; 889 struct s_auth *account, *account2; 888 890 char *user = getParam(params, "user"); 889 891 int i, found = 0; … … 958 960 char *p; 959 961 char *reader_ = getParam(params, "reader"); 960 if(strlen(reader_) > 0){ 962 if(strlen(reader_) > 0){ 961 963 #ifdef CS_RDR_INIT_HIST 962 964 for (ridx=0; ridx<CS_MAXREADER && strcmp(reader_, reader[ridx].label) != 0; ridx++); … … 981 983 struct tm *lt; 982 984 for (i=0; i<CS_MAXPID; i++) { 983 if (client[i].pid) { 985 if (client[i].pid) { 984 986 if ((cfg->mon_hideclient_to <= 0) || (((now-client[i].lastecm)/60)<cfg->mon_hideclient_to) || 985 987 (((now-client[i].lastemm)/60)<cfg->mon_hideclient_to) || (client[i].typ!='c')){ … … 987 989 isec=now-client[i].last; 988 990 usr=client[i].usr; 989 991 990 992 if (((client[i].typ=='r') || (client[i].typ=='p')) && (con=cs_idx2ridx(i))>=0) usr=reader[con].label; 991 993 992 994 if (client[i].dup) con=2; 993 995 else if ((client[i].tosleep) && (now-client[i].lastswitch>client[i].tosleep)) con=1; 994 996 else con=0; 995 997 996 998 if (i-cdiff>0) cnr=i-cdiff; 997 999 else cnr=(i>1) ? i-1 : 0; 998 1000 999 1001 if( (cau=client[i].au+1) && (now-client[i].lastemm)/60 > cfg->mon_aulow) cau=-cau; 1000 1002 1001 1003 lt=localtime(&client[i].login); 1002 1003 tpl_printf(vars, 0, "CLIENTPID", "%d", client[i].pid); 1004 1005 tpl_printf(vars, 0, "CLIENTPID", "%d", client[i].pid); 1004 1006 tpl_printf(vars, 0, "CLIENTTYPE", "%c", client[i].typ); 1005 1007 tpl_printf(vars, 0, "CLIENTCNR", "%d", cnr); … … 1017 1019 tpl_addVar(vars, 0, "CLIENTSRVNAME", monitor_get_srvname(client[i].last_srvid)); 1018 1020 tpl_printf(vars, 0, "CLIENTIDLESECS", "%d", isec); 1019 tpl_printf(vars, 0, "CLIENTCON", "%d", con); 1020 tpl_printf(vars, 0, "CWOK", "%d", client[i].cwfound); 1021 tpl_printf(vars, 0, "CWNOK", "%d", client[i].cwnot); 1021 tpl_printf(vars, 0, "CLIENTCON", "%d", con); 1022 tpl_printf(vars, 0, "CWOK", "%d", client[i].cwfound); 1023 tpl_printf(vars, 0, "CWNOK", "%d", client[i].cwnot); 1022 1024 tpl_addVar(vars, 1, "CLIENTSTATUS", tpl_getTpl(vars, "CLIENTSTATUSBIT")); 1023 1025 } … … 1041 1043 void send_oscam_services(struct templatevars *vars, FILE *f) { 1042 1044 struct s_sidtab *sidtab = cfg->sidtab; 1043 int i; 1044 1045 while(sidtab != NULL){ 1045 int i; 1046 1047 while(sidtab != NULL){ 1046 1048 for (i=0; i<sidtab->num_caid; i++){ 1047 1049 if (i==0) tpl_printf(vars, 0, "CAIDS", "%04X", sidtab->caid[i]); … … 1091 1093 "/site.css"}; 1092 1094 int pagescnt = sizeof(pages)/sizeof(char *); // Calculate the amount of items in array 1093 1095 1094 1096 int pgidx = -1; 1095 1097 int i; 1096 1098 int parsemode = 1; 1097 1099 struct uriparams params; 1098 params.paramcount = 0; 1100 params.paramcount = 0; 1099 1101 1100 1102 /* First line always includes the GET/POST request */ … … 1178 1180 struct tm *lt; 1179 1181 time(&t); 1180 1181 lt=localtime(&t); 1182 1183 lt=localtime(&t); 1182 1184 tpl_addVar(vars, 0, "CS_VERSION", CS_VERSION); 1183 1185 tpl_addVar(vars, 0, "CS_SVN_VERSION", CS_SVN_VERSION);
Note:
See TracChangeset
for help on using the changeset viewer.