Changeset 4308
- Timestamp:
- 01/04/11 21:15:53 (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-config.c
r4307 r4308 55 55 int strToIntVal(char *value, int defaultvalue){ 56 56 if (strlen(value) == 0) return defaultvalue; 57 else return atoi(value); 57 int i = atoi(value); 58 if (i < 0) return defaultvalue; 59 else return i; 58 60 } 59 61 … … 419 421 420 422 if (!strcmp(token, "nice")) { 421 cfg->nice = strToIntVal(value, 99); 422 if ((cfg->nice<-20) || (cfg->nice>20)) cfg->nice = 99; 423 if (cfg->nice != 99) cs_setpriority(cfg->nice); // ignore errors 424 return; 423 if (strlen(value) == 0) { 424 cfg->nice = 99; 425 return; 426 } else { 427 cfg->nice = atoi(value); 428 if ((cfg->nice<-20) || (cfg->nice>20)) cfg->nice = 99; 429 if (cfg->nice != 99) cs_setpriority(cfg->nice); // ignore errors 430 return; 431 } 425 432 } 426 433 … … 531 538 { 532 539 if (!strcmp(token, "enabled")) { 533 cfg->ac_enabled = atoi(value); 534 if( cfg->ac_enabled <= 0 ) 535 cfg->ac_enabled = 0; 536 else 540 cfg->ac_enabled = strToIntVal(value, 0); 541 if( cfg->ac_enabled > 0 ) 537 542 cfg->ac_enabled = 1; 538 return;543 return; 539 544 } 540 545 541 546 if (!strcmp(token, "numusers")) { 542 cfg->ac_users = atoi(value); 543 if( cfg->ac_users < 0 ) 544 cfg->ac_users = 0; 547 cfg->ac_users = strToIntVal(value, 0); 545 548 return; 546 549 } … … 2498 2501 if(value[0]) 2499 2502 fprintf_conf(f, CONFVARWIDTH, "chid", "%s\n", value); 2503 free(value); 2504 2505 value = mk_t_aeskeys(&rdr); 2506 if(value[0]) 2507 fprintf_conf(f, CONFVARWIDTH, "aeskeys", "%s\n", value); 2500 2508 free(value); 2501 2509 -
trunk/oscam-http.c
r4305 r4308 1033 1033 value = mk_t_caidtab(&rdr->ctab); 1034 1034 tpl_addVar(vars, 0, "CAIDS", value); 1035 free(value); 1036 1037 // AESkeys 1038 value = mk_t_aeskeys(rdr); 1039 tpl_addVar(vars, 0, "AESKEYS", value); 1035 1040 free(value); 1036 1041 -
trunk/oscam-http.h
r4305 r4308 881 881 <TR><TD>Boxid:</TD><TD><input name=\"boxid\" type=\"text\" size=\"15\" maxlength=\"8\" value=\"##BOXID##\"></TD></TR>\n\ 882 882 <TR><TD>AES Key:</TD><TD><input name=\"aeskey\" type=\"text\" size=\"35\" maxlength=\"32\" value=\"##AESKEY##\"></TD></TR>\n\ 883 <TR><TD>AES Keys:</TD><TD><textarea name=\"aeskeys\" cols=\"98\" rows=\"4\" class=\"bt\" maxlength=\"128\">##AESKEYS##</textarea></TD></TR>\n\ 883 884 <TR><TD>RSA key:</TD><TD><textarea name=\"rsakey\" cols=\"98\" rows=\"4\" class=\"bt\" maxlength=\"128\">##RSAKEY##</textarea></TD></TR>\n\ 884 885 <TR><TD>Tiger RSA key:</TD><TD><textarea name=\"tiger_rsakey\" cols=\"98\" rows=\"6\" class=\"bt\" maxlength=\"240\">##TIGERRSAKEY##</textarea></TD></TR>\n\
Note:
See TracChangeset
for help on using the changeset viewer.