Changeset 1269 for branches/monitor-improvement
- Timestamp:
- 01/17/10 19:21:11 (14 years ago)
- Location:
- branches/monitor-improvement
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/globals.h
r1265 r1269 321 321 time_t lastecm; 322 322 time_t expirationdate; 323 int disabled; 323 324 ulong grp; 324 325 int crypted; … … 501 502 uchar dyndns[64]; 502 503 time_t expirationdate; 504 int disabled; 503 505 struct s_auth *next; 504 506 }; -
branches/monitor-improvement/oscam-config.c
r1260 r1269 783 783 if (!strcmp(token, "monlevel")) { account->monlvl=atoi(value); return; } 784 784 if (!strcmp(token, "caid")) { chk_caidtab(value, &account->ctab); return; } 785 if (!strcmp(token, "disabled")) { account->disabled=atoi(value); return; } 785 786 /* 786 787 * case insensitive … … 1153 1154 fprintf_conf(f, CONFVARWIDTH, "user", "%s\n", account->usr); 1154 1155 fprintf_conf(f, CONFVARWIDTH, "pwd", "%s\n", account->pwd); 1156 fprintf_conf(f, CONFVARWIDTH, "disabled", "%d\n", account->disabled); 1155 1157 struct tm * timeinfo = localtime (&account->expirationdate); 1156 1158 char buf [80]; … … 1216 1218 int init_userdb() 1217 1219 { 1218 int tag=0, nr, nro, expired ;1220 int tag=0, nr, nro, expired, disabled; 1219 1221 //int first=1; 1220 1222 FILE *fp; … … 1277 1279 fclose(fp); 1278 1280 1279 for (expired=0, ptr=cfg->account; ptr;)1281 for (expired=0, disabled=0, ptr=cfg->account; ptr;) 1280 1282 { 1281 1283 if(ptr->expirationdate && ptr->expirationdate<time(NULL)) expired++; 1284 if(ptr->disabled != 0) disabled++; 1282 1285 ptr=ptr->next; 1283 1286 } 1284 1287 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); 1286 1289 return(0); 1287 1290 } -
branches/monitor-improvement/oscam-http.c
r1267 r1269 736 736 tpl_addVar(vars, 0, "PASSWORD", account->pwd); 737 737 738 //Disabled 739 if(account->disabled) 740 tpl_addVar(vars, 0, "DISABLEDCHECKED", "checked"); 741 738 742 //Expirationdate 739 743 struct tm * timeinfo = localtime (&account->expirationdate); … … 858 862 expired = " (expired)"; 859 863 classname = "expired"; 860 } 864 } 865 if(account->disabled != 0){ 866 expired = " (disabled)"; 867 classname = "disabled"; 868 } 861 869 status="offline"; 862 870 -
branches/monitor-improvement/oscam-http.h
r1258 r1269 27 27 TR.online TD{background-color:#009900;}\n\ 28 28 TR.expired TD{background-color:orange;}\n\ 29 TR.disabled TD{background-color:#FFFF00;}\n\ 29 30 DIV.log{border:1px solid black;background-color: black; font-family:\"Courier New\", monospace ; color:yellow; font-size: 11px; word-wrap:break-word;}\n\ 30 31 DIV.sidlist{background-color: #FFFF99; padding:2; text-align:left; font-family:\"Courier New\", monospace ; color:black; font-size: 10px; word-wrap:break-word;}\n\ … … 204 205 <form action=\"user_edit.html\" method=\"get\">\n\ 205 206 <input name=\"user\" type=\"hidden\" value=\"##USERNAME##\">\n\ 207 <input name=\"disabled\" type=\"hidden\" value=\"0\">\n\ 206 208 <TABLE cellspacing=\"0\">\n\ 207 209 <TR>\n\ … … 212 214 <TD><input name=\"pwd\" type=\"text\" size=\"30\" maxlength=\"30\" value=\"##PASSWORD##\"></TD>\n\ 213 215 </TR>\n\ 216 <TR>\ 217 <TD>Disabled:</TD>\ 218 <TD><input name=\"disabled\" type=\"checkbox\" value=\"1\" ##DISABLEDCHECKED##>\n\ 214 219 <TR>\n\ 215 220 <TD>Exp. Date:</TD>\n\ -
branches/monitor-improvement/oscam.c
r1256 r1269 334 334 client[i].autoau = account->autoau; 335 335 client[i].expirationdate = account->expirationdate; 336 client[i].disabled = account->disabled; 336 337 client[i].tosleep = (60*account->tosleep); 337 338 client[i].monlvl = account->monlvl; … … 1531 1532 static char *stxt[]={"found", "cache1", "cache2", "emu", 1532 1533 "not found", "timeout", "sleeping", 1533 "fake", "invalid", "corrupt", "no card", "expdate" };1534 "fake", "invalid", "corrupt", "no card", "expdate", "disabled"}; 1534 1535 static char *stxtEx[]={"", "group", "caid", "ident", "class", "chid", "queue", "peer"}; 1535 1536 static char *stxtWh[]={"", "user ", "reader ", "server ", "lserver "}; … … 1815 1816 if(client[cs_idx].expirationdate && client[cs_idx].expirationdate<client[cs_idx].lastecm) 1816 1817 er->rc=11; //expired 1818 if(client[cs_idx].disabled != 0) 1819 er->rc=12; //disabled 1817 1820 if ((client[cs_idx].tosleep) && 1818 1821 (now-client[cs_idx].lastswitch>client[cs_idx].tosleep))
Note:
See TracChangeset
for help on using the changeset viewer.