Updated mbsetup

This commit is contained in:
Michiel Broek 2004-02-05 21:05:31 +00:00
parent 7ed40f8412
commit d637816dbb
33 changed files with 192 additions and 92 deletions

View File

@ -20,6 +20,10 @@ v0.39.9 29-Jan-2004
mbsetup: mbsetup:
Clearing the working message is now only done by the keyboard Clearing the working message is now only done by the keyboard
read function. read function.
In several menu items added range check for integer values.
In global main aka setup, added check if a domain name is
present.
Updates to the database is now shown to the user.
script: script:
Dropped support for RedHat and Mandrake pre 6.1. Dropped support for RedHat and Mandrake pre 6.1.

2
TODO
View File

@ -151,8 +151,6 @@ mbnewusr:
-- Currently no access to my old Sun Sparcstation. -- Currently no access to my old Sun Sparcstation.
mbsetup: mbsetup:
N: Add check for reasonable settings for message split.
N: Add a check for double areatag names. N: Add a check for double areatag names.
N: Use some sort of sorting for the system aka's and make sure the N: Use some sort of sorting for the system aka's and make sure the

View File

@ -1049,11 +1049,10 @@ void show_int(int y, int x, int val)
int edit_int(int y, int x, int val, char *help) int edit_int(int y, int x, int val, char *help)
{ {
static char s[6]; static char s[7], line[7];
static char line[6];
showhelp(help); showhelp(help);
memset((char *)s, 0, 6); memset((char *)s, 0, sizeof(s));
sprintf(line, "%d", val); sprintf(line, "%d", val);
strcpy(s, edit_field(y, x, 7, '9', line)); strcpy(s, edit_field(y, x, 7, '9', line));
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
@ -1064,6 +1063,27 @@ int edit_int(int y, int x, int val, char *help)
int edit_int_range(int y, int x, int val, int min, int max, char *help)
{
static char s[7], line[7];
while (TRUE) {
showhelp(help);
memset((char *)s, 0, sizeof(s));
sprintf(line, "%d", val);
strcpy(s, edit_field(y, x, 7, '9', line));
set_color(WHITE, BLACK);
show_int(y, x, atoi(s));
fflush(stdout);
if ((atoi(s) >= min) && (atoi(s) <= max))
break;
errmsg("Value must be between %d and %d", min, max);
}
return atoi(s);
}
void show_ushort(int y, int x, unsigned short val) void show_ushort(int y, int x, unsigned short val)
{ {
mvprintw(y, x, (char *)"%d", val); mvprintw(y, x, (char *)"%d", val);
@ -1074,11 +1094,10 @@ void show_ushort(int y, int x, unsigned short val)
unsigned short edit_ushort(int y, int x, unsigned short val, char *help) unsigned short edit_ushort(int y, int x, unsigned short val, char *help)
{ {
unsigned short r; unsigned short r;
static char s[6]; static char s[7], line[7];
static char line[6];
showhelp(help); showhelp(help);
memset((char *)s, 0, 6); memset((char *)s, 0, sizeof(s));
do { do {
sprintf(line, "%d", val); sprintf(line, "%d", val);
strcpy(s, edit_field(y, x, 5, '9', line)); strcpy(s, edit_field(y, x, 5, '9', line));

View File

@ -39,6 +39,7 @@ securityrec edit_nsec(securityrec, char *);
char *get_secstr(securityrec); char *get_secstr(securityrec);
void show_int(int, int, int); void show_int(int, int, int);
int edit_int(int, int, int, char *); int edit_int(int, int, int, char *);
int edit_int_range(int, int, int, int, int, char *);
void show_ushort(int, int, unsigned short); void show_ushort(int, int, unsigned short);
unsigned short edit_ushort(int, int, unsigned short, char *); unsigned short edit_ushort(int, int, unsigned short, char *);
void show_sbit(int, int, unsigned short, unsigned short); void show_sbit(int, int, unsigned short, unsigned short);
@ -90,6 +91,7 @@ char *getmenutype(int);
#define E_JAM(y,x,l,str,help) strcpy(str, edit_jam(y,x,l,str,(char *)help)); break; #define E_JAM(y,x,l,str,help) strcpy(str, edit_jam(y,x,l,str,(char *)help)); break;
#define E_BOOL(y,x,bool,help) bool = edit_bool(y,x,bool,(char *)help); break; #define E_BOOL(y,x,bool,help) bool = edit_bool(y,x,bool,(char *)help); break;
#define E_INT(y,x,value,help) value = edit_int(y,x,value,(char *)help); break; #define E_INT(y,x,value,help) value = edit_int(y,x,value,(char *)help); break;
#define E_IRC(y,x,value,min,max,help) value = edit_int_range(y,x,value,min,max,(char *)help); break;
#define E_LOGL(grade,txt,af) grade = edit_logl(grade,(char *)txt); af(); break; #define E_LOGL(grade,txt,af) grade = edit_logl(grade,(char *)txt); af(); break;
#define S_COL(y,x,name,fg,bg) set_color(fg,bg); mvprintw(y,x,name); #define S_COL(y,x,name,fg,bg) set_color(fg,bg); mvprintw(y,x,name);
#define E_SEC(y,x,sec,hdr,af) sec = edit_sec(y,x,sec,(char *)hdr); af(); break; #define E_SEC(y,x,sec,hdr,af) sec = edit_sec(y,x,sec,(char *)hdr); af(); break;

View File

@ -477,6 +477,8 @@ void CloseArchive(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"archiver.data\""); Syslog('+', "Updated \"archiver.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -583,7 +585,7 @@ int EditArchRec(int Area)
fwrite(&archiver, sizeof(archiver), 1, fil); fwrite(&archiver, sizeof(archiver), 1, fil);
fclose(fil); fclose(fil);
ArchUpdated = 1; ArchUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -152,6 +152,8 @@ void CloseBBSlist(int force)
unlink(fout); unlink(fout);
chmod(fin, 0660); chmod(fin, 0660);
Syslog('+', "Updated \"bbslist.data\""); Syslog('+', "Updated \"bbslist.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -281,7 +283,7 @@ int EditBBSlistRec(int Area)
fwrite(&bbs, sizeof(bbs), 1, fil); fwrite(&bbs, sizeof(bbs), 1, fil);
fclose(fil); fclose(fil);
BBSlistUpdated = 1; BBSlistUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -184,6 +184,8 @@ void CloseDomain(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"domtrans.data\""); Syslog('+', "Updated \"domtrans.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -284,6 +286,7 @@ int EditDomainRec(int Area)
fwrite(&domtrans, domainhdr.recsize, 1, fil); fwrite(&domtrans, domainhdr.recsize, 1, fil);
fclose(fil); fclose(fil);
DomainUpdated = 1; DomainUpdated = 1;
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -167,6 +167,8 @@ void CloseFilearea(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"fareas.data\""); Syslog('+', "Updated \"fareas.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -325,6 +327,7 @@ int EditFileRec(int Area)
fclose(fil); fclose(fil);
FileUpdated = 1; FileUpdated = 1;
Syslog('+', "Updated file area %d", Area); Syslog('+', "Updated file area %d", Area);
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -259,6 +259,7 @@ void E_F(long areanr)
working(1, 0, 0); working(1, 0, 0);
fseek(fil, offset, SEEK_SET); fseek(fil, offset, SEEK_SET);
fwrite(&file, sizeof(file), 1, fil); fwrite(&file, sizeof(file), 1, fil);
working(6, 0, 0);
} }
} }
break; break;

View File

@ -174,6 +174,8 @@ void CloseFilefind(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"scanmgr.data\""); Syslog('+', "Updated \"scanmgr.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -293,6 +295,7 @@ int EditFfRec(int Area)
fwrite(&scanmgr, scanmgrhdr.recsize, 1, fil); fwrite(&scanmgr, scanmgrhdr.recsize, 1, fil);
fclose(fil); fclose(fil);
FilefindUpdated = 1; FilefindUpdated = 1;
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -203,6 +203,8 @@ void CloseFGroup(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"fgroups.data\""); Syslog('+', "Updated \"fgroups.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -400,7 +402,7 @@ int EditFGrpRec(int Area)
fwrite(&fgroup, sizeof(fgroup), 1, fil); fwrite(&fgroup, sizeof(fgroup), 1, fil);
fclose(fil); fclose(fil);
FGrpUpdated = 1; FGrpUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -194,6 +194,8 @@ void CloseFidonet(int force)
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"fidonet.data\""); Syslog('+', "Updated \"fidonet.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -309,7 +311,7 @@ int EditFidoRec(int Area)
fwrite(&fidonet, sizeof(fidonet), 1, fil); fwrite(&fidonet, sizeof(fidonet), 1, fil);
fclose(fil); fclose(fil);
FidoUpdated = 1; FidoUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");
@ -352,7 +354,7 @@ int EditFidoRec(int Area)
case 14: case 14:
case 15: case 15:
case 16: case 16:
case 17:E_INT(j,74, fidonet.zone[j-12], "A ^Zone number^ which belongs to this domain (1..4095)") case 17:E_IRC(j,74, fidonet.zone[j-12], 1, 32767, "A ^Zone number^ which belongs to this domain (1..32767)")
} }
} }

View File

@ -406,12 +406,12 @@ void e_bbsglob(void)
case 2: E_BOOL( 8,24, CFG.iConnectString, "Show ^connect string^ at logon") case 2: E_BOOL( 8,24, CFG.iConnectString, "Show ^connect string^ at logon")
case 3: E_BOOL( 9,24, CFG.iAskFileProtocols, "Ask ^file protocol^ before every up- download") case 3: E_BOOL( 9,24, CFG.iAskFileProtocols, "Ask ^file protocol^ before every up- download")
case 4: E_INT( 10,24, CFG.sysop_access, "Sysop ^access level^") case 4: E_INT( 10,24, CFG.sysop_access, "Sysop ^access level^")
case 5: E_INT( 11,24, CFG.password_length, "Mimimum ^password^ length.") case 5: E_IRC( 11,24, CFG.password_length, 2, 8, "Mimimum ^password^ length (2..8)")
case 6: E_INT( 12,24, CFG.iPasswd_Char, "Ascii number of ^password^ character") case 6: E_IRC( 12,24, CFG.iPasswd_Char, 33, 126, "Ascii number of ^password^ character (33..126)")
case 7: E_INT( 13,24, CFG.idleout, "^Idle timeout^ in minutes") case 7: E_IRC( 13,24, CFG.idleout, 2, 60, "^Idle timeout^ in minutes (2..60)")
case 8: E_INT( 14,24, CFG.iCRLoginCount, "Maximum ^Login Return^ count") case 8: E_INT( 14,24, CFG.iCRLoginCount, "Maximum ^Login Return^ count")
case 9: E_INT( 15,24, CFG.iQuota, "Maximum ^Quota^ in MBytes in users homedirectory"); case 9: E_INT( 15,24, CFG.iQuota, "Maximum ^Quota^ in MBytes in users homedirectory");
case 10:E_INT( 16,24, CFG.CityLen, "Minimum ^Location name^ length (3..6)") case 10:E_IRC( 16,24, CFG.CityLen, 3, 6, "Minimum ^Location name^ length (3..6)")
case 11:E_BOOL(17,24, CFG.NewAreas, "Show ^new^ or ^deleted^ message areas to the user at login.") case 11:E_BOOL(17,24, CFG.NewAreas, "Show ^new^ or ^deleted^ message areas to the user at login.")
case 12:E_INT( 7,59, CFG.OLR_MaxMsgs, "^Maximum messages^ to pack for download (0=unlimited)") case 12:E_INT( 7,59, CFG.OLR_MaxMsgs, "^Maximum messages^ to pack for download (0=unlimited)")
@ -422,7 +422,7 @@ void e_bbsglob(void)
case 17:E_BOOL(12,59, CFG.slow_util, "Let background utilities run ^slowly^") case 17:E_BOOL(12,59, CFG.slow_util, "Let background utilities run ^slowly^")
case 18:E_INT( 13,59, CFG.iCrashLevel, "The user level to allow sending ^CrashMail^") case 18:E_INT( 13,59, CFG.iCrashLevel, "The user level to allow sending ^CrashMail^")
case 19:E_INT( 14,59, CFG.iAttachLevel, "The user level to allow sending ^File Attaches^") case 19:E_INT( 14,59, CFG.iAttachLevel, "The user level to allow sending ^File Attaches^")
case 20:E_INT( 15,59, CFG.freespace, "Minimum ^free diskspace^ in MBytes on filesystems") case 20:E_IRC( 15,59, CFG.freespace, 2, 1000, "Minimum ^free diskspace^ in MBytes on filesystems (2..1000)")
case 21:E_INT( 16,59, CFG.max_logins, "Maximum ^simultaneous logins^ allowed, 0 means unlimited") case 21:E_INT( 16,59, CFG.max_logins, "Maximum ^simultaneous logins^ allowed, 0 means unlimited")
} }
} }
@ -582,8 +582,8 @@ void e_paging(void)
switch(select_menu(7)) { switch(select_menu(7)) {
case 0: return; case 0: return;
case 1: E_INT( 7,20, CFG.iPageLength, "The ^Length^ of paging in seconds") case 1: E_IRC( 7,20, CFG.iPageLength, 5, 120, "The ^Length^ of paging in seconds (5..120)")
case 2: E_INT( 8,20, CFG.iMaxPageTimes, "The ^Maximum times^ a user may page in a session") case 2: E_IRC( 8,20, CFG.iMaxPageTimes, 1, 10, "The ^Maximum times^ a user may page in a session (1..10)")
case 3: E_INT( 9,20, CFG.iSysopArea, "The ^Message Area^ for ^Message to sysop^ when page fails") case 3: E_INT( 9,20, CFG.iSysopArea, "The ^Message Area^ for ^Message to sysop^ when page fails")
case 4: E_BOOL(10,20, CFG.iAskReason, "Ask the user the ^reason for chat^") case 4: E_BOOL(10,20, CFG.iAskReason, "Ask the user the ^reason for chat^")
case 5: E_BOOL(11,20, CFG.iAutoLog, "^Automatic log^ chat sessions") case 5: E_BOOL(11,20, CFG.iAutoLog, "^Automatic log^ chat sessions")
@ -854,8 +854,8 @@ void e_fidomailcfg(void)
} }
break; break;
case 13:E_BOOL(12,58, CFG.addr4d, "Use ^4d^ addressing instead of ^5d^ addressing.") case 13:E_BOOL(12,58, CFG.addr4d, "Use ^4d^ addressing instead of ^5d^ addressing.")
case 14:E_INT( 13,58, CFG.new_split, "Gently ^split^ newfiles reports after n kilobytes (12..60).") case 14:E_IRC( 13,58, CFG.new_split, 12, 60, "Gently ^split^ newfiles reports after n kilobytes (12..60).")
case 15:E_INT( 14,58, CFG.new_force, "Force ^split^ of newfiles reports after n kilobytes (16..64).") case 15:E_IRC( 14,58, CFG.new_force, 16, 64, "Force ^split^ of newfiles reports after n kilobytes (16..64).")
case 16:E_BOOL(15,58, CFG.ca_PlusAll, "Allow ^+%*^ (Plus all) in AreaMgr requests.") case 16:E_BOOL(15,58, CFG.ca_PlusAll, "Allow ^+%*^ (Plus all) in AreaMgr requests.")
case 17:E_BOOL(16,58, CFG.ca_Notify, "Allow turning ^Notify^ messages on or off.") case 17:E_BOOL(16,58, CFG.ca_Notify, "Allow turning ^Notify^ messages on or off.")
case 18:E_BOOL(17,58, CFG.ca_Passwd, "Allow changing the AreaMgr/FileMgr ^password^.") case 18:E_BOOL(17,58, CFG.ca_Passwd, "Allow changing the AreaMgr/FileMgr ^password^.")
@ -959,10 +959,10 @@ void e_uucp(void)
j = select_menu(5); j = select_menu(5);
switch(j) { switch(j) {
case 0: return; case 0: return;
case 1: E_INT( 7,19, CFG.UUCPgate.zone, "The ^zone^ number for the UUCP gateway") case 1: E_IRC( 7,19, CFG.UUCPgate.zone, 1, 32767, "The ^zone^ number for the UUCP gateway (1..32767)")
case 2: E_INT( 8,19, CFG.UUCPgate.net, "The ^Net^ number for the UUCP gateway") case 2: E_IRC( 8,19, CFG.UUCPgate.net, 0, 32767, "The ^Net^ number for the UUCP gateway (0..32767)")
case 3: E_INT( 9,19, CFG.UUCPgate.node, "The ^Node^ number for the UUCP gateway") case 3: E_IRC( 9,19, CFG.UUCPgate.node, 0, 32767, "The ^Node^ number for the UUCP gateway (0..32767)")
case 4: E_INT( 10,19, CFG.UUCPgate.point, "The ^Point^ number for the UUCP gateway") case 4: E_IRC( 10,19, CFG.UUCPgate.point, 0, 32767, "The ^Point^ number for the UUCP gateway (0..32767)")
case 5: E_STR( 11,19,8, CFG.UUCPgate.domain, "The ^FTN Domain^ for the UUCP gateway without a dot") case 5: E_STR( 11,19,8, CFG.UUCPgate.domain, "The ^FTN Domain^ for the UUCP gateway without a dot")
} }
} }
@ -1010,8 +1010,8 @@ void e_intmailcfg(void)
case 13:CFG.newsfeed = edit_newsmode(13,57, CFG.newsfeed); case 13:CFG.newsfeed = edit_newsmode(13,57, CFG.newsfeed);
s_intmailcfg(); s_intmailcfg();
break; break;
case 14:E_INT( 14,57, CFG.new_split, "Gently ^split^ messages after n kilobytes (12..60).") case 14:E_IRC( 14,57, CFG.new_split, 12, 60, "Gently ^split^ messages after n kilobytes (12..60).")
case 15:E_INT( 15,57, CFG.new_force, "Force ^split^ of messages after n kilobytes (16..64).") case 15:E_IRC( 15,57, CFG.new_force, 16, 64, "Force ^split^ of messages after n kilobytes (16..64).")
case 16:E_BOOL(16,57, CFG.allowcontrol, "^Allow control^ messages for news to be gated.") case 16:E_BOOL(16,57, CFG.allowcontrol, "^Allow control^ messages for news to be gated.")
case 17:E_BOOL(17,57, CFG.dontregate, "Don't ^regate^ already gated messages.") case 17:E_BOOL(17,57, CFG.dontregate, "Don't ^regate^ already gated messages.")
} }
@ -1095,10 +1095,10 @@ void e_aka(int Area)
j = select_menu(6); j = select_menu(6);
switch(j) { switch(j) {
case 0: return; case 0: return;
case 1: E_INT( 7,19, CFG.aka[Area].zone, "The ^zone^ number for this aka") case 1: E_IRC( 7,19, CFG.aka[Area].zone, 0, 32767, "The ^zone^ number for this aka (1..32767)")
case 2: E_INT( 8,19, CFG.aka[Area].net, "The ^Net^ number for this aka") case 2: E_IRC( 8,19, CFG.aka[Area].net, 0, 32767, "The ^Net^ number for this aka (0..32767)")
case 3: E_INT( 9,19, CFG.aka[Area].node, "The ^Node^ number for this aka") case 3: E_IRC( 9,19, CFG.aka[Area].node, 0, 32767, "The ^Node^ number for this aka (0..32767)")
case 4: E_INT( 10,19, CFG.aka[Area].point, "The ^Point^ number for this node (if any)") case 4: E_IRC( 10,19, CFG.aka[Area].point, 0, 32767, "The ^Point^ number for this node (0..32767)")
case 5: E_STR( 11,19,8, CFG.aka[Area].domain, "The ^FTN Domain^ for this aka without a dot (ie no .org)") case 5: E_STR( 11,19,8, CFG.aka[Area].domain, "The ^FTN Domain^ for this aka without a dot (ie no .org)")
case 6: E_BOOL(12,19, CFG.akavalid[Area], "Is this aka ^available^") case 6: E_BOOL(12,19, CFG.akavalid[Area], "Is this aka ^available^")
} }
@ -1165,6 +1165,14 @@ void e_fidoakas(void)
if (error) if (error)
errmsg("All aka's must be in one continues block"); errmsg("All aka's must be in one continues block");
} }
if (error == FALSE) {
for (j = 0; j < 40; j++) {
if (CFG.akavalid[j] && CFG.aka[j].zone && (strlen(CFG.aka[j].domain) == 0)) {
error = TRUE;
errmsg("Aka %d has no domain set", j+1);
}
}
}
if (! error) if (! error)
return; return;
} }
@ -1460,6 +1468,7 @@ void global_menu(void)
if (yes_no((char *)"Configuration is changed, save") == 1) { if (yes_no((char *)"Configuration is changed, save") == 1) {
cf_close(); cf_close();
Syslog('+', "Saved main config"); Syslog('+', "Saved main config");
working(6, 0, 0);
} }
} }
open_bbs(); open_bbs();

