Changeset 11503 for trunk/module-webif.c
- Timestamp:
- 02/17/19 18:25:41 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-webif.c
r11492 r11503 104 104 #define MNU_CFG_MONITOR 15 105 105 #define MNU_CFG_WEBIF 16 106 #define MNU_CFG_STREAMRELAY 17 106 107 107 108 /* constants for files.html submenuactivating */ … … 138 139 #define MNU_GBX_FEXPINF 28 139 140 #define MNU_GBX_INFOLOG 29 140 141 #define MNU_CFG_TOTAL_ITEMS 30 // sum of items above. Use it for "All inactive" in function calls too. 141 #define MNU_CFG_FSOFTCAMKEY 30 142 143 #define MNU_CFG_TOTAL_ITEMS 31 // sum of items above. Use it for "All inactive" in function calls too. 142 144 143 145 static void set_status_info_var(struct templatevars *vars, char *varname, int no_data, char *fmt, double value) … … 1231 1233 #endif 1232 1234 1235 #ifdef WITH_EMU 1236 static char *send_oscam_config_streamrelay(struct templatevars *vars, struct uriparams *params) 1237 { 1238 char *value; 1239 1240 setActiveSubMenu(vars, MNU_CFG_STREAMRELAY); 1241 1242 webif_save_config("streamrelay", vars, params); 1243 1244 tpl_printf(vars, TPLADD, "STREAM_SOURCE_HOST", "%s", cfg.emu_stream_source_host); 1245 tpl_printf(vars, TPLADD, "STREAM_SOURCE_PORT", "%d", cfg.emu_stream_source_port); 1246 if(cfg.emu_stream_source_auth_user) 1247 { tpl_printf(vars, TPLADD, "STREAM_SOURCE_AUTH_USER", "%s", cfg.emu_stream_source_auth_user); } 1248 if(cfg.emu_stream_source_auth_password) 1249 { tpl_printf(vars, TPLADD, "STREAM_SOURCE_AUTH_PASSWORD", "%s", cfg.emu_stream_source_auth_password); } 1250 tpl_printf(vars, TPLADD, "STREAM_RELAY_PORT", "%d", cfg.emu_stream_relay_port); 1251 tpl_printf(vars, TPLADD, "STREAM_ECM_DELAY", "%d", cfg.emu_stream_ecm_delay); 1252 1253 tpl_printf(vars, TPLADD, "TMP", "STREAMRELAYENABLEDSELECTED%d", cfg.emu_stream_relay_enabled); 1254 tpl_addVar(vars, TPLADD, tpl_getVar(vars, "TMP"), "selected"); 1255 1256 tpl_printf(vars, TPLADD, "TMP", "STREAMEMMENABLEDSELECTED%d", cfg.emu_stream_emm_enabled); 1257 tpl_addVar(vars, TPLADD, tpl_getVar(vars, "TMP"), "selected"); 1258 1259 value = mk_t_caidtab(&cfg.emu_stream_relay_ctab); 1260 tpl_addVar(vars, TPLADD, "STREAM_RELAY_CTAB", value); 1261 free_mk_t(value); 1262 1263 return tpl_getTpl(vars, "CONFIGSTREAMRELAY"); 1264 } 1265 #endif 1266 1233 1267 #ifdef MODULE_CCCAM 1234 1268 static char *send_oscam_config_cccam(struct templatevars *vars, struct uriparams *params) … … 1655 1689 else if(!strcmp(part, "scam")) { return send_oscam_config_scam(vars, params); } 1656 1690 #endif 1691 #ifdef WITH_EMU 1692 else if(!strcmp(part, "streamrelay")) { return send_oscam_config_streamrelay(vars, params); } 1693 #endif 1657 1694 #ifdef MODULE_CCCAM 1658 1695 else if(!strcmp(part, "cccam")) { return send_oscam_config_cccam(vars, params); } … … 2134 2171 chk_reader("lb_whitelist_services", servicelabelslb, rdr); 2135 2172 2136 if(is_network_reader(rdr) ) //physical readers make trouble if re-started2173 if(is_network_reader(rdr) || rdr->typ == R_EMU) //physical readers make trouble if re-started 2137 2174 { 2138 2175 if(rdr) … … 2816 2853 #if defined(READER_DRE) || defined(READER_DRECAS) 2817 2854 tpl_addVar(vars, TPLADD, "USERSCRIPT", rdr->userscript); 2855 #endif 2856 2857 #ifdef WITH_EMU 2858 //emu_auproviders 2859 value = mk_t_ftab(&rdr->emu_auproviders); 2860 tpl_addVar(vars, TPLADD, "EMUAUPROVIDERS", value); 2861 free_mk_t(value); 2862 2863 // Date-coded BISS keys 2864 if(!apicall) 2865 { 2866 tpl_addVar(vars, TPLADD, "EMUDATECODEDENABLED", (rdr->emu_datecodedenabled == 1) ? "checked" : ""); 2867 } 2868 else 2869 { 2870 tpl_addVar(vars, TPLADD, "EMUDATECODEDENABLED", (rdr->emu_datecodedenabled == 1) ? "1" : "0"); 2871 } 2872 2873 //extee 2874 tpl_addVar(vars, TPLADD, "EXTEE36", rdr->extee36); 2875 tpl_addVar(vars, TPLADD, "EXTEE56", rdr->extee56); 2876 2877 //dre force group 2878 tpl_printf(vars, TPLADD, "DRE36FORCEGROUP","%02X", rdr->dre36_force_group); 2879 tpl_printf(vars, TPLADD, "DRE56FORCEGROUP","%02X", rdr->dre56_force_group); 2818 2880 #endif 2819 2881 … … 2838 2900 case R_CAMD35 : 2839 2901 tpl_addVar(vars, TPLAPPEND, "READERDEPENDINGCONFIG", tpl_getTpl(vars, "READERCONFIGCAMD35BIT")); 2902 break; 2903 case R_EMU : 2904 tpl_addVar(vars, TPLAPPEND, "READERDEPENDINGCONFIG", tpl_getTpl(vars, "READERCONFIGEMUBIT")); 2840 2905 break; 2841 2906 case R_CS378X : … … 4599 4664 tpl_addVar(vars, TPLAPPEND, "LOGHISTORY", "<BR><BR>New Structure:<BR>"); 4600 4665 char tbuffer[83]; 4666 #ifdef WITH_EMU 4667 char keyBuffer[1024]; 4668 #endif 4601 4669 int jsondelimiter = 0; 4602 4670 while((item = ll_iter_next(&itr))) 4603 4671 { 4672 #ifdef WITH_EMU 4673 if(item->isKey) 4674 { 4675 tpl_addVar(vars, TPLADD, "ENTSTARTDATE", ""); 4676 tpl_addVar(vars, TPLADD, "ENTENDDATE", ""); 4677 cs_hexdump(0, item->key, item->keyLength, keyBuffer, sizeof(keyBuffer)); 4678 tpl_addVar(vars, TPLADD, "ENTEXPIERED", "e_valid"); 4679 tpl_printf(vars, TPLADD, "ENTCAID", "%04X", item->caid); 4680 tpl_printf(vars, TPLADD, "ENTPROVID", "%08X", item->provid); 4681 tpl_addVar(vars, TPLADD, "ENTID", item->name); 4682 tpl_addVar(vars, TPLADD, "ENTCLASS", keyBuffer); 4683 if(item->isData) { tpl_addVar(vars, TPLADD, "ENTTYPE", "data"); } 4684 else { tpl_addVar(vars, TPLADD, "ENTTYPE", "key"); } 4685 tpl_addVar(vars, TPLADD, "ENTRESNAME", ""); 4686 4687 if((strcmp(getParam(params, "hideexpired"), "1") != 0) || (item->end > now)) 4688 { tpl_addVar(vars, TPLAPPEND, "READERENTENTRY", tpl_getTpl(vars, "ENTITLEMENTITEMBIT")); } 4689 4690 continue; 4691 } 4692 #endif 4693 4604 4694 localtime_r(&item->start, &start_t); 4605 4695 localtime_r(&item->end, &end_t); … … 5090 5180 #else 5091 5181 filtered = (type == cl->typ); 5182 #endif 5183 #ifdef WITH_EMU 5184 if(type == 'e' && cl->typ == 'r' && cl->reader->typ == R_EMU) filtered = 1; 5092 5185 #endif 5093 5186 } … … 6590 6683 { "info.log", MNU_GBX_INFOLOG, FTYPE_GBOX }, // id 29 6591 6684 #endif 6685 #ifdef WITH_EMU 6686 { "SoftCam.Key", MNU_CFG_FSOFTCAMKEY,FTYPE_CONFIG }, // id 30 6687 #endif 6592 6688 { NULL, 0, 0 }, 6593 6689 }; … … 7056 7152 { 7057 7153 csystem = rdr->csystem; 7058 caid = rdr->caid; 7154 7155 if(rdr->typ != R_EMU) 7156 { 7157 caid = rdr->caid; 7158 } 7059 7159 } 7060 7160 … … 8089 8189 bufsize += n; 8090 8190 8091 //max request size 100kb 8092 if(bufsize > 102400) 8191 #ifdef WITH_EMU 8192 if(bufsize > 204800) // max request size 200kb 8193 #else 8194 if(bufsize > 102400) // max request size 100kb 8195 #endif 8093 8196 { 8094 8197 cs_log("error: too much data received from %s", cs_inet_ntoa(in));
Note:
See TracChangeset
for help on using the changeset viewer.