Changeset 1269


Ignore:
Timestamp:
01/17/10 19:21:11 (11 years ago)
Author:
alno
Message:

WebIf:

  • Feature "disabled" added for accounts. The Parameter can be set in webinterface and/or in oscam.user. Syntax "disabled=0|1". If parameter is set to 1 the user do not get ecm and in log you see "disabled". A value of 0 gives access back to the user.
  • The user setting table in Webif got a new additional TR Style "disabled"
Location:
branches/monitor-improvement
Files:
5 edited

Legend:

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

    r1265 r1269  
    321321  time_t    lastecm;
    322322  time_t    expirationdate;
     323  int       disabled;
    323324  ulong     grp;
    324325  int       crypted;
     
    501502  uchar     dyndns[64];
    502503  time_t    expirationdate;
     504  int       disabled;
    503505  struct   s_auth *next;
    504506};
  • branches/monitor-improvement/oscam-config.c

    r1260 r1269  
    783783  if (!strcmp(token, "monlevel")) { account->monlvl=atoi(value); return; }
    784784  if (!strcmp(token, "caid")) { chk_caidtab(value, &account->ctab); return; }
     785  if (!strcmp(token, "disabled")) { account->disabled=atoi(value); return; }
    785786  /*
    786787   *  case insensitive
     
    11531154        fprintf_conf(f, CONFVARWIDTH, "user", "%s\n", account->usr);
    11541155        fprintf_conf(f, CONFVARWIDTH, "pwd", "%s\n", account->pwd);
     1156        fprintf_conf(f, CONFVARWIDTH, "disabled", "%d\n", account->disabled);
    11551157        struct tm * timeinfo = localtime (&account->expirationdate);
    11561158        char buf [80];
     
    12161218int init_userdb()
    12171219{
    1218   int tag=0, nr, nro, expired;
     1220  int tag=0, nr, nro, expired, disabled;
    12191221  //int first=1;
    12201222  FILE *fp;
     
    12771279  fclose(fp);
    12781280
    1279   for (expired=0, ptr=cfg->account; ptr;)
     1281  for (expired=0, disabled=0, ptr=cfg->account; ptr;)
    12801282  {
    12811283    if(ptr->expirationdate && ptr->expirationdate<time(NULL)) expired++;
     1284    if(ptr->disabled != 0) disabled++;
    12821285    ptr=ptr->next;
    12831286  }
    12841287
    1285   cs_log("userdb reloaded: %d accounts freed, %d accounts loaded, %d expired", nro, nr, expired);
     1288  cs_log("userdb reloaded: %d accounts freed, %d accounts loaded, %d expired, %d disabled", nro, nr, expired, disabled);
    12861289  return(0);
    12871290}
  • branches/monitor-improvement/oscam-http.c

    r1267 r1269  
    736736    tpl_addVar(vars, 0, "PASSWORD", account->pwd);
    737737
     738    //Disabled
     739    if(account->disabled)
     740        tpl_addVar(vars, 0, "DISABLEDCHECKED", "checked");
     741
    738742    //Expirationdate
    739743    struct tm * timeinfo = localtime (&account->expirationdate);
     
    858862            expired = " (expired)";
    859863            classname = "expired";
    860             }
     864        }
     865        if(account->disabled != 0){
     866            expired = " (disabled)";
     867            classname = "disabled";
     868        }
    861869        status="offline";
    862870
  • branches/monitor-improvement/oscam-http.h

    r1258 r1269  
    2727TR.online TD{background-color:#009900;}\n\
    2828TR.expired TD{background-color:orange;}\n\
     29TR.disabled TD{background-color:#FFFF00;}\n\
    2930DIV.log{border:1px solid black;background-color: black; font-family:\"Courier New\", monospace ; color:yellow; font-size: 11px; word-wrap:break-word;}\n\
    3031DIV.sidlist{background-color: #FFFF99; padding:2; text-align:left; font-family:\"Courier New\", monospace ; color:black; font-size: 10px; word-wrap:break-word;}\n\
     
    204205  <form action=\"user_edit.html\" method=\"get\">\n\
    205206  <input name=\"user\" type=\"hidden\" value=\"##USERNAME##\">\n\
     207  <input name=\"disabled\" type=\"hidden\" value=\"0\">\n\
    206208  <TABLE cellspacing=\"0\">\n\
    207209    <TR>\n\
     
    212214      <TD><input name=\"pwd\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##PASSWORD##\"></TD>\n\
    213215    </TR>\n\
     216    <TR>\
     217        <TD>Disabled:</TD>\
     218        <TD><input name=\"disabled\" type=\"checkbox\" value=\"1\" ##DISABLEDCHECKED##>\n\
    214219    <TR>\n\
    215220      <TD>Exp. Date:</TD>\n\
  • branches/monitor-improvement/oscam.c

    r1256 r1269  
    334334        client[i].autoau  = account->autoau;
    335335        client[i].expirationdate = account->expirationdate;
     336        client[i].disabled = account->disabled;
    336337        client[i].tosleep = (60*account->tosleep);
    337338        client[i].monlvl  = account->monlvl;
     
    15311532  static char *stxt[]={"found", "cache1", "cache2", "emu",
    15321533                       "not found", "timeout", "sleeping",
    1533                        "fake", "invalid", "corrupt", "no card", "expdate"};
     1534                       "fake", "invalid", "corrupt", "no card", "expdate", "disabled"};
    15341535  static char *stxtEx[]={"", "group", "caid", "ident", "class", "chid", "queue", "peer"};
    15351536  static char *stxtWh[]={"", "user ", "reader ", "server ", "lserver "};
     
    18151816    if(client[cs_idx].expirationdate && client[cs_idx].expirationdate<client[cs_idx].lastecm)
    18161817      er->rc=11; //expired
     1818    if(client[cs_idx].disabled != 0)
     1819        er->rc=12; //disabled
    18171820    if ((client[cs_idx].tosleep) &&
    18181821        (now-client[cs_idx].lastswitch>client[cs_idx].tosleep))
Note: See TracChangeset for help on using the changeset viewer.