Changeset 948
- Timestamp:
- 12/25/09 00:33:06 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/oscam-http.c
r945 r948 393 393 fprintf(f,"</select></TD></TR>\r\n"); 394 394 395 /*CAID*/ 395 /*---------------------SERVICES------------------------- 396 -------------------------------------------------------*/ 397 /*services - first we have to move the long sidtabok/sidtabno to a binary array*/ 398 int pos; 399 char sidok[33]; 400 for (pos=0;pos<32;pos++) sidok[pos]='0'; 401 402 char sidno[33]; 403 for (pos=0;pos<32;pos++) sidno[pos]='0'; 404 405 pos=0; 406 long dezok = account->sidtabok; 407 while (dezok!=0){ 408 sidok[pos]='0'+dezok % 2; 409 dezok=dezok / 2; 410 pos++; 411 } 412 413 pos=0; 414 long dezno = account->sidtabno; 415 while (dezno!=0){ 416 sidno[pos]='0'+dezno % 2; 417 dezno=dezno / 2; 418 pos++; 419 } 420 421 struct s_sidtab *sidtab = cfg->sidtab; 422 fprintf(f,"<TR><TD>Services:</TD><TD><TABLE cellspacing=\"0\">"); 423 424 pos=0; 425 for (; sidtab; sidtab=sidtab->next){ 426 if(sidok[pos]=='1') 427 fprintf(f,"<TR><TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"%s\" checked> %s</TD>", sidtab->label, sidtab->label); 428 else 429 fprintf(f,"<TR><TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"%s\"> %s</TD>", sidtab->label, sidtab->label); 430 431 if(sidno[pos]=='1') 432 fprintf(f,"<TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"!%s\" checked> !%s</TD></TR>\r\n", sidtab->label, sidtab->label); 433 else 434 fprintf(f,"<TD><INPUT NAME=\"services\" TYPE=\"CHECKBOX\" VALUE=\"!%s\"> !%s</TD></TR>\r\n", sidtab->label, sidtab->label); 435 436 pos++; 437 } 438 fprintf(f,"</TD></TR></TABLE>\r\n"); 439 440 /*---------------------CAID----------------------------- 441 -------------------------------------------------------*/ 396 442 fprintf(f,"<TR><TD>CAID:</TD><TD><input name=\"caid\" type=\"text\" size=\"50\" maxlength=\"50\" value=\""); 397 443 … … 453 499 454 500 struct s_auth *account; 455 int i,j ;501 int i,j,updateservices; 456 502 int paramidx = -1; 457 503 char *ptr; 504 char servicelabels[255]=""; 458 505 459 506 char *params[]={"pwd", … … 465 512 "au", 466 513 "caid", 467 "betatunnel"}; 514 "betatunnel", 515 "services"}; 468 516 469 517 /* Calculate the amount of items in array */ … … 518 566 chk_tuntab(urivalues[j], &account->ttab); 519 567 break; 568 case 9: sprintf(servicelabels+strlen(servicelabels), "%s,", urivalues[j]); 569 updateservices=1; 570 break; 520 571 default: break; 521 572 … … 534 585 } 535 586 } 587 if (updateservices==1) 588 chk_services(servicelabels, &account->sidtabok, &account->sidtabno); 589 536 590 cs_reinit_clients(); 537 591 send_oscam_user(f);
Note:
See TracChangeset
for help on using the changeset viewer.