View File

@ -189,6 +189,8 @@ void CloseHatch(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"hatch.data\""); Syslog('+', "Updated \"hatch.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -427,6 +429,7 @@ int EditHatchRec(int Area)
fwrite(&hatch, hatchhdr.recsize, 1, fil); fwrite(&hatch, hatchhdr.recsize, 1, fil);
fclose(fil); fclose(fil);
HatchUpdated = 1; HatchUpdated = 1;
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -244,6 +244,8 @@ void CloseLanguage(int force)
tidy_stlist(&lan); tidy_stlist(&lan);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"language.data\""); Syslog('+', "Updated \"language.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -352,7 +354,7 @@ int EditLangRec(int Area)
fwrite(&lang, sizeof(lang), 1, fil); fwrite(&lang, sizeof(lang), 1, fil);
fclose(fil); fclose(fil);
LangUpdated = 1; LangUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -236,6 +236,8 @@ void CloseLimits(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"limits.data\""); Syslog('+', "Updated \"limits.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -332,7 +334,7 @@ int EditLimRec(int Area)
fwrite(&LIMIT, sizeof(LIMIT), 1, fil); fwrite(&LIMIT, sizeof(LIMIT), 1, fil);
fclose(fil); fclose(fil);
LimUpdated = 1; LimUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -180,6 +180,8 @@ void CloseMagics(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"magic.data\""); Syslog('+', "Updated \"magic.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -342,6 +344,7 @@ int EditMagicRec(int Area)
fwrite(&magic, sizeof(magic), 1, fil); fwrite(&magic, sizeof(magic), 1, fil);
fclose(fil); fclose(fil);
MagicUpdated = 1; MagicUpdated = 1;
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -282,6 +282,8 @@ void CloseMsgarea(int Force)
unlink(fout); unlink(fout);
chmod(fin, 0660); chmod(fin, 0660);
Syslog('+', "Updated \"mareas.data\""); Syslog('+', "Updated \"mareas.data\"");
if (!Force)
working(6, 0, 0);
return; return;
} }
} }
@ -1090,6 +1092,7 @@ int EditMsgRec(int Area)
return -1; return -1;
MsgUpdated = 1; MsgUpdated = 1;
Syslog('+', "Saved message area record %d", Area); Syslog('+', "Saved message area record %d", Area);
working(6, 0, 0);
} }
} }
if (tfil != NULL) if (tfil != NULL)

