Changeset 1044
- Timestamp:
- 01/03/10 14:11:23 (14 years ago)
- Location:
- branches/monitor-improvement
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/globals.h
r1036 r1044 784 784 void chk_account(char *token, char *value, struct s_auth *account); 785 785 int write_userdb(); 786 int write_config(); 786 787 787 788 // oscam-reader -
branches/monitor-improvement/oscam-config.c
r1042 r1044 833 833 int write_config() 834 834 { 835 //int i;835 int i; 836 836 FILE *f; 837 //char *dot = ""; //flag for comma837 char *dot = ""; //flag for comma 838 838 char tmpfile[256]; 839 839 char destfile[256]; … … 876 876 /*monitor settings*/ 877 877 fprintf(f,"[monitor]\n"); 878 //todo 879 878 fprintf(f,"port = %d\n", cfg->mon_port); 879 fprintf(f,"serverip = %s\n", inet_ntoa(*(struct in_addr *)&cfg->mon_srvip)); 880 881 fprintf(f,"nocrypt = "); 882 struct s_ip *cip; 883 for (cip = cfg->mon_allowed; cip; cip = cip->next){ 884 fprintf(f,"%s%s", dot, inet_ntoa(*(struct in_addr *)&cip->ip[0])); 885 if (cip->ip[0] == cip->ip[1]) fprintf(f,"-%s", inet_ntoa(*(struct in_addr *)&cip->ip[1])); 886 dot=","; 887 } 888 fprintf(f,"\n"); 889 890 fprintf(f,"aulow = %d\n", cfg->mon_aulow); 891 fprintf(f,"hideclient_to = %d\n", cfg->mon_hideclient_to); 892 fprintf(f,"monlevel = %d\n", cfg->mon_level); 893 fprintf(f,"httpport = %d\n", cfg->http_port); 894 fprintf(f,"httpuser = %s\n", cfg->http_user); 895 fprintf(f,"httppwd = %s\n", cfg->http_pwd); 896 fprintf(f,"httpcss = %s\n", cfg->http_css); 897 fprintf(f,"httprefresh = %d\n", cfg->http_refresh); 898 fprintf(f,"httphideidleclients = %d\n", cfg->http_hide_idle_clients); 899 fprintf(f,"\n"); 900 901 /*newcamd*/ 902 int j; 903 char *dot1, *dot2; 904 if (cfg->ncd_ptab.nports>0){ 905 fprintf(f,"[newcamd]\n"); 906 fprintf(f,"port = "); 907 dot1 = ""; 908 for(i = 0; i < cfg->ncd_ptab.nports; ++i){ 909 dot2 = ":"; 910 fprintf(f,"%s%d@%04X", dot1, cfg->ncd_ptab.ports[i].s_port, cfg->ncd_ptab.ports[i].ftab.filts[0].caid); 911 if (cfg->ncd_ptab.ports[i].ftab.filts[0].nprids > 0){ 912 for (j = 0; j < cfg->ncd_ptab.ports[i].ftab.filts[0].nprids; ++j){ 913 fprintf(f,"%s%lX", dot2, cfg->ncd_ptab.ports[i].ftab.filts[0].prids[j]); 914 dot2 = ","; 915 } 916 } 917 dot1=";"; 918 } 919 fprintf(f,"\n"); 920 fprintf(f,"serverip = %s\n", inet_ntoa(*(struct in_addr *)&cfg->ncd_srvip)); 921 fprintf(f,"key = "); 922 for (i=0;i<14;i++) fprintf(f,"%02X", cfg->ncd_key[i]); 923 fprintf(f,"\n\n"); 924 } 925 926 /*camd3.5*/ 927 if ( cfg->c35_port > 0) { 928 fprintf(f,"[cs357x]\n"); 929 fprintf(f,"port = %d\n", cfg->c35_port); 930 fprintf(f,"serverip = %s\n", inet_ntoa(*(struct in_addr *)&cfg->c35_tcp_srvip)); 931 fprintf(f,"\n"); 932 } 933 934 /*Radegast*/ 935 if ( cfg->rad_port > 0) { 936 fprintf(f,"[radegast]\n"); 937 fprintf(f,"port = %d\n", cfg->rad_port); 938 fprintf(f,"serverip = %s\n", inet_ntoa(*(struct in_addr *)&cfg->rad_srvip)); 939 fprintf(f,"user = %s\n", cfg->rad_usr); 940 fprintf(f,"allowed = "); 941 struct s_ip *cip; 942 for (cip = cfg->rad_allowed; cip; cip = cip->next){ 943 fprintf(f,"%s%s", dot, inet_ntoa(*(struct in_addr *)&cip->ip[0])); 944 if (cip->ip[0] == cip->ip[1]) fprintf(f,"-%s", inet_ntoa(*(struct in_addr *)&cip->ip[1])); 945 dot=","; 946 } 947 fprintf(f,"\n\n"); 948 } 880 949 881 950 -
branches/monitor-improvement/oscam-http.c
r1041 r1044 62 62 } 63 63 tpl_addVar(vars, 1, "MESSAGE", "<BR><BR><B>Configuration Global *DONE*</B><BR><BR>"); 64 refresh_oscam(REFR_SERVER);64 /*if(write_config()==0) */refresh_oscam(REFR_SERVER); 65 65 } 66 66 tpl_addVar(vars, 0, "SERVERIP", inet_ntoa(*(struct in_addr *)&cfg->srvip)); … … 270 270 struct s_ip *cip; 271 271 char *dot=""; 272 for (cip = cfg-> rad_allowed; cip; cip = cip->next){272 for (cip = cfg->mon_allowed; cip; cip = cip->next){ 273 273 tpl_printf(vars, 1, "NOCRYPT", "%s%s", dot, inet_ntoa(*(struct in_addr *)&cip->ip[0])); 274 274 if (cip->ip[0] == cip->ip[1]) tpl_printf(vars, 1, "NOCRYPT", "-%s", inet_ntoa(*(struct in_addr *)&cip->ip[1])); … … 721 721 time_t now = time((time_t)0); 722 722 struct tm *lt; 723 723 724 724 char *hideidle = getParam(params, "hideidle"); 725 725 if(strlen(hideidle) > 0){ … … 730 730 } 731 731 } 732 732 733 733 if(cfg->http_hide_idle_clients > 0) tpl_addVar(vars, 0, "HIDEIDLECLIENTSSELECTED1", "selected"); 734 else tpl_addVar(vars, 0, "HIDEIDLECLIENTSSELECTED0", "selected"); 734 else tpl_addVar(vars, 0, "HIDEIDLECLIENTSSELECTED0", "selected"); 735 735 736 736 for (i=0; i<CS_MAXPID; i++) { … … 776 776 tpl_printf(vars, 0, "CLIENTCON", "%d", con); 777 777 tpl_printf(vars, 0, "CWOK", "%d", client[i].cwfound); 778 tpl_printf(vars, 0, "CWNOK", "%d", client[i].cwnot); 778 tpl_printf(vars, 0, "CWNOK", "%d", client[i].cwnot); 779 779 tpl_addVar(vars, 1, "CLIENTSTATUS", tpl_getTpl(vars, "CLIENTSTATUSBIT")); 780 780 }
Note:
See TracChangeset
for help on using the changeset viewer.