Changeset 4903
- Timestamp:
- 04/03/11 16:15:58 (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/globals.h
r4899 r4903 984 984 uchar dyndns[64]; 985 985 time_t expirationdate; 986 time_t firstlogin; 986 987 int allowedtimeframe[2]; 987 988 int c35_suppresscmd08; -
trunk/oscam-http.c
r4901 r4903 1693 1693 if(account->disabled != 0) { 1694 1694 expired = " (disabled)"; classname = "disabled"; 1695 tpl_addVar(vars, TPLADD ONCE, "SWITCHICO", "image?i=ICENA");1696 tpl_addVar(vars, TPLADD ONCE, "SWITCHTITLE", "enable this account");1697 tpl_addVar(vars, TPLADD ONCE, "SWITCH", "enable");1695 tpl_addVar(vars, TPLADD, "SWITCHICO", "image?i=ICENA"); 1696 tpl_addVar(vars, TPLADD, "SWITCHTITLE", "enable this account"); 1697 tpl_addVar(vars, TPLADD, "SWITCH", "enable"); 1698 1698 } else { 1699 tpl_addVar(vars, TPLADD ONCE, "SWITCHICO", "image?i=ICDIS");1700 tpl_addVar(vars, TPLADD ONCE, "SWITCHTITLE", "disable this account");1701 tpl_addVar(vars, TPLADD ONCE, "SWITCH", "disable");1702 } 1703 1704 int lastresponsetm = 0, latestactivity=0 , earliestlogin=now;1699 tpl_addVar(vars, TPLADD, "SWITCHICO", "image?i=ICDIS"); 1700 tpl_addVar(vars, TPLADD, "SWITCHTITLE", "disable this account"); 1701 tpl_addVar(vars, TPLADD, "SWITCH", "disable"); 1702 } 1703 1704 int lastresponsetm = 0, latestactivity=0; 1705 1705 char *proto = ""; 1706 double cwrate = 0.0 ;1706 double cwrate = 0.0, cwrate2 = 0.0; 1707 1707 1708 1708 //search account in active clients … … 1715 1715 else latestactivity = cl->login; 1716 1716 latestclient = cl; 1717 } 1718 if(cl->login < earliestlogin) earliestlogin = cl->login; 1719 } 1720 } 1721 1717 } 1718 } 1719 } 1720 if (account->cwfound + account->cwnot + account->cwcache > 0) { 1721 cwrate = now - account->firstlogin; 1722 cwrate /= (account->cwfound + account->cwnot + account->cwcache); 1723 } 1724 if(latestclient != NULL) { 1725 status = "<b>connected</b>"; 1726 classname = "connected"; 1727 proto = monitor_get_proto(latestclient); 1728 lastchan = xml_encode(vars, get_servicename(latestclient->last_srvid, latestclient->last_caid)); 1729 lastresponsetm = latestclient->cwlastresptime; 1730 } 1722 1731 if(latestactivity > 0){ 1723 1732 isec = now - latestactivity; 1724 1733 if(isec < cfg.mon_hideclient_to) { 1725 proto = monitor_get_proto(latestclient);1734 isactive = 1; 1726 1735 status = "<b>online</b>"; 1727 1736 classname = "online"; 1728 lastchan = xml_encode(vars, get_servicename(latestclient->last_srvid, latestclient->last_caid)); 1729 lastresponsetm = latestclient->cwlastresptime; 1730 } else if(latestclient != NULL) { 1731 status = "<b>connected</b>"; 1732 classname = "connected"; 1733 } 1734 } 1735 1736 if (account->cwfound + account->cwnot + account->cwcache > 0) { 1737 cwrate = now - earliestlogin; 1738 cwrate /= (account->cwfound + account->cwnot + account->cwcache); 1739 } 1740 1741 tpl_printf(vars, TPLADDONCE, "CWOK", "%d", account->cwfound); 1742 tpl_printf(vars, TPLADDONCE, "CWNOK", "%d", account->cwnot); 1743 tpl_printf(vars, TPLADDONCE, "CWIGN", "%d", account->cwignored); 1744 tpl_printf(vars, TPLADDONCE, "CWTOUT", "%d", account->cwtout); 1745 tpl_printf(vars, TPLADDONCE, "CWCACHE", "%d", account->cwcache); 1746 tpl_printf(vars, TPLADDONCE, "CWTUN", "%d", account->cwtun); 1747 tpl_printf(vars, TPLADDONCE, "EMMOK", "%d", account->emmok); 1748 tpl_printf(vars, TPLADDONCE, "EMMNOK", "%d", account->emmnok); 1749 tpl_printf(vars, TPLADDONCE, "CWRATE", "%.2f", cwrate); 1737 if (latestclient->cwfound + latestclient->cwnot + latestclient->cwcache > 0) { 1738 cwrate2 = now - latestclient->login; 1739 cwrate2 /= (latestclient->cwfound + latestclient->cwnot + latestclient->cwcache); 1740 tpl_printf(vars, TPLADDONCE, "CWRATE2", " (%.2f)", cwrate2); 1741 } 1742 } 1743 } 1744 1745 tpl_printf(vars, TPLADD, "CWOK", "%d", account->cwfound); 1746 tpl_printf(vars, TPLADD, "CWNOK", "%d", account->cwnot); 1747 tpl_printf(vars, TPLADD, "CWIGN", "%d", account->cwignored); 1748 tpl_printf(vars, TPLADD, "CWTOUT", "%d", account->cwtout); 1749 tpl_printf(vars, TPLADD, "CWCACHE", "%d", account->cwcache); 1750 tpl_printf(vars, TPLADD, "CWTUN", "%d", account->cwtun); 1751 tpl_printf(vars, TPLADD, "EMMOK", "%d", account->emmok); 1752 tpl_printf(vars, TPLADD, "EMMNOK", "%d", account->emmnok); 1753 tpl_printf(vars, TPLADD, "CWRATE", "%.2f", cwrate); 1750 1754 1751 1755 if ( isactive > 0 || !cfg.http_hide_idle_clients) { 1752 1756 tpl_addVar(vars, TPLADDONCE, "LASTCHANNEL", lastchan); 1753 1757 tpl_printf(vars, TPLADDONCE, "CWLASTRESPONSET", "%d", lastresponsetm); 1754 tpl_addVar(vars, TPLADDONCE, "CLIENTPROTO", proto);1755 1758 tpl_addVar(vars, TPLADDONCE, "IDLESECS", sec2timeformat(vars, isec)); 1756 } 1757 1758 tpl_addVar(vars, TPLADDONCE, "CLASSNAME", classname); 1759 tpl_addVar(vars, TPLADDONCE, "USER", xml_encode(vars, account->usr)); 1759 1760 if ((strcmp(proto,"newcamd") == 0) && (latestclient->typ == 'c')) 1761 tpl_printf(vars, TPLADDONCE, "CLIENTPROTO","%s (%s)", proto, get_ncd_client_name(latestclient->ncd_client_id)); 1762 else if (((strcmp(proto,"cccam") == 0) || (strcmp(proto,"cccam ext") == 0))) { 1763 struct cc_data *cc = latestclient->cc; 1764 if(cc && cc->remote_version && cc->remote_build) { 1765 tpl_printf(vars, TPLADDONCE, "CLIENTPROTO", "%s (%s-%s)", proto, cc->remote_version, cc->remote_build); 1766 if(cc->extended_mode) 1767 tpl_addVar(vars, TPLADDONCE, "CLIENTPROTOTITLE", cc->remote_oscam); 1768 else 1769 tpl_addVar(vars, TPLADDONCE, "CLIENTPROTOTITLE", ""); //unset tpl var 1770 } 1771 else 1772 { 1773 tpl_addVar(vars, TPLADDONCE, "CLIENTPROTO", proto); 1774 tpl_addVar(vars, TPLADDONCE, "CLIENTPROTOTITLE", ""); 1775 } 1776 } 1777 else { 1778 tpl_addVar(vars, TPLADDONCE, "CLIENTPROTO", proto); 1779 tpl_addVar(vars, TPLADDONCE, "CLIENTPROTOTITLE", ""); 1780 } 1781 } 1782 1783 tpl_addVar(vars, TPLADD, "CLASSNAME", classname); 1784 tpl_addVar(vars, TPLADD, "USER", xml_encode(vars, account->usr)); 1760 1785 tpl_addVar(vars, TPLADD, "USERENC", urlencode(vars, account->usr)); 1761 tpl_addVar(vars, TPLADD ONCE, "DESCRIPTION", xml_encode(vars, account->description));1786 tpl_addVar(vars, TPLADD, "DESCRIPTION", xml_encode(vars, account->description)); 1762 1787 tpl_addVar(vars, TPLADD, "STATUS", status); 1763 tpl_addVar(vars, TPLAPPEND ONCE, "STATUS", expired);1788 tpl_addVar(vars, TPLAPPEND, "STATUS", expired); 1764 1789 // append row to table template 1765 1790 if (!apicall) -
trunk/oscam-http.h
r4895 r4903 607 607 <TD><SPAN TITLE=\"##DESCRIPTION##\">##USER##</SPAN></TD>\n\ 608 608 <TD>##STATUS##</TD>\n\ 609 <TD align=\"center\"> ##CLIENTPROTO##</TD>\n\609 <TD align=\"center\"><SPAN TITLE=\"##CLIENTPROTOTITLE##\">##CLIENTPROTO##</SPAN></TD>\n\ 610 610 <TD>##LASTCHANNEL##</TD>\n\ 611 611 <TD align=\"center\">##IDLESECS##</TD>\n\ … … 619 619 <TD align=\"center\">##EMMOK##</TD>\n\ 620 620 <TD align=\"center\">##EMMNOK##</TD>\n\ 621 <TD align=\"center\">##CWRATE## </TD>\n\621 <TD align=\"center\">##CWRATE####CWRATE2##</TD>\n\ 622 622 <TD align=\"center\"><A HREF=\"user_edit.html?user=##USERENC##\" TITLE=\"edit this user\"><IMG HEIGHT=\"16\" WIDTH=\"16\" SRC=\"image?i=ICEDI\" BORDER=\"0\" ALT=\"Edit User\"/></A></TD>\n\ 623 623 <TD align=\"center\"><A HREF=\"userconfig.html?user=##USERENC##&action=resetstats\" TITLE=\"reset statistics for this user\"><IMG HEIGHT=\"16\" WIDTH=\"16\" SRC=\"image?i=ICRES\"BORDER=\"0\" ALT=\"Reset Stats\"/></A></TD>\n\ -
trunk/oscam.c
r4896 r4903 1292 1292 client->allowedtimeframe[0] = account->allowedtimeframe[0]; 1293 1293 client->allowedtimeframe[1] = account->allowedtimeframe[1]; 1294 if(account->firstlogin == 0) account->firstlogin = time((time_t)0); 1294 1295 client->failban = account->failban; 1295 1296 client->c35_suppresscmd08 = account->c35_suppresscmd08;
Note:
See TracChangeset
for help on using the changeset viewer.