View File

@ -394,6 +394,7 @@ void EditMenu(char *Name)
} }
fclose(fil); fclose(fil);
chmod(temp, 0640); chmod(temp, 0640);
working(6, 0, 0);
} }
} }
} }
@ -485,6 +486,7 @@ void EditMenu(char *Name)
fseek(tmp, offset, SEEK_SET); fseek(tmp, offset, SEEK_SET);
fwrite(&menus, sizeof(menus), 1, tmp); fwrite(&menus, sizeof(menus), 1, tmp);
MenuUpdated = TRUE; MenuUpdated = TRUE;
working(6, 0, 0);
} }
} }
} }
@ -564,6 +566,7 @@ void EditMenus(void)
fclose(fil); fclose(fil);
chmod(p, 0640); chmod(p, 0640);
Syslog('+', "Created menufile %s", p); Syslog('+', "Created menufile %s", p);
working(3, 0, 0);
} }
} else { } else {
errmsg("Menu %s already exists", temp); errmsg("Menu %s already exists", temp);

View File

@ -209,6 +209,8 @@ void CloseMGroup(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"mgroups.data\""); Syslog('+', "Updated \"mgroups.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -366,7 +368,7 @@ int EditMGrpRec(int Area)
fwrite(&mgroup, sizeof(mgroup), 1, fil); fwrite(&mgroup, sizeof(mgroup), 1, fil);
fclose(fil); fclose(fil);
MGrpUpdated = 1; MGrpUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -251,6 +251,8 @@ void CloseModem(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"modem.data\""); Syslog('+', "Updated \"modem.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -464,7 +466,7 @@ int EditModemRec(int Area)
fwrite(&modem, sizeof(modem), 1, fil); fwrite(&modem, sizeof(modem), 1, fil);
fclose(fil); fclose(fil);
ModemUpdated = 1; ModemUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");
@ -478,7 +480,7 @@ int EditModemRec(int Area)
case 7: E_STR(13,14,40, modem.dial, "The ^dial^ command for this modem, ^\\T^ is translated phonenumber") case 7: E_STR(13,14,40, modem.dial, "The ^dial^ command for this modem, ^\\T^ is translated phonenumber")
case 8: E_STR(14,14,40, modem.info, "The command to get connection ^info^ from this modem after call") case 8: E_STR(14,14,40, modem.info, "The command to get connection ^info^ from this modem after call")
case 9: E_STR(15,14,10, modem.ok, "The ^OK^ string to get from the modem") case 9: E_STR(15,14,10, modem.ok, "The ^OK^ string to get from the modem")
case 10:E_INT(16,14, modem.costoffset, "The ^offset^ time in seconds between answer and connect string") case 10:E_IRC(16,14, modem.costoffset, 0, 60, "The ^offset^ time in seconds between answer and connect string (0..60)")
case 11:E_STR(17,14,15, modem.speed, "The ^EMSI speed^ message for this modem") case 11:E_STR(17,14,15, modem.speed, "The ^EMSI speed^ message for this modem")
case 12:E_BOOL(15,44, modem.available, "If this modem is ^available^") case 12:E_BOOL(15,44, modem.available, "If this modem is ^available^")
case 13:E_BOOL(16,44, modem.deleted, "If this modem is to be ^deleted^ from the setup") case 13:E_BOOL(16,44, modem.deleted, "If this modem is to be ^deleted^ from the setup")

View File

@ -226,6 +226,8 @@ void CloseNewfiles(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"newfiles.data\""); Syslog('+', "Updated \"newfiles.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -399,6 +401,7 @@ int EditNewRec(int Area)
fclose(fil); fclose(fil);
NewUpdated = 1; NewUpdated = 1;
working(6, 0, 0);
} }
} }
tidy_grlist(&fgr); tidy_grlist(&fgr);

