Changeset 1272


Ignore:
Timestamp:
01/17/10 21:24:18 (11 years ago)
Author:
landlord
Message:

New parameter 'disabled' for 'oscam.user', backport from 'monitor-improvement'

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Distribution/doc/example/oscam.user

    r852 r1272  
    4040caid       = 0200
    4141
    42 # user for group 3 without monitor access, only one connection possible, AU disabled
     42# user for group 3 without monitor access, only one connection possible, AU disabled, account disabled
    4343
    4444[account]
    4545user       = user4
    4646pwd        = password4
     47disabled   = 1
    4748monlevel   = 0
    4849uniq       = 1
  • trunk/Distribution/doc/man/oscam.user.5

    r1070 r1272  
    112112.RE
    113113.PP
     114\fBdisabled\fP = \fB0\fP|\fB1\fP
     115.RS 3n
     1161 = account disabled, default:0
     117.RE
     118.PP
    114119\fBnumusers\fP = \fBquantity\fP \fI(only if anti-cascading enabled)\fR
    115120.RS 3n
  • trunk/Distribution/doc/txt/oscam.user.txt

    r1070 r1272  
    8686            expdate = 2002/12/22
    8787
     88       disabled = 0|1
     89      1 = account disabled, default:0
     90
    8891       numusers = quantity (only if anti-cascading enabled)
    8992      anti-cascading:  user per account, 0 = anti-cascading not permitted,
  • trunk/globals.h

    r1263 r1272  
    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;
    503   struct   s_auth *next;
     504  int       disabled;
     505  struct    s_auth *next;
    504506};
    505507
  • trunk/oscam-config.c

    r1241 r1272  
    746746  if (!strcmp(token, "monlevel")) { account->monlvl=atoi(value); return; }
    747747  if (!strcmp(token, "caid")) { chk_caidtab(value, &account->ctab); return; }
     748  if (!strcmp(token, "disabled")) { account->disabled=atoi(value); return; }
    748749  /*
    749750   *  case insensitive
     
    828829int init_userdb()
    829830{
    830   int tag=0, nr, nro, expired;
     831  int tag=0, nr, nro, expired, disabled;
    831832  //int first=1;
    832833  FILE *fp;
     
    889890  fclose(fp);
    890891
    891   for (expired=0, ptr=cfg->account; ptr;)
     892  for (expired=0, disabled=0, ptr=cfg->account; ptr;)
    892893  {
    893894    if(ptr->expirationdate && ptr->expirationdate<time(NULL)) expired++;
     895    if(ptr->disabled != 0) disabled++;
    894896    ptr=ptr->next;
    895897  }
    896898
    897   cs_log("userdb reloaded: %d accounts freed, %d accounts loaded, %d expired", nro, nr, expired);
     899  cs_log("userdb reloaded: %d accounts freed, %d accounts loaded, %d expired, %d disabled", nro, nr, expired, disabled);
    898900  return(0);
    899901}
  • trunk/oscam.c

    r1136 r1272  
    343343        client[i].autoau  = account->autoau;
    344344        client[i].expirationdate = account->expirationdate;
    345         client[i].tosleep = (60*account->tosleep);
     345        client[i].disabled = account->disabled;
     346    client[i].tosleep = (60*account->tosleep);
    346347        client[i].monlvl  = account->monlvl;
    347348        client[i].fchid   = account->fchid;  // CHID filters
     
    15271528  static char *stxt[]={"found", "cache1", "cache2", "emu",
    15281529                       "not found", "timeout", "sleeping",
    1529                        "fake", "invalid", "corrupt", "no card", "expdate"};
     1530                       "fake", "invalid", "corrupt", "no card", "expdate", "disabled"};
    15301531  static char *stxtEx[]={"", "group", "caid", "ident", "class", "chid", "queue", "peer"};
    15311532  static char *stxtWh[]={"", "user ", "reader ", "server ", "lserver "};
     
    18111812    if(client[cs_idx].expirationdate && client[cs_idx].expirationdate<client[cs_idx].lastecm)
    18121813      er->rc=11; //expired
     1814    if(client[cs_idx].disabled != 0)
     1815      er->rc=12; //disabled
    18131816    if ((client[cs_idx].tosleep) &&
    18141817        (now-client[cs_idx].lastswitch>client[cs_idx].tosleep))
Note: See TracChangeset for help on using the changeset viewer.