diff --git a/exec/upgrade_to_v320.js b/exec/upgrade_to_v320.js index 81524026c8e5f1575326ef72f2ab86c257108afd..4964511c3734dbd61f06bc62e51f1d166f79aa2c 100755 --- a/exec/upgrade_to_v320.js +++ b/exec/upgrade_to_v320.js @@ -4,6 +4,9 @@ print("Upgrading Synchronet v3.1x config files to v3.20"); load('sbbsdefs.js'); var cnflib = load({}, 'cnflib.js'); var node_settings; +var node_valuser; +var node_erruser; +var node_errlevel; function upgrade_node(dir) { @@ -23,6 +26,9 @@ function upgrade_node(dir) ini.iniSetObject(null, cnf); ini.close(); node_settings = cnf.settings; + node_valuser = cnf.valuser; + node_erruser = cnf.erruser; + node_errlevel = cnf.errlevel; } //--------------------------------------------------------------------------- @@ -126,6 +132,9 @@ for(var i in cnf.command_shell) { ini.iniSetObject(key, cnf.command_shell[i]); } delete cnf.command_shell; +cnf.valuser = node_valuser; +cnf.erruser = node_erruser; +cnf.errlevel = node_errlevel; ini.iniSetObject(null, cnf); ini.close(); diff --git a/src/sbbs3/email.cpp b/src/sbbs3/email.cpp index b609b3a8f8de98cea95526c27c263a99649b383a..ccc2182fd019b364a18aa56462f0364122da557a 100644 --- a/src/sbbs3/email.cpp +++ b/src/sbbs3/email.cpp @@ -56,12 +56,12 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode, return(false); } if(usernumber==1 && useron.rest&FLAG('S') - && (cfg.node_valuser!=1 || useron.fbacks || useron.emails)) { /* ! val fback */ + && (cfg.valuser!=1 || useron.fbacks || useron.emails)) { /* ! val fback */ bprintf(text[R_Feedback],cfg.sys_op); return(false); } if(usernumber!=1 && useron.rest&FLAG('E') - && (cfg.node_valuser!=usernumber || useron.fbacks || useron.emails)) { + && (cfg.valuser!=usernumber || useron.fbacks || useron.emails)) { bputs(text[R_Email]); return(false); } @@ -95,7 +95,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode, nodesync(); SAFEPRINTF(str,"%sfeedback.*", cfg.exec_dir); - if(usernumber==cfg.node_valuser && useron.fbacks && fexist(str)) { + if(usernumber==cfg.valuser && useron.fbacks && fexist(str)) { exec_bin("feedback",&main_csi); if(main_csi.logic!=LOGIC_TRUE) return(false); diff --git a/src/sbbs3/exec.cpp b/src/sbbs3/exec.cpp index 5b25540c48c03cd7f3cd2e8516390988b1d29f0a..7b9970790c75aaea3a6acec7eed72b2227be37fb 100644 --- a/src/sbbs3/exec.cpp +++ b/src/sbbs3/exec.cpp @@ -285,7 +285,7 @@ int32_t * sbbs_t::getintvar(csi_t *bin, uint32_t name) case 0x709c07da: return((int32_t *)&cfg.node_misc); case 0xb17e7914: - sysvar_l[sysvar_li]=cfg.node_valuser; + sysvar_l[sysvar_li]=cfg.valuser; break; case 0xadae168a: sysvar_l[sysvar_li]=cfg.node_ivt; diff --git a/src/sbbs3/js_bbs.cpp b/src/sbbs3/js_bbs.cpp index ec2b0c421e7fcfdc8248bdb75bd08a2af3a0964e..042e8b4718a328d224699118323acc0f01bd5f8c 100644 --- a/src/sbbs3/js_bbs.cpp +++ b/src/sbbs3/js_bbs.cpp @@ -366,7 +366,7 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp) break; case BBS_PROP_NODE_VAL_USER: - val=sbbs->cfg.node_valuser; + val=sbbs->cfg.valuser; break; case BBS_PROP_LOGON_ULB: @@ -831,7 +831,7 @@ static JSBool js_bbs_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, j sbbs->action=(uchar)val; break; case BBS_PROP_NODE_VAL_USER: - sbbs->cfg.node_valuser=(ushort)val; + sbbs->cfg.valuser=(ushort)val; break; case BBS_PROP_LOGON_ULB: sbbs->logon_ulb=val; diff --git a/src/sbbs3/logfile.cpp b/src/sbbs3/logfile.cpp index 2ce31fccf4c9d1f5a5cbecdc3da97d5c5dc65ff8..09460b8de648ad5ee04a5296837153aac87eac01 100644 --- a/src/sbbs3/logfile.cpp +++ b/src/sbbs3/logfile.cpp @@ -152,10 +152,10 @@ extern "C" int errorlog(scfg_t* cfg, struct mqtt* mqtt, int level, const char* h ,log_line_ending ); fcloselog(fp); - if(cfg->node_erruser && level <= cfg->node_errlevel) { + if(cfg->erruser && level <= cfg->errlevel) { char subject[128]; SAFEPRINTF2(subject, "%s %sERROR occurred", host, level <= LOG_CRIT ? "CRITICAL " : ""); - notify(cfg, cfg->node_erruser, subject, text); + notify(cfg, cfg->erruser, subject, text); } mqtt_errormsg(mqtt, level, text); diff --git a/src/sbbs3/newuser.cpp b/src/sbbs3/newuser.cpp index 51c4999f38384aaa8781fc9069ee4a571f81356f..df103b5dc2a12128e8f97386f128789754d8f5bc 100644 --- a/src/sbbs3/newuser.cpp +++ b/src/sbbs3/newuser.cpp @@ -467,19 +467,19 @@ BOOL sbbs_t::newuser() delallmail(useron.number, MAIL_ANY); - if(useron.number!=1 && cfg.node_valuser) { + if(useron.number!=1 && cfg.valuser) { menu("../feedback", P_NOABORT|P_NOERROR); safe_snprintf(str,sizeof(str),text[NewUserFeedbackHdr] ,nulstr,getage(&cfg,useron.birth),useron.sex,useron.birth ,useron.name,useron.phone,useron.comp,useron.modem); - email(cfg.node_valuser,str,"New User Validation",WM_SUBJ_RO|WM_FORCEFWD); + email(cfg.valuser,str,"New User Validation",WM_SUBJ_RO|WM_FORCEFWD); if(!useron.fbacks && !useron.emails) { if(online) { /* didn't hang up */ - bprintf(text[NoFeedbackWarning],username(&cfg,cfg.node_valuser,tmp)); - email(cfg.node_valuser,str,"New User Validation",WM_SUBJ_RO|WM_FORCEFWD); + bprintf(text[NoFeedbackWarning],username(&cfg,cfg.valuser,tmp)); + email(cfg.valuser,str,"New User Validation",WM_SUBJ_RO|WM_FORCEFWD); } /* give 'em a 2nd try */ if(!useron.fbacks && !useron.emails) { - bprintf(text[NoFeedbackWarning],username(&cfg,cfg.node_valuser,tmp)); + bprintf(text[NoFeedbackWarning],username(&cfg,cfg.valuser,tmp)); logline(LOG_NOTICE,"N!","Aborted feedback"); hangup(); putuserstr(useron.number, USER_COMMENT, "Didn't leave feedback"); diff --git a/src/sbbs3/scfg/scfg.c b/src/sbbs3/scfg/scfg.c index 80f55ae4c95414a157a9ddbc9e31801b1f987b81..5374129e236b787988e5b2132563f30be656625f 100644 --- a/src/sbbs3/scfg/scfg.c +++ b/src/sbbs3/scfg/scfg.c @@ -161,7 +161,7 @@ void wizard_msg(const char* text) static bool abort_wizard(void) { char* opt[] = { "Abort", "Restart", NULL }; - wizard_msg("You can abort or restart the Setup Wizard from the beginning."); + wizard_msg("You can abort the Setup Wizard or restart from the beginning."); return uifc.list(WIN_SAV | WIN_L2R | WIN_NOBRDR, 0, 10 ,0, NULL, NULL ,"Abort Setup Wizard", opt) == 0; } @@ -192,7 +192,7 @@ void cfg_wizard(void) "parameters required to run a Synchronet Bulletin Board System. All of\n" "these configuration parameters may be changed later if you choose.\n" "\n" - "Hit ~ ENTER ~ to advance through the setup wizard or ~ ESC ~ to abort\n" + "Press ~ ENTER ~ to advance through the setup wizard or ~ ESC ~ to abort\n" "or restart the wizard." ); if(uifc.list(WIN_SAV | WIN_L2R | WIN_NOBRDR, 0, 12 ,0, NULL, NULL @@ -218,8 +218,12 @@ void cfg_wizard(void) continue; if(edit_sys_newuser_policy(true) < 0) continue; - if(edit_sys_alias_policy(true) < 0) - continue; + if(!(cfg.sys_misc & SM_CLOSED)) { + if(edit_sys_newuser_fback_policy(true) < 0) + continue; + if(edit_sys_alias_policy(true) < 0) + continue; + } if(edit_sys_delmsg_policy(true) < 0) continue; if(memcmp(&saved_cfg, &cfg, sizeof(cfg)) == 0) { @@ -237,7 +241,7 @@ void cfg_wizard(void) ); char pass[sizeof(cfg.sys_pass)]; do { - if(uifc.input(WIN_L2R|WIN_SAV, 0, 12, "SY", pass, sizeof(cfg.sys_pass)-1, K_PASSWORD | K_UPPER) < 0) + if(uifc.input(WIN_L2R|WIN_SAV, 0, 14, "SY", pass, sizeof(cfg.sys_pass)-1, K_PASSWORD | K_UPPER) < 0) break; } while(strcmp(cfg.sys_pass, pass) != 0); if(strcmp(cfg.sys_pass, pass)) @@ -606,17 +610,17 @@ int main(int argc, char **argv) "This is the main menu of the Synchronet configuration utility (SCFG).\n" "From this menu, you have the following choices:\n" "\n" - " Nodes : Add, delete, or configure nodes\n" - " System : System-wide configuration options\n" - " Networks : Networking configuration\n" - " File Areas : File area configuration\n" - " File Options : File area options\n" - " Chat Features : Chat actions, sections, pagers, and robots\n" - " Message Areas : Message area configuration\n" - " Message Options : Message and e-mail options\n" - " Command Shells : Terminal server user interface/menu modules\n" - " External Programs : Events, editors, and online programs (doors)\n" - " Text File Sections : Text file areas available for online viewing\n" + " `Nodes ` Add, delete, or configure nodes\n" + " `System ` System-wide configuration options\n" + " `Networks ` Networking configuration\n" + " `File Areas ` File area configuration\n" + " `File Options ` File area options\n" + " `Chat Features ` Chat actions, sections, pagers, and robots\n" + " `Message Areas ` Message area configuration\n" + " `Message Options ` Message and e-mail options\n" + " `Command Shells ` Terminal server user interface/menu modules\n" + " `External Programs ` Events, editors, and online programs (doors)\n" + " `Text File Sections ` Text file areas available for online viewing\n" "\n" "Use the arrow keys and ~ ENTER ~ to select an option, or ~ ESC ~ to exit.\n" ; diff --git a/src/sbbs3/scfg/scfg.h b/src/sbbs3/scfg/scfg.h index 058204bc664e596051e1e7266126f4a9b2247f59..e5d3070dcaa77c4d49405bc58bdc0897f6d8e1b5 100644 --- a/src/sbbs3/scfg/scfg.h +++ b/src/sbbs3/scfg/scfg.h @@ -160,6 +160,7 @@ int edit_sys_datefmt(bool wiz); int edit_sys_newuser_policy(bool wiz); int edit_sys_alias_policy(bool wiz); int edit_sys_delmsg_policy(bool wiz); +int edit_sys_newuser_fback_policy(bool wiz); void reencrypt_keys(const char* old_pass, const char* new_pass); int export_mdm(char *fname); int code_ok(char *str); diff --git a/src/sbbs3/scfg/scfgnode.c b/src/sbbs3/scfg/scfgnode.c index d7a5ea6cceba288cbb2dec06dab74b384bc9d601..1343f0d4d13d0d10fccdd1194c521997c9536221 100644 --- a/src/sbbs3/scfg/scfgnode.c +++ b/src/sbbs3/scfg/scfgnode.c @@ -19,10 +19,6 @@ #include "scfg.h" -/* These correlate with the LOG_* definitions in syslog.h/gen_defs.h */ -static char* errLevelStringList[] - = {"Emergency", "Alert", "Critical", "Error", NULL}; - static char* node_path_help = "`Node Directory:`\n" "\n" @@ -303,12 +299,6 @@ void node_cfg() done=0; while(!done) { i=0; - sprintf(opt[i++],"%-27.27s%s","Validation User" - ,cfg.node_valuser ? ultoa(cfg.node_valuser,tmp,10) : "Nobody"); - sprintf(opt[i++],"%-27.27s%s","Notification User" - ,cfg.node_erruser ? ultoa(cfg.node_erruser,tmp,10) : "Nobody"); - sprintf(opt[i++],"%-27.27s%s","Notification Error Level" - ,errLevelStringList[cfg.node_errlevel]); sprintf(opt[i++],"%-27.27s%u seconds","Semaphore Frequency" ,cfg.node_sem_check); sprintf(opt[i++],"%-27.27s%u seconds","Statistics Frequency" @@ -333,53 +323,6 @@ void node_cfg() case -1: done=1; break; - case __COUNTER__: - ultoa(cfg.node_valuser,str,10); - uifc.helpbuf= - "`Validation User Number:`\n" - "\n" - "When a caller logs onto the system as `New`, he or she must send\n" - "validation feedback to the sysop. This feature can be disabled by\n" - "setting this value to `0`, allowing new users to logon without sending\n" - "validation feedback. If you want new users on this node to be forced to\n" - "send validation feedback, set this value to the number of the user to\n" - "whom the feedback is sent. The normal value of this option is `1` for\n" - "user number one.\n" - ; - uifc.input(WIN_MID|WIN_SAV,0,13,"Validation User Number (0=Nobody)" - ,str,4,K_NUMBER|K_EDIT); - cfg.node_valuser=atoi(str); - break; - case __COUNTER__: - ultoa(cfg.node_erruser,str,10); - uifc.helpbuf= - "`Notification User Number:`\n" - "\n" - "When an error has occurred, a notification message can be sent to a\n" - "configured user number (i.e. a sysop). This feature can be disabled by\n" - "setting this value to `0`. The normal value of this option is `1` for\n" - "user number one.\n" - "\n" - "Note: error messages are always logged as well (e.g. to `data/error.log`)." - ; - uifc.input(WIN_MID|WIN_SAV,0,13,"Notification User Number (0=Nobody)" - ,str,4,K_NUMBER|K_EDIT); - cfg.node_erruser=atoi(str); - break; - case __COUNTER__: - uifc.helpbuf= - "`Notification Error Level`\n" - "\n" - "Select the minimum severity of error messages that should be forwarded\n" - "to the Notification User. The normal setting would be `Critical`."; - int i = cfg.node_errlevel; - i = uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0,"Notification Error Level",errLevelStringList); - if(i>=0 && i<=LOG_ERR) { - if(cfg.node_errlevel != i) - uifc.changes = TRUE; - cfg.node_errlevel=i; - } - break; case __COUNTER__: ultoa(cfg.node_sem_check,str,10); uifc.helpbuf= diff --git a/src/sbbs3/scfg/scfgsys.c b/src/sbbs3/scfg/scfgsys.c index a6c22f7ed0ec16d23bc878e6d8c37355541f96f4..3ef6f054643b302963fcf2291a67a85f0f4a403b 100644 --- a/src/sbbs3/scfg/scfgsys.c +++ b/src/sbbs3/scfg/scfgsys.c @@ -63,9 +63,9 @@ int edit_sys_operator(bool wiz) uifc.helpbuf= "`System Operator:`\n" "\n" - "This is the name or alias of the system operator (you). This does not have\n" - "to be the same name or alias as user #1. This field is used for informational\n" - "display purposes only.\n" + "This is the name or alias of the system operator (you). This does not\n" + "have to be the same name or alias as user #1. This value is used for\n" + "informational/display purposes only.\n" ; if(wiz) mode = wiz_help(uifc.helpbuf); @@ -1358,6 +1358,33 @@ int edit_sys_alias_policy(bool wiz) return i; } +int edit_sys_newuser_fback_policy(bool wiz) +{ + int mode = WIN_SAV | WIN_MID; + char str[128]; + ultoa(cfg.valuser,str,10); + uifc.helpbuf= + "`Require New User Feedback:`\n" + "\n" + "When a caller registers as a new user, they can be required to send a\n" + "validation request via feedback message to the sysop.\n" + "\n" + "If you want new users of this system to be forced to send validation\n" + "feedback, set this value to the number of the user to whom the feedback\n" + "is sent, e.g. `1` for user number one.\n" + "\n" + "This feature can be disabled by setting this value to `0`, allowing new\n" + "users to register and logon without sending validation feedback.\n" + ; + if(wiz) + mode = wiz_help(uifc.helpbuf); + int i = uifc.input(mode, 0, 16, "Require New User Feedback to (0=Nobody)" + ,str, 5, K_NUMBER|K_EDIT); + if(i >= 0) + cfg.valuser=atoi(str); + return i; +} + void reencrypt_keys(const char *old_pass, const char* new_pass) { if(fexist("ssl.cert") || fexist("cryptlib.key") || fexist("letsyncrypt.key")) { @@ -1398,6 +1425,78 @@ void reencrypt_keys(const char *old_pass, const char* new_pass) } } +/* These correlate with the LOG_* definitions in syslog.h/gen_defs.h */ +static char* errLevelStringList[] + = {"Emergency", "Alert", "Critical", "Error", NULL}; + +void cfg_notify(void) +{ + char str[128]; + static int dflt; + + while(1) { + int i=0; + if(cfg.valuser) + SAFEPRINTF(str, "User #%u", cfg.valuser); + else + SAFECOPY(str, "Nobody"); + sprintf(opt[i++],"%-23.23s%s","New User Feedback", str); + if(cfg.erruser) + SAFEPRINTF(str, "User #%u", cfg.erruser); + else + SAFECOPY(str, "Nobody"); + sprintf(opt[i++],"%-23.23s%s","Error Notifications", str); + sprintf(opt[i++],"%-23.23s%s","Error Level", errLevelStringList[cfg.errlevel]); + opt[i][0] = '\0'; + uifc.helpbuf= + "`System Operator Notifications:`\n" + "\n" + "Configure settings related to notifications sent to the operators of\n" + "the system via emails and instant messages.\n" + ; + switch(uifc.list(WIN_BOT|WIN_RHT|WIN_ACT|WIN_SAV, 0, 0, 0, &dflt, 0 + ,"System Operator Notifications",opt)) { + case -1: + return; + break; + case 0: + edit_sys_newuser_fback_policy(false); + break; + case 1: + ultoa(cfg.erruser,str,10); + uifc.helpbuf= + "`Error Notifications:`\n" + "\n" + "When an error has occurred, a notification message can be sent to a\n" + "configured user number (i.e. a sysop). This feature can be disabled by\n" + "setting this value to `0`. The normal value of this option is `1` for\n" + "user number one.\n" + "\n" + "Note: error messages are always logged as well (e.g. to `data/error.log`)." + ; + uifc.input(WIN_MID|WIN_SAV,0,13,"Send Error Notifications to (0=Nobody)" + ,str, 5, K_NUMBER|K_EDIT); + cfg.erruser=atoi(str); + break; + case 2: + uifc.helpbuf= + "`Notification Error Level`\n" + "\n" + "Select the minimum severity of error messages that should be forwarded\n" + "to the Error Notification User. `Error` is the lowest severity level\n" + "while `Emergency` is the highest.\n" + "\n" + "The default minimum level for error notifications is `Critical`."; + int i = cfg.errlevel; + i = uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0,"Notification Error Level",errLevelStringList); + if(i>=0 && i<=LOG_ERR) + cfg.errlevel=i; + break; + } + } +} + + void sys_cfg(void) { static int sys_dflt,adv_dflt,tog_dflt,new_dflt; @@ -1418,6 +1517,7 @@ void sys_cfg(void) ,SMB_TZ_HAS_DST(cfg.sys_timezone) && cfg.sys_misc&SM_AUTO_DST ? "(Auto-DST)" : ""); sprintf(opt[i++],"%-33.33s%s","Operator",cfg.sys_op); + strcpy(opt[i++],"Notifications..."); strcpy(opt[i++],"Toggle Options..."); strcpy(opt[i++],"New User Values..."); strcpy(opt[i++],"Security Options..."); @@ -1458,7 +1558,10 @@ void sys_cfg(void) case 3: edit_sys_operator(false); break; - case 4: /* Toggle Options */ + case 4: + cfg_notify(); + break; + case 5: /* Toggle Options */ done=0; while(!done) { i=0; @@ -1635,7 +1738,7 @@ void sys_cfg(void) } } break; - case 5: /* New User Values */ + case 6: /* New User Values */ done=0; while(!done) { i=0; @@ -2118,10 +2221,10 @@ void sys_cfg(void) } } break; - case 6: + case 7: security_cfg(); break; - case 7: /* Advanced Options */ + case 8: /* Advanced Options */ done=0; while(!done) { i=0; @@ -2486,7 +2589,7 @@ void sys_cfg(void) } } break; - case 8: /* Loadable Modules */ + case 9: /* Loadable Modules */ done=0; while(!done) { i=0; diff --git a/src/sbbs3/scfgdefs.h b/src/sbbs3/scfgdefs.h index 46fbd9a6e0cb86c673f8f351af7e2a60bd933034..b1f6a6dac939415324c26e4802fe052f6085f514 100644 --- a/src/sbbs3/scfgdefs.h +++ b/src/sbbs3/scfgdefs.h @@ -512,9 +512,9 @@ typedef struct uchar node_scrnlen; /* Length of screen (rows) */ uchar node_scrnblank; /* Min of inactivity for blank screen */ uint32_t node_misc; /* Misc bits for node setup */ - uint16_t node_valuser; /* User validation mail goes to */ - uint16_t node_erruser; /* User error messages goes to */ - uchar node_errlevel; /* Log level threshold to notify user (node_erruser) */ + uint16_t valuser; /* User validation mail goes to */ + uint16_t erruser; /* User error messages goes to */ + uchar errlevel; /* Log level threshold to notify user (erruser) */ uint16_t node_ivt; /* Time-slice APIs */ uchar node_swap; /* Swap types allowed */ char node_swapdir[LEN_DIR+1]; /* Swap directory */ @@ -532,8 +532,8 @@ typedef struct char new_install; /* This is a brand new installation */ char new_pass[41]; /* New User Password */ char new_magic[21]; /* New User Magic Word */ - char new_sif[LEN_SIFNAME+1]; /* New User SIF Questionaire */ - char new_sof[LEN_SIFNAME+1]; /* New User SIF Questionaire output SIF */ + char new_sif[LEN_SIFNAME+1]; /* New User SIF Questionnaire */ + char new_sof[LEN_SIFNAME+1]; /* New User SIF Questionnaire output SIF */ char new_genders[41]; /* New User Gender options (default: "MF") */ int new_level; /* New User Main Level */ uint32_t new_flags1; /* New User Main Flags from set #1*/ diff --git a/src/sbbs3/scfglib1.c b/src/sbbs3/scfglib1.c index 845893b515f315982554668f5ee39f63c6e88aee..410e894cc38eac6279cb19c99a379882ccb2d9cb 100644 --- a/src/sbbs3/scfglib1.c +++ b/src/sbbs3/scfglib1.c @@ -62,13 +62,10 @@ BOOL read_node_cfg(scfg_t* cfg, char* error, size_t maxerrlen) arstr(NULL, cfg->node_arstr, cfg, cfg->node_ar); cfg->node_misc = iniGetUInteger(ini, ROOT_SECTION, "settings", 0); - cfg->node_valuser = iniGetShortInt(ini, ROOT_SECTION, "valuser", 0); cfg->node_sem_check = iniGetShortInt(ini, ROOT_SECTION, "sem_check", 60); cfg->node_stat_check = iniGetShortInt(ini, ROOT_SECTION, "stat_check", 10); cfg->sec_warn = iniGetShortInt(ini, ROOT_SECTION, "sec_warn", 180); cfg->sec_hangup = iniGetShortInt(ini, ROOT_SECTION, "sec_hangup", 300); - cfg->node_erruser = iniGetShortInt(ini, ROOT_SECTION, "erruser", 300); - cfg->node_errlevel = (uchar)iniGetShortInt(ini, ROOT_SECTION, "errlevel", 0); iniFreeStringList(ini); @@ -132,6 +129,9 @@ BOOL read_main_cfg(scfg_t* cfg, char* error, size_t maxerrlen) cfg->user_backup_level = iniGetInteger(ini, ROOT_SECTION, "user_backup_level", 5); cfg->mail_backup_level = iniGetInteger(ini, ROOT_SECTION, "mail_backup_level", 5); cfg->new_install = iniGetBool(ini, ROOT_SECTION, "new_install", FALSE); + cfg->valuser = iniGetShortInt(ini, ROOT_SECTION, "valuser", 0); + cfg->erruser = iniGetShortInt(ini, ROOT_SECTION, "erruser", 0); + cfg->errlevel = (uchar)iniGetShortInt(ini, ROOT_SECTION, "errlevel", LOG_CRIT); // fixed events SAFECOPY(cfg->sys_logon, iniGetString(ini, "logon_event", "cmd", "", value)); diff --git a/src/sbbs3/scfgsave.c b/src/sbbs3/scfgsave.c index 56e90007dc55aa2800888651ba5b794051f513c4..c32c4e01e6535bbccfb34a99903c8b363eb60552 100644 --- a/src/sbbs3/scfgsave.c +++ b/src/sbbs3/scfgsave.c @@ -85,13 +85,10 @@ BOOL write_node_cfg(scfg_t* cfg, int backup_level) iniSetString(&ini, ROOT_SECTION, "ars", cfg->node_arstr, NULL); iniSetHexInt(&ini, ROOT_SECTION, "settings", cfg->node_misc, NULL); - iniSetShortInt(&ini, ROOT_SECTION, "valuser", cfg->node_valuser, NULL); iniSetShortInt(&ini, ROOT_SECTION, "sem_check", cfg->node_sem_check, NULL); iniSetShortInt(&ini, ROOT_SECTION, "stat_check", cfg->node_stat_check, NULL); iniSetShortInt(&ini, ROOT_SECTION, "sec_warn", cfg->sec_warn, NULL); iniSetShortInt(&ini, ROOT_SECTION, "sec_hangup", cfg->sec_hangup, NULL); - iniSetShortInt(&ini, ROOT_SECTION, "erruser", cfg->node_erruser, NULL); - iniSetShortInt(&ini, ROOT_SECTION, "errlevel", cfg->node_errlevel, NULL); if((fp = fopen(inipath, "w")) != NULL) { result = iniWriteFile(fp, ini); @@ -147,6 +144,9 @@ BOOL write_main_cfg(scfg_t* cfg, int backup_level) iniSetHexInt(&ini, ROOT_SECTION, "ctrlkey_passthru", cfg->ctrlkey_passthru, NULL); iniSetShortInt(&ini, ROOT_SECTION, "user_backup_level", cfg->user_backup_level, NULL); iniSetShortInt(&ini, ROOT_SECTION, "mail_backup_level", cfg->mail_backup_level, NULL); + iniSetShortInt(&ini, ROOT_SECTION, "valuser", cfg->valuser, NULL); + iniSetShortInt(&ini, ROOT_SECTION, "erruser", cfg->erruser, NULL); + iniSetShortInt(&ini, ROOT_SECTION, "errlevel", cfg->errlevel, NULL); for(uint i=0;i<cfg->sys_nodes;i++) { char key[128];