Changeset 1053


Ignore:
Timestamp:
01/03/10 21:01:42 (12 years ago)
Author:
alno
Message:

WebIf:

  • added Configuration page for DVB Api (only if HAVE_DVBAPI_3 is set)
Location:
branches/monitor-improvement
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/globals.h

    r1046 r1053  
    783783void chk_t_global(char *token, char *value);
    784784void chk_t_monitor(char *token, char *value);
     785void chk_t_dvbapi(char *token, char *value);
    785786void chk_account(char *token, char *value, struct s_auth *account);
    786787int write_userdb();
  • branches/monitor-improvement/oscam-config.c

    r1050 r1053  
    551551}
    552552
    553 static void chk_t_dvbapi(char *token, char *value)
     553void chk_t_dvbapi(char *token, char *value)
    554554{
    555555#ifndef HAVE_DVBAPI_3
  • branches/monitor-improvement/oscam-http.c

    r1047 r1053  
    311311}
    312312
     313#ifdef HAVE_DVBAPI_3
     314void send_oscam_config_dvbapi(struct templatevars *vars, FILE *f, struct uriparams *params) {
     315    int i;
     316    if (strcmp(getParam(params, "action"),"execute") == 0){
     317            for(i = 0; i < (*params).paramcount; ++i){
     318                if ((strcmp((*params).params[i], "part")) && (strcmp((*params).params[i], "action"))){
     319                    tpl_printf(vars, 1, "MESSAGE", "Parameter: %s set to Value: %s<BR>\n", (*params).params[i], (*params).values[i]);
     320                    //we use the same function as used for parsing the config tokens
     321                    chk_t_dvbapi((*params).params[i], (*params).values[i]);
     322                }
     323            }
     324            tpl_addVar(vars, 1, "MESSAGE", "<BR><BR><B>Configuration DVB Api *DONE*</B><BR><BR>");
     325            refresh_oscam(REFR_SERVER);
     326    }
     327
     328    if (cfg->dvbapi_enabled > 0) tpl_addVar(vars, 0, "ENABLEDCHECKED", "checked");
     329    if (cfg->dvbapi_au > 0) tpl_addVar(vars, 0, "AUCHECKED", "checked");
     330    tpl_addVar(vars, 0, "SOCKET", cfg->dvbapi_socket);
     331    tpl_addVar(vars, 0, "USER", cfg->dvbapi_usr);
     332
     333    fputs(tpl_getTpl(vars, "CONFIGDVBAPI"), f);
     334}
     335#endif
     336
    313337#ifdef CS_ANTICASC
    314338void send_oscam_config_anticasc(struct templatevars *vars, FILE *f, struct uriparams *params) {
     
    346370    else if (!strcmp(part,"cccam")) send_oscam_config_cccam(vars, f, params);
    347371    else if (!strcmp(part,"gbox")) send_oscam_config_gbox(vars, f, params);
     372#ifdef HAVE_DVBAPI_3
     373    else if (!strcmp(part,"dvbapi")) send_oscam_config_dvbapi(vars, f, params);
     374#endif
    348375#ifdef CS_ANTICASC
    349376    else if (!strcmp(part,"anticasc")) send_oscam_config_anticasc(vars, f, params);
  • branches/monitor-improvement/oscam-http.h

    r1047 r1053  
    7575            <TD CLASS=\"menu\"><A HREF=\"config.html?part=monitor\">Monitor</TD>\n\
    7676            <TD CLASS=\"menu\"><A HREF=\"config.html?part=serial\">Serial</TD>\n\
     77            ##TPLCONFIGMENUDVBAPI##\
    7778        </TR>\n\
    7879    </TABLE>"
     
    8081#ifdef CS_ANTICASC
    8182#define TPLCONFIGMENUANTICASC "<TD CLASS=\"menu\"><A HREF=\"config.html?part=anticasc\">Anticascading</TD>\n"
     83#endif
     84
     85#ifdef HAVE_DVBAPI_3
     86#define TPLCONFIGMENUDVBAPI "<TD CLASS=\"menu\"><A HREF=\"config.html?part=dvbapi\">DVB-Api</TD>\n"
    8287#endif
    8388
     
    643648<BR><BR>Configuration Serial not yet implemented<BR><BR>\n\
    644649##TPLFOOTER##"
     650
     651#ifdef HAVE_DVBAPI_3
     652#define TPLCONFIGDVBAPI "\
     653##TPLHEADER##\
     654##TPLMENU##\n\
     655##TPLCONFIGMENU##\n\
     656<BR><BR>\n\
     657##MESSAGE##\
     658<form action=\"config.html\" method=\"get\">\n\
     659    <input name=\"part\" type=\"hidden\" value=\"dvbapi\">\n\
     660    <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
     661    <input name=\"enabled\" type=\"hidden\" value=\"0\">\n\
     662    <input name=\"au\" type=\"hidden\" value=\"0\">\n\
     663    <TABLE cellspacing=\"0\">\n\
     664        <TR><TH>&nbsp;</TH><TH>Edit DVB Api Config</TH></TR>\n\
     665        <TR><TD>Enabled:</TD><TD><input name=\"enabled\" type=\"checkbox\" value=\"1\" ##ENABLEDCHECKED##>\n\
     666        <TR><TD>AU:</TD><TD><input name=\"au\" type=\"checkbox\" value=\"1\" ##AUCHECKED##>\n\
     667        <TR><TD>Socket:</TD><TD><input name=\"socket\" type=\"text\" size=\"50\" maxlength=\"50\" value=\"##SOCKET##\"></TD></TR>\n\
     668        <TR><TD>User:</TD><TD><input name=\"user\" type=\"text\" size=\"20\" maxlength=\"20\" value=\"##USER##\"></TD></TR>\n\
     669    <TR><TD colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"OK\">\n</TD></TR>\n\
     670    </TABLE>\n\
     671</form>\n\
     672<BR><BR>Configuration DVB Api not yet implemented<BR><BR>\n\
     673##TPLFOOTER##"
     674#endif
    645675
    646676enum refreshtypes {REFR_ACCOUNTS, REFR_READERS, REFR_SERVER, REFR_ANTICASC};
     
    678708    "CONFIGCAMD35",
    679709    "CONFIGSERIAL"
     710#ifdef HAVE_DVBAPI_3
     711    ,"CONFIGMENUDVBAPI"
     712    ,"CONFIGDVBAPI"
     713#endif
    680714#ifdef CS_ANTICASC
    681715    ,"USEREDITANTICASC"
     
    717751    TPLCONFIGCAMD35,
    718752    TPLCONFIGSERIAL
     753#ifdef HAVE_DVBAPI_3
     754    ,TPLCONFIGDVBAPI
     755    ,TPLCONFIGMENUDVBAPI
     756#endif
    719757#ifdef CS_ANTICASC
    720758    ,TPLUSEREDITANTICASC
Note: See TracChangeset for help on using the changeset viewer.