View File

@ -189,6 +189,8 @@ void CloseNGroup(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"ngroups.data\""); Syslog('+', "Updated \"ngroups.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -287,7 +289,7 @@ int EditNGrpRec(int Area)
fwrite(&ngroup, sizeof(ngroup), 1, fil); fwrite(&ngroup, sizeof(ngroup), 1, fil);
fclose(fil); fclose(fil);
NGrpUpdated = 1; NGrpUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -265,6 +265,7 @@ void CloseNoderec(int Force)
free(fout); free(fout);
Syslog('+', "Updated \"nodes.data\""); Syslog('+', "Updated \"nodes.data\"");
CreateSema((char *)"scanout"); CreateSema((char *)"scanout");
working(6, 0, 0);
return; return;
} }
} }
@ -303,6 +304,7 @@ int AppendNoderec(void)
nodes.StartDate = time(NULL); nodes.StartDate = time(NULL);
nodes.Security.level = 1; nodes.Security.level = 1;
nodes.Security.flags = 1; nodes.Security.flags = 1;
nodes.Language = 'E';
fwrite(&nodes, sizeof(nodes), 1, fil); fwrite(&nodes, sizeof(nodes), 1, fil);
memset(&group, 0, 13); memset(&group, 0, 13);
for (i = 1; i <= CFG.tic_groups; i++) for (i = 1; i <= CFG.tic_groups; i++)
@ -576,7 +578,7 @@ fidoaddr e_a(fidoaddr n, int x)
switch(select_menu(4)) { switch(select_menu(4)) {
case 0: return n; case 0: return n;
case 1: n.zone = edit_int(7, 17, n.zone, (char *)"The ^zone^ number 1..4095"); case 1: n.zone = edit_int_range(7, 17, n.zone, 1, 4095, (char *)"The ^zone^ number 1..4095");
sprintf(temp, "%s/etc/fidonet.data", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/fidonet.data", getenv("MBSE_ROOT"));
if ((fil = fopen(temp, "r")) != NULL) { if ((fil = fopen(temp, "r")) != NULL) {
fread(&fidonethdr, sizeof(fidonethdr), 1, fil); fread(&fidonethdr, sizeof(fidonethdr), 1, fil);
@ -594,9 +596,9 @@ fidoaddr e_a(fidoaddr n, int x)
fclose(fil); fclose(fil);
} }
break; break;
case 2: E_INT( 8,17,n.net, "The ^net^ number 1..65535") case 2: E_IRC( 8,17,n.net, 1, 32767, "The ^net^ number 1..32767")
case 3: E_INT( 9,17,n.node, "The ^node^ number 1..65535") case 3: E_IRC( 9,17,n.node, 0, 32767, "The ^node^ number 0..32767")
case 4: E_INT(10,17,n.point,"The ^point^ number 0..65535") case 4: E_IRC(10,17,n.point, 0, 32767, "The ^point^ number 0..32767")
} }
} }
} }
@ -1143,6 +1145,7 @@ int EditNodeRec(int Area)
fclose(fil); fclose(fil);
NodeUpdated = 1; NodeUpdated = 1;
working(6, 0, 0);
} }
} }
tidy_grlist(&egr); tidy_grlist(&egr);

