Changeset 1130


Ignore:
Timestamp:
01/08/10 21:56:21 (12 years ago)
Author:
alno
Message:

WebIf:

  • Status session/ idletime now in hh:mm:ss format
  • fixed the issue of an unset time for client[0] if no client connects
Location:
branches/monitor-improvement
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/oscam-config.c

    r1126 r1130  
    555555
    556556#ifdef HAVE_DVBAPI
    557 static void chk_t_dvbapi(char *token, char *value)
     557void chk_t_dvbapi(char *token, char *value)
    558558{
    559559    if (!strcmp(token, "enabled"))  { cfg->dvbapi_enabled=atoi(value); return; }
     
    949949    dot=",";
    950950    }
    951     fputc((int)'\n', f);   
     951    fputc((int)'\n', f);
    952952    fprintf_conf(f, CONFVARWIDTH, "aulow", "%d\n", cfg->mon_aulow);
    953953    fprintf_conf(f, CONFVARWIDTH, "hideclient_to", "%d\n", cfg->mon_hideclient_to);
  • branches/monitor-improvement/oscam-http.c

    r1120 r1130  
    5353#endif
    5454    }
    55 }
    56 
    57 void gettimestring(char *retval, int seconds){
    58     int secs = 0, fullmins =0, mins =0, hours =0;
    59     char *tmp="00:00:00";
    60 
    61     if(seconds > 0){
    62         secs = seconds % 60;
    63         if (seconds > 60){
    64             fullmins = seconds / 60;
    65             mins = fullmins % 60;
    66             if(fullmins > 60)   hours = fullmins / 60;
    67         }
    68         sprintf(tmp,"%d:%d:%d", hours, mins, secs);
    69     }
    70     strncpy(retval,tmp,sizeof(retval)-1);
    7155}
    7256
     
    868852                tpl_printf(vars, 0, "CLIENTLOGINDATE", "%02d.%02d.%02d", lt->tm_mday, lt->tm_mon+1, lt->tm_year%100);
    869853                tpl_printf(vars, 0, "CLIENTLOGINTIME", "%02d:%02d:%02d", lt->tm_hour, lt->tm_min, lt->tm_sec);
    870                 tpl_printf(vars, 0, "CLIENTLOGINSECS", "%d", lsec);
     854
     855                int secs = 0, fullmins =0, mins =0, hours =0;
     856                if(lsec > 0){
     857                    secs = lsec % 60;
     858                    if (lsec > 60){
     859                        fullmins = lsec / 60;
     860                        mins = fullmins % 60;
     861                        if(fullmins > 60)   hours = fullmins / 60;
     862                    }
     863                }
     864
     865                tpl_printf(vars, 0, "CLIENTLOGINSECS", "%02d:%02d:%02d", hours, mins, secs);
    871866                tpl_printf(vars, 0, "CLIENTCAID", "%04X", client[i].last_caid);
    872867                tpl_printf(vars, 0, "CLIENTSRVID", "%04X", client[i].last_srvid);
    873868                tpl_addVar(vars, 0, "CLIENTSRVNAME", monitor_get_srvname(client[i].last_srvid));
    874                 tpl_printf(vars, 0, "CLIENTIDLESECS", "%d", isec);
     869
     870                secs = 0; fullmins =0; mins =0; hours =0;
     871                if(isec > 0){
     872                    secs = isec % 60;
     873                    if (isec > 60){
     874                        fullmins = isec / 60;
     875                        mins = fullmins % 60;
     876                        if(fullmins > 60)   hours = fullmins / 60;
     877                    }
     878                }
     879
     880                tpl_printf(vars, 0, "CLIENTIDLESECS", "%02d:%02d:%02d", hours, mins, secs);
    875881                if(con == 2) tpl_printf(vars, 0, "CLIENTCON", "Duplicate");
    876882                else if (con == 1) tpl_printf(vars, 0, "CLIENTCON", "Sleep");
  • branches/monitor-improvement/oscam.c

    r1126 r1130  
    10291029        case 97: cs_logger();
    10301030#endif
    1031         case 98: start_resolver(); 
     1031        case 98: start_resolver();
    10321032        case 95: cs_http();
    10331033      }
     
    10531053    /* Uniq = 1: only one connection per user
    10541054     *
    1055      * Uniq = 2: set (new connected) user only to fake if source 
    1056      *           ip is different (e.g. for newcamd clients with 
     1055     * Uniq = 2: set (new connected) user only to fake if source
     1056     *           ip is different (e.g. for newcamd clients with
    10571057     *           different CAID's -> Ports)
    10581058     *
    1059      * Uniq = 3: only one connection per user, but only the last 
     1059     * Uniq = 3: only one connection per user, but only the last
    10601060     *           login will survive (old mpcs behavior)
    10611061     */
     
    22832283      }
    22842284
     2285    //set time for server to now to avoid 0 in monitor/webif
     2286    client[0].last=time((time_t *)0);
     2287
    22852288  start_client_resolver();
    22862289  init_service(97); // logger
     
    23242327
    23252328  }
    2326 
    23272329
    23282330#ifdef CS_ANTICASC
Note: See TracChangeset for help on using the changeset viewer.