Changes to the system aka editor

This commit is contained in:
Michiel Broek 2002-06-17 19:53:22 +00:00
parent f947ba80f5
commit 3cc5a6fa3a
11 changed files with 182 additions and 64 deletions

View File

@ -4,6 +4,10 @@ $Id$
v0.35.01 05-Jun-2002 v0.35.01 05-Jun-2002
upgrade:
Start mbsetup, check in the nodes setup if all the session
passwords are ok.
general: general:
Added structures for netmail routing file. Added structures for netmail routing file.
Expanded nodes structures for FTP and Directory transfers. Expanded nodes structures for FTP and Directory transfers.
@ -31,6 +35,10 @@ v0.35.01 05-Jun-2002
Fixed a problem with the calculated filetransfer speed with Fixed a problem with the calculated filetransfer speed with
large files on fast connections. large files on fast connections.
mbfido:
When creating uplink area requests the from aka used is now
the aka defined in the group.
mbfile: mbfile:
Added -v commandline switch to supress virus checking for the Added -v commandline switch to supress virus checking for the
adopt and import commands. Use with great care. adopt and import commands. Use with great care.
@ -45,6 +53,8 @@ v0.35.01 05-Jun-2002
in the setup and enabled. Others are shown there with default in the setup and enabled. Others are shown there with default
paths but are disabled, they can be used as examples. paths but are disabled, they can be used as examples.
Fixed crashing mbsetup in menus 10.3.2, 10.4.5 and 10.4.6. Fixed crashing mbsetup in menus 10.3.2, 10.4.5 and 10.4.6.
Menu 1.1 system aka's now has the option to move aka's to
other positions. Added some check's on the main aka's.
v0.33.21 04-Jun-2002 v0.33.21 04-Jun-2002

9
README
View File

@ -1,3 +1,5 @@
$Id$
MBSE BBS Packages. MBSE BBS Packages.
@ -13,4 +15,11 @@ mbsebbs-0.33.18.tar.gz
For fidonet distribution, the tar archive and FILE_ID.DIZ are For fidonet distribution, the tar archive and FILE_ID.DIZ are
zipped together in a file like mbb03318.zip zipped together in a file like mbb03318.zip
The odd minor version numbers are developent versions only. From 0.35.1 and up
these will not be released anymore but are only available via cvs.
The even minor version numbers will be stable releases, they will be available
at http://mbse.sourceforge.net and at 2:280/2802. The first version using this
scheme is 0.36.1

5
TODO
View File

@ -42,6 +42,9 @@ mbfido:
U: Code cleanup and make a structure in this program. Remove duplicate U: Code cleanup and make a structure in this program. Remove duplicate
or similar functions. or similar functions.
U: AreaMgr uplink mails use the default best aka instead of the aka
defined in that specific group.
N: Remove memory leak during toss. (It's ok for less 5000 messages for N: Remove memory leak during toss. (It's ok for less 5000 messages for
each run). each run).
@ -115,7 +118,7 @@ mbnewusr:
mbsetup: mbsetup:
U: PickAka function lets mbsetup crash if domain is 12 characters U: PickAka function lets mbsetup crash if domain is 12 characters
U: 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
main aka with zone's is listed first. Having zone's mixed gives main aka with zone's is listed first. Having zone's mixed gives
too high outbound stats and the outbound is scanned multiple times. too high outbound stats and the outbound is scanned multiple times.

View File

@ -12,7 +12,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 16-May-2002</h5> <h5>Last update 17-Jun-2002</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<H1>MBSE BBS Setup - Global Setup</H1> <H1>MBSE BBS Setup - Global Setup</H1>
@ -24,7 +24,9 @@ be discussed below.
<h3>1.1. Fidonet Aka's.</h3> <h3>1.1. Fidonet Aka's.</h3>
<p> <p>
Here you can enter 40 fidonet addresses. These are 5d addresses. Here you can enter 40 fidonet addresses. These are 5d addresses. Make sure you
group the different zone's together, strange things will happen if you don't
group them.
<p> <p>
<h3>1.2. Edit Registration Info.</H3> <h3>1.2. Edit Registration Info.</H3>

View File