View File

@ -183,6 +183,8 @@ void CloseOneline(int force)
unlink(fout); unlink(fout);
chmod(fin, 0660); chmod(fin, 0660);
Syslog('+', "Updated \"oneline.data\""); Syslog('+', "Updated \"oneline.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -273,7 +275,7 @@ int EditOnelRec(int Area)
fwrite(&ol, sizeof(ol), 1, fil); fwrite(&ol, sizeof(ol), 1, fil);
fclose(fil); fclose(fil);
OnelUpdated = 1; OnelUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -234,6 +234,8 @@ void CloseProtocol(int force)
chmod(fin, 0640); chmod(fin, 0640);
tidy_stlist(&pro); tidy_stlist(&pro);
Syslog('+', "Updated \"protocol.data\""); Syslog('+', "Updated \"protocol.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -347,7 +349,7 @@ int EditProtRec(int Area)
fwrite(&PROT, sizeof(PROT), 1, fil); fwrite(&PROT, sizeof(PROT), 1, fil);
fclose(fil); fclose(fil);
ProtUpdated = 1; ProtUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -189,11 +189,12 @@ void CloseRoute(int force)
Syslog('+', "Updated \"route.data\""); Syslog('+', "Updated \"route.data\"");
free(fin); free(fin);
free(fout); free(fout);
if (!force)
working(6, 0, 0);
return; return;
} }
} }
chmod(fin, 0640); chmod(fin, 0640);
working(1, 0, 0);
unlink(fout); unlink(fout);
free(fin); free(fin);
free(fout); free(fout);
@ -369,6 +370,7 @@ int EditRouteRec(int Area)
fwrite(&route, routehdr.recsize, 1, fil); fwrite(&route, routehdr.recsize, 1, fil);
fclose(fil); fclose(fil);
RouteUpdated = 1; RouteUpdated = 1;
working(6, 0, 0);
} }
} }
free(mfile); free(mfile);

