Changeset 977
- Timestamp:
- 12/28/09 13:02:33 (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Distribution/doc/man/oscam.user.5
r857 r977 102 102 .RE 103 103 .PP 104 \fBexpdate\fP = \fB<year>-<month>-<day>\fP|\fB<year>/<month>/<day>\fP 105 .RS 3n 106 expiration date for account, default:none 107 108 example: expdate = 2001-11-21 109 expdate = 2002/12/22 110 .RE 111 .PP 104 112 \fBnumusers\fP = \fBquantity\fP 105 113 .RS 3n -
trunk/Distribution/doc/txt/oscam.user.txt
r857 r977 78 78 4 = complete access 79 79 80 expdate = <year>-<month>-<day>|<year>/<month>/<day> 81 expiration date for account, default:none 82 83 example: expdate = 2001-11-21 84 expdate = 2002/12/22 85 80 86 numusers = quantity 81 87 anti-cascading: user per account, 0 = anti-cascading not permitted, -
trunk/globals.h
r954 r977 317 317 time_t lastemm; 318 318 time_t lastecm; 319 time_t expirationdate; 319 320 ulong grp; 320 321 int crypted; … … 493 494 in_addr_t dynip; 494 495 uchar dyndns[64]; 496 time_t expirationdate; 495 497 struct s_auth *next; 496 498 }; -
trunk/oscam-config.c
r853 r977 730 730 if(!strcmp(token, "chid")) { chk_ftab(value, &account->fchid, "user", account->usr, "chid"); return; } 731 731 732 if (!strcmp(token, "expdate")) 733 { 734 struct tm cstime; 735 memset(&cstime,0,sizeof(cstime)); 736 for (i=0, ptr1=strtok(value, "-/"); (i<3)&&(ptr1); ptr1=strtok(NULL, "-/"), i++) 737 { 738 switch(i) 739 { 740 case 0: cstime.tm_year=atoi(ptr1)-1900; break; 741 case 1: cstime.tm_mon =atoi(ptr1)-1; break; 742 case 2: cstime.tm_mday=atoi(ptr1); break; 743 } 744 } 745 account->expirationdate=mktime(&cstime); 746 return; 747 } 748 732 749 #ifdef CS_ANTICASC 733 750 if( !strcmp(token, "numusers") ) … … 767 784 int init_userdb() 768 785 { 769 int tag=0, nr, nro ;786 int tag=0, nr, nro, expired; 770 787 //int first=1; 771 788 FILE *fp; … … 827 844 } 828 845 fclose(fp); 829 cs_log("userdb reloaded: %d accounts freed, %d accounts loaded", nro, nr); 846 847 for (expired=0, ptr=cfg->account; ptr;) 848 { 849 if(ptr->expirationdate && ptr->expirationdate<time(NULL)) expired++; 850 ptr=ptr->next; 851 } 852 853 cs_log("userdb reloaded: %d accounts freed, %d accounts loaded, %d expired", nro, nr, expired); 830 854 return(0); 831 855 } -
trunk/oscam.c
r956 r977 342 342 client[i].au = account->au; 343 343 client[i].autoau = account->autoau; 344 client[i].expirationdate = account->expirationdate; 344 345 client[i].tosleep = (60*account->tosleep); 345 346 client[i].monlvl = account->monlvl; … … 1098 1099 if (client[cs_idx].typ=='c') 1099 1100 { 1101 client[cs_idx].expirationdate=account->expirationdate; 1100 1102 client[cs_idx].grp=account->grp; 1101 1103 client[cs_idx].au=account->au; … … 1508 1510 static char *stxt[]={"found", "cache1", "cache2", "emu", 1509 1511 "not found", "timeout", "sleeping", 1510 "fake", "invalid", "corrupt", "no card" };1512 "fake", "invalid", "corrupt", "no card", "expired"}; 1511 1513 static char *stxtEx[]={"", "group", "caid", "ident", "class", "chid", "queue", "peer"}; 1512 1514 static char *stxtWh[]={"", "user ", "reader ", "server ", "lserver "}; … … 1790 1792 if ((i!=client[cs_idx].last_srvid) || (!client[cs_idx].lastswitch)) 1791 1793 client[cs_idx].lastswitch=now; 1794 if(client[cs_idx].expirationdate && client[cs_idx].expirationdate<client[cs_idx].lastecm) 1795 er->rc=11; //expired 1792 1796 if ((client[cs_idx].tosleep) && 1793 1797 (now-client[cs_idx].lastswitch>client[cs_idx].tosleep))
Note:
See TracChangeset
for help on using the changeset viewer.