@ -188,7 +188,7 @@ int CheckTicGroup(char *Area, int SendUplink, faddr *f)
*/ */
if (SendUplink) { if (SendUplink) {
sprintf(temp, "+%s", Area); sprintf(temp, "+%s", Area);
if (UplinkRequest(fido2faddr(fgroup.UpLink), TRUE, temp)) { if (UplinkRequest(fido2faddr(fgroup.UpLink), fido2faddr(fgroup.UseAka), TRUE, temp)) {
WriteError("Can't send netmail to uplink"); WriteError("Can't send netmail to uplink");
fclose(ap); fclose(ap);
free(buf); free(buf);

View File

@ -121,7 +121,7 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f)
*/ */
if (SendUplink) { if (SendUplink) {
sprintf(temp, "+%s", Area); sprintf(temp, "+%s", Area);
if (UplinkRequest(fido2faddr(mgroup.UpLink), FALSE, temp)) { if (UplinkRequest(fido2faddr(mgroup.UpLink), fido2faddr(mgroup.UseAka), FALSE, temp)) {
WriteError("Can't send netmail to uplink"); WriteError("Can't send netmail to uplink");
fclose(ap); fclose(ap);
free(buf); free(buf);

View File

@ -296,24 +296,22 @@ void MgrNotify(faddr *t, char *Buf, FILE *tmp, int mgr)
* 3 - No uplink password in setup * 3 - No uplink password in setup
* 4 - Can't add mail to outbound * 4 - Can't add mail to outbound
*/ */
int UplinkRequest(faddr *t, int FileMgr, char *cmd) int UplinkRequest(faddr *t, faddr *From, int FileMgr, char *cmd)
{ {
FILE *qp; FILE *qp;
time_t Now; time_t Now;
struct tm *tm; struct tm *tm;
fidoaddr Orig, Dest; fidoaddr Orig, Dest;
faddr From;
unsigned flags = M_PVT; unsigned flags = M_PVT;
char ext[4], *mgrname, *subj; char ext[4], *mgrname, *subj;
int i; int i;
From = *bestaka_s(t);
memset(&Orig, 0, sizeof(Orig)); memset(&Orig, 0, sizeof(Orig));
Orig.zone = From.zone; Orig.zone = From->zone;
Orig.net = From.net; Orig.net = From->net;
Orig.node = From.node; Orig.node = From->node;
Orig.point = From.point; Orig.point = From->point;
sprintf(Orig.domain, "%s", From.domain); sprintf(Orig.domain, "%s", From->domain);
memset(&Dest, 0, sizeof(Dest)); memset(&Dest, 0, sizeof(Dest));
Dest.zone = t->zone; Dest.zone = t->zone;
@ -373,7 +371,7 @@ int UplinkRequest(faddr *t, int FileMgr, char *cmd)
if ((qp = OpenPkt(Orig, Dest, (char *)ext)) == NULL) if ((qp = OpenPkt(Orig, Dest, (char *)ext)) == NULL)
return 4; return 4;
if (AddMsgHdr(qp, &From, t, flags, 0, Now, mgrname, CFG.sysop_name, subj)) { if (AddMsgHdr(qp, From, t, flags, 0, Now, mgrname, CFG.sysop_name, subj)) {
fclose(qp); fclose(qp);
return 4; return 4;
} }
@ -687,7 +685,7 @@ int Areas(void)
* Sent one uplink command with additions and deletions * Sent one uplink command with additions and deletions
*/ */
if (mgroup.UpLink.zone) { if (mgroup.UpLink.zone) {
if (UplinkRequest(fido2faddr(mgroup.UpLink), FALSE, cmd)) { if (UplinkRequest(fido2faddr(mgroup.UpLink), fido2faddr(mgroup.UseAka), FALSE, cmd)) {
WriteError("Uplink request failed"); WriteError("Uplink request failed");
} else { } else {
Syslog('+', "AreaMgr request sent to %s", aka2str(mgroup.UpLink)); Syslog('+', "AreaMgr request sent to %s", aka2str(mgroup.UpLink));
@ -941,7 +939,7 @@ int Areas(void)
* Sent one uplink command with additions and deletions * Sent one uplink command with additions and deletions
*/ */
if (fgroup.UpLink.zone) { if (fgroup.UpLink.zone) {
if (UplinkRequest(fido2faddr(fgroup.UpLink), TRUE, cmd)) { if (UplinkRequest(fido2faddr(fgroup.UpLink), fido2faddr(fgroup.UseAka), TRUE, cmd)) {
WriteError("Uplink request failed"); WriteError("Uplink request failed");
} else { } else {
Syslog('+', "AreaMgr request sent to %s", aka2str(fgroup.UpLink)); Syslog('+', "AreaMgr request sent to %s", aka2str(fgroup.UpLink));

View File

@ -25,7 +25,7 @@ void CleanBuf(char *);
void ShiftBuf(char *, int); void ShiftBuf(char *, int);
void MgrPasswd(faddr *, char *, FILE *, int, int); void MgrPasswd(faddr *, char *, FILE *, int, int);
void MgrNotify(faddr *, char *, FILE *, int); void MgrNotify(faddr *, char *, FILE *, int);
int UplinkRequest(faddr *, int, char *); int UplinkRequest(faddr *, faddr *, int, char *);
int Areas(void); int Areas(void);

View File

@ -584,6 +584,53 @@ char *select_pick(int max, int items)
char *select_aka(int max, int items)
{
static char s[12];
static char *menu=(char *)"-";
char help[81];
int pick;
memset((char *)s, 0, 12);
if (max == 0)
sprintf(help, "Select ^\"-\"^ for previous level");
else
if (max > items)
sprintf(help, "Record (1..%d), ^\"-\"^ prev. level, ^\"P\" or \"N\"^ to page, ^\"M\"^ move aka", max);
else
sprintf(help, "Select record (1..%d), ^\"-\"^ for previous level ^\"M\"^ move aka", max);
showhelp(help);
/*
* Loop until the answer is right
*/
for (;;) {
mvprintw(LINES - 3, 6, "Enter your choice >");
menu = (char *)"-";
menu = edit_field(LINES - 3, 26, 6, '!', menu);
locate(LINES - 3, 6);
clrtoeol();
if (strncmp(menu, "-", 1) == 0)
break;
if (max > items) {
if (strncmp(menu, "N", 1) == 0)
break;
if (strncmp(menu, "P", 1) == 0)
break;
}
if (strncmp(menu, "M", 1) == 0)
break;
pick = atoi(menu);
if ((pick >= 1) && (pick <= max))
break;
}
return menu;
}
/* /*
* Select menu, max is the highest item to pick. Returns zero if * Select menu, max is the highest item to pick. Returns zero if

View File

@ -14,6 +14,7 @@ char *select_record(int, int);
char *select_filearea(int, int); char *select_filearea(int, int);
char *select_area(int, int); char *select_area(int, int);
char *select_pick(int, int); char *select_pick(int, int);
char *select_aka(int, int);
char *select_show(int); char *select_show(int);
int select_menu(int); int select_menu(int);
int select_tag(int); int select_tag(int);

View File

@ -1187,11 +1187,10 @@ void e_aka(int Area)
void e_fidoakas(void) void e_fidoakas(void)
{ {
int i, x, y, o; int i, j, k, x, y, o = 0, error, from, too;
char pick[12]; char pick[12];
char temp[121]; char temp[121];
o = 0;
for (;;) { for (;;) {
clr_index(); clr_index();
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
@ -1219,9 +1218,32 @@ void e_fidoakas(void)
y++; y++;
} }
} }
strcpy(pick, select_pick(40, 20)); strcpy(pick, select_aka(40, 20));
if (strncmp(pick, "-", 1) == 0) { if (strncmp(pick, "-", 1) == 0) {
error = FALSE;
/*
* Various checks on the system aka's.
*/
if ((! CFG.aka[0].zone) && (! CFG.akavalid[0])) {
errmsg("First aka (main aka) must be valid");
error = TRUE;
}
if (error == FALSE) {
/*
* Check if aka's are in one continues block
*/
k = 0;
for (j = 0; j < 40; j++)
if (CFG.akavalid[j] && CFG.aka[j].zone)
k++;
for (j = k; j < 40; j++)
if (CFG.akavalid[j] || CFG.aka[j].zone)
error = TRUE;
if (error)
errmsg("All aka's must be in one continues block");
}
if (! error)
return; return;
} }
@ -1233,6 +1255,32 @@ void e_fidoakas(void)
if ((o - 20) >= 0) if ((o - 20) >= 0)
o = o - 20; o = o - 20;
if (strncmp(pick, "M", 1) == 0) {
from = too = 0;
mvprintw(LINES -3, 6, "Enter aka number (1..40) to move >");
from = edit_int(LINES -3, 42, from, (char *)"Enter record number");
locate(LINES -3, 6);
clrtoeol();
mvprintw(LINES -3, 6, "Enter new position (1..40) >");
too = edit_int(LINES -3, 36, too, (char *)"Enter destination record number");
if ((from == too) || (from == 0) || (too == 0) || (from > 40) || (too > 40)) {
errmsg("That makes no sense");
} else if (CFG.akavalid[from - 1] == FALSE) {
errmsg("Origin aka is invalid");
} else if (CFG.akavalid[too - 1]) {
errmsg("Destination record is in use");
} else if (yes_no((char *)"Proceed move")) {
CFG.aka[too -1].zone = CFG.aka[from -1].zone;
CFG.aka[too -1].net = CFG.aka[from -1].net;
CFG.aka[too -1].node = CFG.aka[from -1].node;
CFG.aka[too -1].point = CFG.aka[from -1].point;
strcpy(CFG.aka[too -1].domain, CFG.aka[from -1].domain);
CFG.akavalid[too -1] = TRUE;
CFG.akavalid[from -1] = FALSE;
memset(&CFG.aka[from -1], 0, sizeof(fidoaddr));
}
}
if ((atoi(pick) >= 1) && (atoi(pick) <= 40)) if ((atoi(pick) >= 1) && (atoi(pick) <= 40))
e_aka(atoi(pick)-1); e_aka(atoi(pick)-1);
} }