View File

@ -193,6 +193,8 @@ void CloseService(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"servrec.data\""); Syslog('+', "Updated \"servrec.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -293,6 +295,7 @@ int EditServiceRec(int Area)
fwrite(&servrec, servhdr.recsize, 1, fil); fwrite(&servrec, servhdr.recsize, 1, fil);
fclose(fil); fclose(fil);
ServiceUpdated = 1; ServiceUpdated = 1;
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -88,9 +88,9 @@ void CloseTask(void)
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"task.data\""); Syslog('+', "Updated \"task.data\"");
} }
working(6, 0, 0);
} }
} }
working(1, 0, 0);
} }

View File

@ -255,6 +255,8 @@ void CloseTtyinfo(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"ttyinfo.data\""); Syslog('+', "Updated \"ttyinfo.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -372,7 +374,7 @@ int EditTtyRec(int Area)
fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil); fwrite(&ttyinfo, sizeof(ttyinfo), 1, fil);
fclose(fil); fclose(fil);
TtyUpdated = 1; TtyUpdated = 1;
working(1, 0, 0); working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -164,6 +164,8 @@ void CloseUsers(int force)
unlink(fout); unlink(fout);
chmod(fin, 0660); chmod(fin, 0660);
Syslog('+', "Updated \"users.data\""); Syslog('+', "Updated \"users.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -481,6 +483,7 @@ int EditUsrRec(int Area)
fwrite(&usrconfig, sizeof(usrconfig), 1, fil); fwrite(&usrconfig, sizeof(usrconfig), 1, fil);
fclose(fil); fclose(fil);
UsrUpdated = 1; UsrUpdated = 1;
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -211,6 +211,8 @@ void CloseVirus(int force)
unlink(fout); unlink(fout);
chmod(fin, 0640); chmod(fin, 0640);
Syslog('+', "Updated \"virscan.data\""); Syslog('+', "Updated \"virscan.data\"");
if (!force)
working(6, 0, 0);
return; return;
} }
} }
@ -304,6 +306,7 @@ int EditVirRec(int Area)
fwrite(&virscan, sizeof(virscan), 1, fil); fwrite(&virscan, sizeof(virscan), 1, fil);
fclose(fil); fclose(fil);
VirUpdated = 1; VirUpdated = 1;
working(6, 0, 0);
} }
} }
IsDoing("Browsing Menu"); IsDoing("Browsing Menu");

View File

@ -243,6 +243,11 @@ void working(int txno, int y, int x)
break; break;
case 5: mvprintw(4, 66, (char *)"Moving . . . "); case 5: mvprintw(4, 66, (char *)"Moving . . . ");
break; break;
case 6: mvprintw(4, 66, (char *)"Data updated ");
fputc(7, stdout);
fflush(stdout);
sleep(1);
break;
} }
show_date(LIGHTGRAY, BLACK, 0, 0); show_date(LIGHTGRAY, BLACK, 0, 0);