Added setup for character sets
This commit is contained in:
parent
f7070bee91
commit
022bd58797
13
ChangeLog
13
ChangeLog
@ -3,11 +3,24 @@ $Id$
|
|||||||
|
|
||||||
v0.51.1 21-Feb-2004
|
v0.51.1 21-Feb-2004
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
In all message groups set check/set default character set.
|
||||||
|
In all message areas set the character set to use with the
|
||||||
|
global editor (to Latin-1 for example). Local and netmail
|
||||||
|
areas must be done by hand because they are most likely not
|
||||||
|
in a group.
|
||||||
|
|
||||||
SETUP.sh:
|
SETUP.sh:
|
||||||
Changed to support Darwin (OS X). Note that in earlier days
|
Changed to support Darwin (OS X). Note that in earlier days
|
||||||
mbse did compile under OS X, but things are different since
|
mbse did compile under OS X, but things are different since
|
||||||
then. Work is underway to let it compile and run again.
|
then. Work is underway to let it compile and run again.
|
||||||
|
|
||||||
|
mbsetup:
|
||||||
|
In edit message groups added setup for default character set.
|
||||||
|
In edit message areas added setup for character set for the
|
||||||
|
area. Also added global edit for character set.
|
||||||
|
In several places where groups need to be tagged, there is now
|
||||||
|
a switch (*) to select/deslect all groups at once.
|
||||||
|
|
||||||
|
|
||||||
v0.51.0 09-Feb-2004 - 21-Feb-2004
|
v0.51.0 09-Feb-2004 - 21-Feb-2004
|
||||||
|
5
TODO
5
TODO
@ -1,6 +1,6 @@
|
|||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
MBSE BBS V0.51.0 TODO list.
|
MBSE BBS V0.51.1 TODO list.
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
These are a list of things that must be implemented one way or
|
These are a list of things that must be implemented one way or
|
||||||
@ -170,9 +170,6 @@ mbsetup:
|
|||||||
|
|
||||||
N: Add switch for file area to skip checking and indexing.
|
N: Add switch for file area to skip checking and indexing.
|
||||||
|
|
||||||
N: Add menu switches in nodes/groups to select/deselect all groups
|
|
||||||
at once.
|
|
||||||
|
|
||||||
N: Add global setup in menus 9.1 and 10.1 at least to change uplink
|
N: Add global setup in menus 9.1 and 10.1 at least to change uplink
|
||||||
data.
|
data.
|
||||||
|
|
||||||
|
@ -1754,6 +1754,7 @@ struct _mgroup {
|
|||||||
unsigned xRes8 : 1;
|
unsigned xRes8 : 1;
|
||||||
unsigned StartArea; /* Start at area number */
|
unsigned StartArea; /* Start at area number */
|
||||||
securityrec LinkSec; /* Default link security */
|
securityrec LinkSec; /* Default link security */
|
||||||
|
int Charset; /* Default charaacter set */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,8 +236,7 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f)
|
|||||||
msgs.NetReply = mgroup.NetReply;
|
msgs.NetReply = mgroup.NetReply;
|
||||||
msgs.Active = TRUE;
|
msgs.Active = TRUE;
|
||||||
msgs.Quotes = mgroup.Quotes;
|
msgs.Quotes = mgroup.Quotes;
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
msgs.Charset = mgroup.Charset;
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
|
||||||
msgs.MaxArticles = CFG.maxarticles;
|
msgs.MaxArticles = CFG.maxarticles;
|
||||||
tag = tl(tag);
|
tag = tl(tag);
|
||||||
for (i = 0; i < strlen(tag); i++)
|
for (i = 0; i < strlen(tag); i++)
|
||||||
|
@ -673,8 +673,7 @@ int Areas(void)
|
|||||||
msgs.Type = ECHOMAIL;
|
msgs.Type = ECHOMAIL;
|
||||||
msgs.MsgKinds = PUBLIC;
|
msgs.MsgKinds = PUBLIC;
|
||||||
msgs.UsrDelete = TRUE;
|
msgs.UsrDelete = TRUE;
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
msgs.Charset = FTNC_NONE;
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
|
||||||
msgs.MaxArticles = CFG.maxarticles;
|
msgs.MaxArticles = CFG.maxarticles;
|
||||||
strcpy(msgs.Origin, CFG.origin);
|
strcpy(msgs.Origin, CFG.origin);
|
||||||
}
|
}
|
||||||
|
159
mbsetup/grlist.c
159
mbsetup/grlist.c
@ -111,94 +111,99 @@ void sort_grlist(gr_list **fdp)
|
|||||||
|
|
||||||
int compgroup(gr_list **fdp1, gr_list **fdp2)
|
int compgroup(gr_list **fdp1, gr_list **fdp2)
|
||||||
{
|
{
|
||||||
return strcmp((*fdp1)->group, (*fdp2)->group);
|
return strcmp((*fdp1)->group, (*fdp2)->group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int E_Group(gr_list **fdp, char *title)
|
int E_Group(gr_list **fdp, char *title)
|
||||||
{
|
{
|
||||||
int o = 0, n = 0, i, j, x, y, rc = FALSE;
|
int o = 0, n = 0, i, j, x, y, rc = FALSE, All = FALSE;
|
||||||
gr_list *tmp;
|
gr_list *tmp;
|
||||||
|
|
||||||
clr_index();
|
clr_index();
|
||||||
set_color(WHITE, BLACK);
|
set_color(WHITE, BLACK);
|
||||||
mvprintw(5, 6, (char *)"%s", title);
|
mvprintw(5, 6, (char *)"%s", title);
|
||||||
|
set_color(CYAN, BLACK);
|
||||||
|
|
||||||
|
for (tmp = *fdp; tmp; tmp = tmp->next)
|
||||||
|
n++;
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
set_color(CYAN, BLACK);
|
set_color(CYAN, BLACK);
|
||||||
|
y = 7;
|
||||||
|
x = 5;
|
||||||
|
j = 0;
|
||||||
|
|
||||||
for (tmp = *fdp; tmp; tmp = tmp->next)
|
for (tmp = *fdp; tmp; tmp = tmp->next) {
|
||||||
n++;
|
j++;
|
||||||
|
if ((j >= (o + 1)) && (j < (o + 41))) {
|
||||||
for (;;) {
|
if (tmp->tagged)
|
||||||
set_color(CYAN, BLACK);
|
mvprintw(y, x, (char *)"%2d. + %s", j, tmp->group);
|
||||||
y = 7;
|
else
|
||||||
x = 5;
|
mvprintw(y, x, (char *)"%2d. %s", j, tmp->group);
|
||||||
j = 0;
|
y++;
|
||||||
|
if (y == 17) {
|
||||||
for (tmp = *fdp; tmp; tmp = tmp->next) {
|
y = 7;
|
||||||
j++;
|
x += 20;
|
||||||
if ((j >= (o + 1)) && (j < (o + 41))) {
|
|
||||||
if (tmp->tagged)
|
|
||||||
mvprintw(y, x, (char *)"%2d. + %s", j, tmp->group);
|
|
||||||
else
|
|
||||||
mvprintw(y, x, (char *)"%2d. %s", j, tmp->group);
|
|
||||||
y++;
|
|
||||||
if (y == 17) {
|
|
||||||
y = 7;
|
|
||||||
x += 20;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i = select_tag(n);
|
|
||||||
|
|
||||||
switch (i) {
|
|
||||||
case 0: clr_index();
|
|
||||||
return rc;
|
|
||||||
break;
|
|
||||||
case -2: if ((o - 40) >= 0) {
|
|
||||||
clr_index();
|
|
||||||
set_color(WHITE, BLACK);
|
|
||||||
mvprintw(5, 5, (char *)"%s", title);
|
|
||||||
set_color(CYAN, BLACK);
|
|
||||||
o -= 40;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case -1: if ((o + 40) < n) {
|
|
||||||
clr_index();
|
|
||||||
set_color(WHITE, BLACK);
|
|
||||||
mvprintw(5, 5, (char *)"%s", title);
|
|
||||||
set_color(CYAN, BLACK);
|
|
||||||
o += 40;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: if ((i >= 1) && (i <= n)) {
|
|
||||||
j = 0;
|
|
||||||
rc = TRUE;
|
|
||||||
for (tmp = *fdp; tmp; tmp = tmp->next) {
|
|
||||||
j++;
|
|
||||||
if (j == i) {
|
|
||||||
if (tmp->tagged)
|
|
||||||
tmp->tagged = FALSE;
|
|
||||||
else
|
|
||||||
tmp->tagged = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (o != ((i -1) / 40) * 40) {
|
|
||||||
/*
|
|
||||||
* If a group is selected outside the visible
|
|
||||||
* range, change the groupview.
|
|
||||||
*/
|
|
||||||
o = ((i -1) / 40) * 40;
|
|
||||||
clr_index();
|
|
||||||
set_color(WHITE, BLACK);
|
|
||||||
mvprintw(5, 5, (char *)"%s", title);
|
|
||||||
set_color(CYAN, BLACK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i = select_tag(n);
|
||||||
|
|
||||||
|
switch (i) {
|
||||||
|
case 0: clr_index();
|
||||||
|
return rc;
|
||||||
|
break;
|
||||||
|
case -2:if ((o - 40) >= 0) {
|
||||||
|
clr_index();
|
||||||
|
set_color(WHITE, BLACK);
|
||||||
|
mvprintw(5, 5, (char *)"%s", title);
|
||||||
|
set_color(CYAN, BLACK);
|
||||||
|
o -= 40;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case -1:if ((o + 40) < n) {
|
||||||
|
clr_index();
|
||||||
|
set_color(WHITE, BLACK);
|
||||||
|
mvprintw(5, 5, (char *)"%s", title);
|
||||||
|
set_color(CYAN, BLACK);
|
||||||
|
o += 40;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case -3:All = !All;
|
||||||
|
for (tmp = *fdp; tmp; tmp = tmp->next)
|
||||||
|
tmp->tagged = All;
|
||||||
|
rc = TRUE;
|
||||||
|
break;
|
||||||
|
default:if ((i >= 1) && (i <= n)) {
|
||||||
|
j = 0;
|
||||||
|
rc = TRUE;
|
||||||
|
for (tmp = *fdp; tmp; tmp = tmp->next) {
|
||||||
|
j++;
|
||||||
|
if (j == i) {
|
||||||
|
if (tmp->tagged)
|
||||||
|
tmp->tagged = FALSE;
|
||||||
|
else
|
||||||
|
tmp->tagged = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (o != ((i -1) / 40) * 40) {
|
||||||
|
/*
|
||||||
|
* If a group is selected outside the visible
|
||||||
|
* range, change the groupview.
|
||||||
|
*/
|
||||||
|
o = ((i -1) / 40) * 40;
|
||||||
|
clr_index();
|
||||||
|
set_color(WHITE, BLACK);
|
||||||
|
mvprintw(5, 5, (char *)"%s", title);
|
||||||
|
set_color(CYAN, BLACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -627,21 +627,22 @@ char *select_aka(int max, int items)
|
|||||||
/*
|
/*
|
||||||
* Select menu, max is the highest item to pick. Returns zero if
|
* Select menu, max is the highest item to pick. Returns zero if
|
||||||
* "-" (previous level) is selected, -2 and -1 for the N and P keys.
|
* "-" (previous level) is selected, -2 and -1 for the N and P keys.
|
||||||
|
* If allowall, the -3 is for the * key.
|
||||||
*/
|
*/
|
||||||
int select_menu_sub(int, int, char *);
|
int select_menu_sub(int, int, int, char *);
|
||||||
|
|
||||||
int select_menu(int max)
|
int select_menu(int max)
|
||||||
{
|
{
|
||||||
return select_menu_sub(max, 50, (char *)"Select menu item");
|
return select_menu_sub(max, 50, FALSE, (char *)"Select menu item");
|
||||||
}
|
}
|
||||||
|
|
||||||
int select_tag(int max)
|
int select_tag(int max)
|
||||||
{
|
{
|
||||||
return select_menu_sub(max, 40, (char *)"Toggle item");
|
return select_menu_sub(max, 40, TRUE, (char *)"Toggle item");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int select_menu_sub(int max, int items, char *hlp)
|
int select_menu_sub(int max, int items, int allowall, char *hlp)
|
||||||
{
|
{
|
||||||
static char *menu=(char *)"-";
|
static char *menu=(char *)"-";
|
||||||
char help[81];
|
char help[81];
|
||||||
@ -649,11 +650,19 @@ int select_menu_sub(int max, int items, char *hlp)
|
|||||||
|
|
||||||
if (max == 0)
|
if (max == 0)
|
||||||
sprintf(help, "Select ^\"-\"^ for previous level");
|
sprintf(help, "Select ^\"-\"^ for previous level");
|
||||||
else
|
else {
|
||||||
if (max > items)
|
if (allowall) {
|
||||||
sprintf(help, "%s (1..%d), ^\"-\"^ prev. level, ^\"P\" or \"N\"^ to page", hlp, max);
|
if (max > items)
|
||||||
else
|
sprintf(help, "%s (1..%d), ^\"-\"^ prev. level, ^\"*\"^ (de)select all, ^\"P\" or \"N\"^ to page", hlp, max);
|
||||||
sprintf(help, "%s (1..%d), ^\"-\"^ for previous level", hlp, max);
|
else
|
||||||
|
sprintf(help, "%s (1..%d), ^\"-\"^ for previous level, ^\"*\"^ (de)select all", hlp, max);
|
||||||
|
} else {
|
||||||
|
if (max > items)
|
||||||
|
sprintf(help, "%s (1..%d), ^\"-\"^ prev. level, ^\"P\" or \"N\"^ to page", hlp, max);
|
||||||
|
else
|
||||||
|
sprintf(help, "%s (1..%d), ^\"-\"^ for previous level", hlp, max);
|
||||||
|
}
|
||||||
|
}
|
||||||
showhelp(help);
|
showhelp(help);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -675,6 +684,8 @@ int select_menu_sub(int max, int items, char *hlp)
|
|||||||
if (strncmp(menu, "P", 1) == 0)
|
if (strncmp(menu, "P", 1) == 0)
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
if (allowall && (strncmp(menu, "*", 1) == 0))
|
||||||
|
return -3;
|
||||||
|
|
||||||
pick = atoi(menu);
|
pick = atoi(menu);
|
||||||
if ((pick >= 1) && (pick <= max))
|
if ((pick >= 1) && (pick <= max))
|
||||||
@ -2179,3 +2190,52 @@ char *getmenutype(int val)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char *getchrs(int val)
|
||||||
|
{
|
||||||
|
switch (val) {
|
||||||
|
case FTNC_NONE: return (char *)"Undefined";
|
||||||
|
case FTNC_CP437: return (char *)"CP437";
|
||||||
|
case FTNC_CP850: return (char *)"CP850";
|
||||||
|
case FTNC_CP865: return (char *)"CP865";
|
||||||
|
case FTNC_CP866: return (char *)"CP866";
|
||||||
|
case FTNC_LATIN_1: return (char *)"Latin-1";
|
||||||
|
case FTNC_LATIN_2: return (char *)"Latin-2";
|
||||||
|
case FTNC_LATIN_5: return (char *)"Latin-5";
|
||||||
|
case FTNC_MAC: return (char *)"Mac";
|
||||||
|
default: return (char *)"ERROR";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void show_charset(int y, int x, int val)
|
||||||
|
{
|
||||||
|
show_str(y, x, 9, getchrs(val));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int edit_charset(int y, int x, int val)
|
||||||
|
{
|
||||||
|
int ch;
|
||||||
|
|
||||||
|
showhelp((char *)"Toggle ^Charset^ with spacebar, press <Enter> when done.");
|
||||||
|
do {
|
||||||
|
set_color(YELLOW, BLUE);
|
||||||
|
show_charset(y, x, val);
|
||||||
|
|
||||||
|
ch = readkey(y, x, YELLOW, BLUE);
|
||||||
|
|
||||||
|
if (ch == ' ') {
|
||||||
|
if (val < FTNC_MAXCHARS)
|
||||||
|
val++;
|
||||||
|
else
|
||||||
|
val = FTNC_NONE;
|
||||||
|
}
|
||||||
|
} while (ch != KEY_ENTER && ch != '\012');
|
||||||
|
set_color(WHITE, BLACK);
|
||||||
|
show_charset(y, x, val);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,6 +80,9 @@ void show_aka(int, int, fidoaddr);
|
|||||||
void edit_color(int *, int *, char *, char *);
|
void edit_color(int *, int *, char *, char *);
|
||||||
char *get_color(int);
|
char *get_color(int);
|
||||||
char *getmenutype(int);
|
char *getmenutype(int);
|
||||||
|
char *getchrs(int);
|
||||||
|
void show_charset(int, int, int);
|
||||||
|
int edit_charset(int, int, int);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,8 +85,7 @@ int CountMsgarea(void)
|
|||||||
msgs.Quotes = TRUE;
|
msgs.Quotes = TRUE;
|
||||||
msgs.DaysOld = CFG.defdays;
|
msgs.DaysOld = CFG.defdays;
|
||||||
msgs.MaxMsgs = CFG.defmsgs;
|
msgs.MaxMsgs = CFG.defmsgs;
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
msgs.Charset = FTNC_NONE;
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
|
||||||
strcpy(msgs.Origin, CFG.origin);
|
strcpy(msgs.Origin, CFG.origin);
|
||||||
fwrite(&msgs, sizeof(msgs), 1, fil);
|
fwrite(&msgs, sizeof(msgs), 1, fil);
|
||||||
mkdirs(msgs.Base, 0770);
|
mkdirs(msgs.Base, 0770);
|
||||||
@ -111,8 +110,7 @@ int CountMsgarea(void)
|
|||||||
msgs.SYSec.level = 32000;
|
msgs.SYSec.level = 32000;
|
||||||
msgs.DaysOld = CFG.defdays;
|
msgs.DaysOld = CFG.defdays;
|
||||||
msgs.MaxMsgs = CFG.defmsgs;
|
msgs.MaxMsgs = CFG.defmsgs;
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
msgs.Charset = FTNC_NONE;
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
|
||||||
fwrite(&msgs, sizeof(msgs), 1, fil);
|
fwrite(&msgs, sizeof(msgs), 1, fil);
|
||||||
mkdirs(msgs.Base, 0770);
|
mkdirs(msgs.Base, 0770);
|
||||||
if (Msg_Open(msgs.Base))
|
if (Msg_Open(msgs.Base))
|
||||||
@ -135,8 +133,7 @@ int CountMsgarea(void)
|
|||||||
msgs.SYSec.level = 32000;
|
msgs.SYSec.level = 32000;
|
||||||
msgs.DaysOld = CFG.defdays;
|
msgs.DaysOld = CFG.defdays;
|
||||||
msgs.MaxMsgs = CFG.defmsgs;
|
msgs.MaxMsgs = CFG.defmsgs;
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
msgs.Charset = FTNC_NONE;
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
|
||||||
fwrite(&msgs, sizeof(msgs), 1, fil);
|
fwrite(&msgs, sizeof(msgs), 1, fil);
|
||||||
mkdirs(msgs.Base, 0770);
|
mkdirs(msgs.Base, 0770);
|
||||||
if (Msg_Open(msgs.Base))
|
if (Msg_Open(msgs.Base))
|
||||||
@ -220,10 +217,6 @@ int OpenMsgarea(void)
|
|||||||
*/
|
*/
|
||||||
memset(&msgs, 0, sizeof(msgs));
|
memset(&msgs, 0, sizeof(msgs));
|
||||||
while (fread(&msgs, oldsize, 1, fin) == 1) {
|
while (fread(&msgs, oldsize, 1, fin) == 1) {
|
||||||
if ((oldsize != sizeof(msgs)) && !msgs.Rfccode) {
|
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
|
||||||
}
|
|
||||||
if ((oldsize != sizeof(msgs)) && !msgs.LinkSec.level) {
|
if ((oldsize != sizeof(msgs)) && !msgs.LinkSec.level) {
|
||||||
msgs.LinkSec.level = 1;
|
msgs.LinkSec.level = 1;
|
||||||
msgs.LinkSec.flags = 1;
|
msgs.LinkSec.flags = 1;
|
||||||
@ -301,8 +294,11 @@ void InitMsgRec(void)
|
|||||||
msgs.Type = ECHOMAIL;
|
msgs.Type = ECHOMAIL;
|
||||||
msgs.MsgKinds = PUBLIC;
|
msgs.MsgKinds = PUBLIC;
|
||||||
msgs.UsrDelete = TRUE;
|
msgs.UsrDelete = TRUE;
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
#ifdef HAVE_ICONV_H
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
msgs.Charset = FTNC_LATIN_1;
|
||||||
|
#else
|
||||||
|
msgs.Charset = FTNC_NONE;
|
||||||
|
#endif
|
||||||
msgs.MaxArticles = CFG.maxarticles;
|
msgs.MaxArticles = CFG.maxarticles;
|
||||||
strcpy(msgs.Origin, CFG.origin);
|
strcpy(msgs.Origin, CFG.origin);
|
||||||
msgs.LinkSec.level = 1;
|
msgs.LinkSec.level = 1;
|
||||||
@ -493,38 +489,37 @@ void SetScreen()
|
|||||||
mvprintw(14, 2, "9. Distrib.");
|
mvprintw(14, 2, "9. Distrib.");
|
||||||
mvprintw(15, 2, "10. Area Type");
|
mvprintw(15, 2, "10. Area Type");
|
||||||
mvprintw(16, 2, "11. Msg Kinds");
|
mvprintw(16, 2, "11. Msg Kinds");
|
||||||
mvprintw(17, 2, "12. FTN chars");
|
mvprintw(17, 2, "12. Charset");
|
||||||
mvprintw(18, 2, "13. RFC chars");
|
mvprintw(18, 2, "13. Active");
|
||||||
mvprintw(19, 2, "14. Active");
|
mvprintw(19, 2, "14. Days Old");
|
||||||
|
|
||||||
mvprintw(13,34, "15. Days Old");
|
mvprintw(13,34, "15. Max. Msgs");
|
||||||
mvprintw(14,34, "16. Max. Msgs");
|
|
||||||
switch (msgs.Type) {
|
switch (msgs.Type) {
|
||||||
case ECHOMAIL: mvprintw(15,34, "17. Netreply");
|
case ECHOMAIL: mvprintw(14,34, "16. Netreply");
|
||||||
break;
|
break;
|
||||||
case NEWS: mvprintw(15,34, "17. Articles");
|
case NEWS: mvprintw(14,34, "16. Articles");
|
||||||
break;
|
break;
|
||||||
default: mvprintw(15,34, "17. N/A");
|
default: mvprintw(14,34, "16. N/A");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mvprintw(16,34, "18. Read Sec.");
|
mvprintw(15,34, "17. Read Sec.");
|
||||||
mvprintw(17,34, "19. Write Sec.");
|
mvprintw(16,34, "18. Write Sec.");
|
||||||
mvprintw(18,34, "20. Sysop Sec.");
|
mvprintw(17,34, "19. Sysop Sec.");
|
||||||
mvprintw(19,34, "21. User Del.");
|
mvprintw(18,34, "20. User Del.");
|
||||||
|
mvprintw(19,34, "21. Aliases");
|
||||||
|
|
||||||
mvprintw(12,58, "22. Aliases");
|
mvprintw(13,58, "22. Quotes");
|
||||||
mvprintw(13,58, "23. Quotes");
|
mvprintw(14,58, "23. Mandatory");
|
||||||
mvprintw(14,58, "24. Mandatory");
|
mvprintw(15,58, "24. UnSecure");
|
||||||
mvprintw(15,58, "25. UnSecure");
|
mvprintw(16,58, "25. OLR Default");
|
||||||
mvprintw(16,58, "26. OLR Default");
|
mvprintw(17,58, "26. OLR Forced");
|
||||||
mvprintw(17,58, "27. OLR Forced");
|
|
||||||
switch (msgs.Type) {
|
switch (msgs.Type) {
|
||||||
case ECHOMAIL:
|
case ECHOMAIL:
|
||||||
case NEWS:
|
case NEWS:
|
||||||
case LIST: mvprintw(18,58, "28. Connections");
|
case LIST: mvprintw(18,58, "27. Connections");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mvprintw(19,58, "29. Security");
|
mvprintw(19,58, "28. Security");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -639,7 +634,7 @@ void MsgGlobal(void)
|
|||||||
char *p, mfile[PATH_MAX];
|
char *p, mfile[PATH_MAX];
|
||||||
FILE *fil;
|
FILE *fil;
|
||||||
fidoaddr a1, a2;
|
fidoaddr a1, a2;
|
||||||
int menu = 0, marea, Areas, akan = 0, Found;
|
int menu = 0, marea, Areas, akan = 0, Found, charset = FTNC_LATIN_1;
|
||||||
int Total, Done, netbrd, daysold, maxmsgs, maxarticles;
|
int Total, Done, netbrd, daysold, maxmsgs, maxarticles;
|
||||||
long offset;
|
long offset;
|
||||||
securityrec rs, ws, ss, as;
|
securityrec rs, ws, ss, as;
|
||||||
@ -694,14 +689,15 @@ void MsgGlobal(void)
|
|||||||
mvprintw(14, 6, "8. Change bbs security");
|
mvprintw(14, 6, "8. Change bbs security");
|
||||||
mvprintw(15, 6, "9. Change link security");
|
mvprintw(15, 6, "9. Change link security");
|
||||||
mvprintw(16, 6, "10. Change aka to use");
|
mvprintw(16, 6, "10. Change aka to use");
|
||||||
mvprintw(17, 6, "11. Change origin line");
|
mvprintw( 7,41, "11. Change origin line");
|
||||||
mvprintw(18, 6, "12. Change netmail reply");
|
mvprintw( 8,41, "12. Change netmail reply");
|
||||||
mvprintw(19, 6, "13. Delete message area");
|
mvprintw( 9,41, "13. Change character set");
|
||||||
|
mvprintw(10,41, "14. Delete message area");
|
||||||
|
|
||||||
memset(&a1, 0, sizeof(fidoaddr));
|
memset(&a1, 0, sizeof(fidoaddr));
|
||||||
memset(&a2, 0, sizeof(fidoaddr));
|
memset(&a2, 0, sizeof(fidoaddr));
|
||||||
|
|
||||||
menu = select_menu(13);
|
menu = select_menu(14);
|
||||||
switch (menu) {
|
switch (menu) {
|
||||||
case 0: tidy_grlist(&mgr);
|
case 0: tidy_grlist(&mgr);
|
||||||
return;
|
return;
|
||||||
@ -736,6 +732,9 @@ void MsgGlobal(void)
|
|||||||
case 11:E_STR(LINES -3, 5, 64, mfile, "Enter new ^origin^ line");
|
case 11:E_STR(LINES -3, 5, 64, mfile, "Enter new ^origin^ line");
|
||||||
case 12:mvprintw(LINES -3, 5, "Netmail reply board");
|
case 12:mvprintw(LINES -3, 5, "Netmail reply board");
|
||||||
E_INT(LINES -3, 25, netbrd, (char *)"The ^netmail reply^ board number")
|
E_INT(LINES -3, 25, netbrd, (char *)"The ^netmail reply^ board number")
|
||||||
|
case 13:mvprintw(LINES -3, 5, "Character set to set");
|
||||||
|
charset = edit_charset(LINES -3,26, charset);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
E_Group(&mgr, (char *)"SELECT MESSAGE GROUPS TO CHANGE");
|
E_Group(&mgr, (char *)"SELECT MESSAGE GROUPS TO CHANGE");
|
||||||
@ -782,7 +781,9 @@ void MsgGlobal(void)
|
|||||||
break;
|
break;
|
||||||
case 12:mvprintw(7, 6, "New netmail reply board %d", netbrd);
|
case 12:mvprintw(7, 6, "New netmail reply board %d", netbrd);
|
||||||
break;
|
break;
|
||||||
case 13:mvprintw(7, 6, "Delete message areas");
|
case 13:mvprintw(7, 6, "New character set %s", getchrs(charset));
|
||||||
|
break;
|
||||||
|
case 14:mvprintw(7, 6, "Delete message areas");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -965,7 +966,15 @@ void MsgGlobal(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 13:if (msgs.Active) {
|
case 13:if (charset != msgs.Charset) {
|
||||||
|
msgs.Charset = charset;
|
||||||
|
if (SaveMsgRec(marea, FALSE) == 0) {
|
||||||
|
Done++;
|
||||||
|
Syslog('+', "Changed character set to %s in area %s", getchrs(charset), msgs.Tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14:if (msgs.Active) {
|
||||||
msgs.Active = FALSE;
|
msgs.Active = FALSE;
|
||||||
Msg_DeleteMsgBase(msgs.Base);
|
Msg_DeleteMsgBase(msgs.Base);
|
||||||
memset(&msgs, 0, sizeof(msgs));
|
memset(&msgs, 0, sizeof(msgs));
|
||||||
@ -1029,24 +1038,23 @@ int EditMsgRec(int Area)
|
|||||||
show_str(14,16,16, msgs.Distribution);
|
show_str(14,16,16, msgs.Distribution);
|
||||||
show_msgtype(15,16, msgs.Type);
|
show_msgtype(15,16, msgs.Type);
|
||||||
show_msgkinds(16,16, msgs.MsgKinds);
|
show_msgkinds(16,16, msgs.MsgKinds);
|
||||||
// show_str(17,16,16, printable(getchrs(msgs.Ftncode), 0));
|
show_charset(17,16, msgs.Charset);
|
||||||
// show_str(18,16,16, printable(getchrs(msgs.Rfccode), 0));
|
show_bool(18,16, msgs.Active);
|
||||||
show_bool(19,16, msgs.Active);
|
show_int( 19,16, msgs.DaysOld);
|
||||||
|
|
||||||
show_int( 13,50, msgs.DaysOld);
|
show_int( 13,50, msgs.MaxMsgs);
|
||||||
show_int( 14,50, msgs.MaxMsgs);
|
|
||||||
switch (msgs.Type) {
|
switch (msgs.Type) {
|
||||||
case ECHOMAIL: show_int( 15,50, msgs.NetReply);
|
case ECHOMAIL: show_int( 14,50, msgs.NetReply);
|
||||||
break;
|
break;
|
||||||
case NEWS: show_int( 15,50, msgs.MaxArticles);
|
case NEWS: show_int( 14,50, msgs.MaxArticles);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
show_int( 16,50, msgs.RDSec.level);
|
show_int( 15,50, msgs.RDSec.level);
|
||||||
show_int( 17,50, msgs.WRSec.level);
|
show_int( 16,50, msgs.WRSec.level);
|
||||||
show_int( 18,50, msgs.SYSec.level);
|
show_int( 17,50, msgs.SYSec.level);
|
||||||
show_bool(19,50, msgs.UsrDelete);
|
show_bool(18,50, msgs.UsrDelete);
|
||||||
|
show_bool(19,50, msgs.Aliases);
|
||||||
|
|
||||||
show_bool(12,74, msgs.Aliases);
|
|
||||||
show_bool(13,74, msgs.Quotes);
|
show_bool(13,74, msgs.Quotes);
|
||||||
show_bool(14,74, msgs.Mandatory);
|
show_bool(14,74, msgs.Mandatory);
|
||||||
show_bool(15,74, msgs.UnSecure);
|
show_bool(15,74, msgs.UnSecure);
|
||||||
@ -1064,7 +1072,7 @@ int EditMsgRec(int Area)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (select_menu(29)) {
|
switch (select_menu(28)) {
|
||||||
case 0: crc1 = 0xffffffff;
|
case 0: crc1 = 0xffffffff;
|
||||||
crc1 = upd_crc32((char *)&msgs, crc1, msgshdr.recsize);
|
crc1 = upd_crc32((char *)&msgs, crc1, msgshdr.recsize);
|
||||||
fseek(tfil, 0, 0);
|
fseek(tfil, 0, 0);
|
||||||
@ -1122,8 +1130,7 @@ int EditMsgRec(int Area)
|
|||||||
msgs.NetReply = mgroup.NetReply;
|
msgs.NetReply = mgroup.NetReply;
|
||||||
msgs.Quotes = mgroup.Quotes;
|
msgs.Quotes = mgroup.Quotes;
|
||||||
msgs.MaxArticles = CFG.maxarticles;
|
msgs.MaxArticles = CFG.maxarticles;
|
||||||
msgs.Rfccode = 0; // CHRS_DEFAULT_RFC;
|
msgs.Charset = mgroup.Charset;
|
||||||
msgs.Ftncode = 0; // CHRS_DEFAULT_FTN;
|
|
||||||
strncpy(msgs.Origin, CFG.origin, 50);
|
strncpy(msgs.Origin, CFG.origin, 50);
|
||||||
msgs.LinkSec = mgroup.LinkSec;
|
msgs.LinkSec = mgroup.LinkSec;
|
||||||
|
|
||||||
@ -1249,7 +1256,8 @@ int EditMsgRec(int Area)
|
|||||||
SetScreen();
|
SetScreen();
|
||||||
break;
|
break;
|
||||||
case 11:msgs.MsgKinds = edit_msgkinds(16,16, msgs.MsgKinds); break;
|
case 11:msgs.MsgKinds = edit_msgkinds(16,16, msgs.MsgKinds); break;
|
||||||
case 14:Active = edit_bool(19,16, msgs.Active, (char *)"Is this area ^Active^");
|
case 12:msgs.Charset = edit_charset(17,16, msgs.Charset); break;
|
||||||
|
case 13:Active = edit_bool(18,16, msgs.Active, (char *)"Is this area ^Active^");
|
||||||
if (msgs.Active && !Active) {
|
if (msgs.Active && !Active) {
|
||||||
/*
|
/*
|
||||||
* Attempt to deactivate area, do some checks.
|
* Attempt to deactivate area, do some checks.
|
||||||
@ -1285,29 +1293,29 @@ int EditMsgRec(int Area)
|
|||||||
msgs.Active = TRUE;
|
msgs.Active = TRUE;
|
||||||
SetScreen();
|
SetScreen();
|
||||||
break;
|
break;
|
||||||
case 15:E_INT( 13,50, msgs.DaysOld, "Maximum ^days^ to keep mail in this area")
|
case 14:E_INT( 19,16, msgs.DaysOld, "Maximum ^days^ to keep mail in this area")
|
||||||
case 16:E_INT( 14,50, msgs.MaxMsgs, "The ^maximum^ amount of messages in this area")
|
case 15:E_INT( 13,50, msgs.MaxMsgs, "The ^maximum^ amount of messages in this area")
|
||||||
case 17:switch (msgs.Type) {
|
case 16:switch (msgs.Type) {
|
||||||
case ECHOMAIL: msgs.NetReply = edit_int(15,50,msgs.NetReply,
|
case ECHOMAIL: msgs.NetReply = edit_int(14,50,msgs.NetReply,
|
||||||
(char *)"The ^Area Number^ for netmail replies");
|
(char *)"The ^Area Number^ for netmail replies");
|
||||||
break;
|
break;
|
||||||
case NEWS: msgs.MaxArticles = edit_int(15,50,msgs.MaxArticles,
|
case NEWS: msgs.MaxArticles = edit_int(14,50,msgs.MaxArticles,
|
||||||
(char *)"The ^maximum news articles^ to fetch");
|
(char *)"The ^maximum news articles^ to fetch");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 18:E_SEC( 16,50, msgs.RDSec, "9.2 EDIT READ SECURITY", SetScreen)
|
case 17:E_SEC( 15,50, msgs.RDSec, "9.2 EDIT READ SECURITY", SetScreen)
|
||||||
case 19:E_SEC( 17,50, msgs.WRSec, "9.2 EDIT WRITE SECURITY", SetScreen)
|
case 18:E_SEC( 16,50, msgs.WRSec, "9.2 EDIT WRITE SECURITY", SetScreen)
|
||||||
case 20:E_SEC( 18,50, msgs.SYSec, "9.2 EDIT SYSOP SECURITY", SetScreen)
|
case 19:E_SEC( 17,50, msgs.SYSec, "9.2 EDIT SYSOP SECURITY", SetScreen)
|
||||||
case 21:E_BOOL(19,50, msgs.UsrDelete, "Allow users to ^Delete^ their messages")
|
case 20:E_BOOL(18,50, msgs.UsrDelete, "Allow users to ^Delete^ their messages")
|
||||||
|
case 21:E_BOOL(19,50, msgs.Aliases, "Allow ^aliases^ or real names only")
|
||||||
|
|
||||||
case 22:E_BOOL(12,74, msgs.Aliases, "Allow ^aliases^ or real names only")
|
case 22:E_BOOL(13,74, msgs.Quotes, "Add random ^quotes^ to new messages")
|
||||||
case 23:E_BOOL(13,74, msgs.Quotes, "Add random ^quotes^ to new messages")
|
case 23:E_BOOL(14,74, msgs.Mandatory, "Is this area ^mandatory^ for nodes")
|
||||||
case 24:E_BOOL(14,74, msgs.Mandatory, "Is this area ^mandatory^ for nodes")
|
case 24:E_BOOL(15,74, msgs.UnSecure, "Toss messages ^UnSecure^, ie: no originating check")
|
||||||
case 25:E_BOOL(15,74, msgs.UnSecure, "Toss messages ^UnSecure^, ie: no originating check")
|
case 25:E_BOOL(16,74, msgs.OLR_Default, "Area is ^default^ for ^offline^ users.")
|
||||||
case 26:E_BOOL(16,74, msgs.OLR_Default, "Area is ^default^ for ^offline^ users.")
|
case 26:E_BOOL(17,74, msgs.OLR_Forced, "Area is ^always on^ for ^offline^ users.")
|
||||||
case 27:E_BOOL(17,74, msgs.OLR_Forced, "Area is ^always on^ for ^offline^ users.")
|
case 27:switch (msgs.Type) {
|
||||||
case 28:switch (msgs.Type) {
|
|
||||||
case ECHOMAIL:
|
case ECHOMAIL:
|
||||||
case NEWS:
|
case NEWS:
|
||||||
case LIST: if (EditConnections(tfil))
|
case LIST: if (EditConnections(tfil))
|
||||||
@ -1316,7 +1324,7 @@ int EditMsgRec(int Area)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29:msgs.LinkSec = edit_asec(msgs.LinkSec, (char *)"9.2 EDIT LINK SECURITY");
|
case 28:msgs.LinkSec = edit_asec(msgs.LinkSec, (char *)"9.2 EDIT LINK SECURITY");
|
||||||
SetScreen();
|
SetScreen();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1804,8 +1812,7 @@ int mail_area_doc(FILE *fp, FILE *toc, int page)
|
|||||||
fprintf(fp, " Offline name %s\n", msgs.QWKname);
|
fprintf(fp, " Offline name %s\n", msgs.QWKname);
|
||||||
fprintf(fp, " Area type %s\n", getmsgtype(msgs.Type));
|
fprintf(fp, " Area type %s\n", getmsgtype(msgs.Type));
|
||||||
fprintf(fp, " Messages type %s\n", getmsgkinds(msgs.MsgKinds));
|
fprintf(fp, " Messages type %s\n", getmsgkinds(msgs.MsgKinds));
|
||||||
// fprintf(fp, " FTN charset %s\n", printable(getchrs(msgs.Ftncode), 0));
|
fprintf(fp, " Character set %s\n", getchrs(msgs.Charset));
|
||||||
// fprintf(fp, " RFC charset %s\n", printable(getchrs(msgs.Rfccode), 0));
|
|
||||||
fprintf(fp, " Days old msgs. %d\n", msgs.DaysOld);
|
fprintf(fp, " Days old msgs. %d\n", msgs.DaysOld);
|
||||||
fprintf(fp, " Maximum msgs. %d\n", msgs.MaxMsgs);
|
fprintf(fp, " Maximum msgs. %d\n", msgs.MaxMsgs);
|
||||||
fprintf(fp, " Max articles %d\n", msgs.MaxArticles);
|
fprintf(fp, " Max articles %d\n", msgs.MaxArticles);
|
||||||
|
@ -154,6 +154,9 @@ int OpenMGroup(void)
|
|||||||
mgroup.LinkSec.level = 1;
|
mgroup.LinkSec.level = 1;
|
||||||
mgroup.LinkSec.flags = 1;
|
mgroup.LinkSec.flags = 1;
|
||||||
}
|
}
|
||||||
|
if (MGrpUpdated && (mgroup.Charset == FTNC_NONE)) {
|
||||||
|
mgroup.Charset = FTNC_LATIN_1;
|
||||||
|
}
|
||||||
fwrite(&mgroup, sizeof(mgroup), 1, fout);
|
fwrite(&mgroup, sizeof(mgroup), 1, fout);
|
||||||
memset(&mgroup, 0, sizeof(mgroup));
|
memset(&mgroup, 0, sizeof(mgroup));
|
||||||
}
|
}
|
||||||
@ -218,51 +221,54 @@ void CloseMGroup(int force)
|
|||||||
|
|
||||||
int AppendMGroup(void)
|
int AppendMGroup(void)
|
||||||
{
|
{
|
||||||
FILE *fil;
|
FILE *fil;
|
||||||
char ffile[PATH_MAX];
|
char ffile[PATH_MAX];
|
||||||
|
|
||||||
sprintf(ffile, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
|
sprintf(ffile, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
|
||||||
if ((fil = fopen(ffile, "a")) != NULL) {
|
if ((fil = fopen(ffile, "a")) != NULL) {
|
||||||
memset(&mgroup, 0, sizeof(mgroup));
|
memset(&mgroup, 0, sizeof(mgroup));
|
||||||
mgroup.StartDate = time(NULL);
|
mgroup.StartDate = time(NULL);
|
||||||
mgroup.LinkSec.level = 1;
|
mgroup.LinkSec.level = 1;
|
||||||
mgroup.LinkSec.flags = 1;
|
mgroup.LinkSec.flags = 1;
|
||||||
fwrite(&mgroup, sizeof(mgroup), 1, fil);
|
mgroup.Charset = FTNC_LATIN_1;
|
||||||
fclose(fil);
|
fwrite(&mgroup, sizeof(mgroup), 1, fil);
|
||||||
MGrpUpdated = 1;
|
fclose(fil);
|
||||||
return 0;
|
MGrpUpdated = 1;
|
||||||
} else
|
return 0;
|
||||||
return -1;
|
} else
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MgScreen(void)
|
void MgScreen(void)
|
||||||
{
|
{
|
||||||
clr_index();
|
clr_index();
|
||||||
set_color(WHITE, BLACK);
|
set_color(WHITE, BLACK);
|
||||||
mvprintw( 5, 2, "9.1 EDIT MESSAGE GROUP");
|
mvprintw( 5, 2, "9.1 EDIT MESSAGE GROUP");
|
||||||
set_color(CYAN, BLACK);
|
set_color(CYAN, BLACK);
|
||||||
mvprintw( 7, 2, "1. Name");
|
mvprintw( 7, 2, "1. Name");
|
||||||
mvprintw( 8, 2, "2. Comment");
|
mvprintw( 8, 2, "2. Comment");
|
||||||
mvprintw( 9, 2, "3. Base path");
|
mvprintw( 9, 2, "3. Base path");
|
||||||
mvprintw(10, 2, "4. Read sec");
|
mvprintw(10, 2, "4. Read sec");
|
||||||
mvprintw(11, 2, "5. Write sec");
|
mvprintw(11, 2, "5. Write sec");
|
||||||
mvprintw(12, 2, "6. Sysop sec");
|
mvprintw(12, 2, "6. Sysop sec");
|
||||||
mvprintw(13, 2, "7. Link sec");
|
mvprintw(13, 2, "7. Link sec");
|
||||||
mvprintw(14, 2, "8. Start at");
|
mvprintw(14, 2, "8. Start at");
|
||||||
mvprintw(15, 2, "9. Net reply");
|
mvprintw(15, 2, "9. Net reply");
|
||||||
mvprintw(16, 2, "10. Users del");
|
mvprintw(16, 2, "10. Users del");
|
||||||
mvprintw(17, 2, "11. Aliases");
|
mvprintw(17, 2, "11. Aliases");
|
||||||
mvprintw(18, 2, "12. Quotes");
|
mvprintw(18, 2, "12. Quotes");
|
||||||
mvprintw(19, 2, "13. Active");
|
mvprintw(19, 2, "13. Active");
|
||||||
|
|
||||||
mvprintw(14,41, "14. Deleted");
|
mvprintw(14,26, "14. Deleted");
|
||||||
mvprintw(15,41, "15. Auto change");
|
mvprintw(15,26, "15. Auto change");
|
||||||
mvprintw(16,41, "16. User change");
|
mvprintw(16,26, "16. User change");
|
||||||
mvprintw(17,41, "17. Use Aka");
|
mvprintw(17,26, "17. Use Aka");
|
||||||
mvprintw(18,41, "18. Uplink");
|
mvprintw(18,26, "18. Uplink");
|
||||||
mvprintw(19,41, "19. Areas");
|
mvprintw(19,26, "19. Areas");
|
||||||
|
|
||||||
|
mvprintw(14,54, "20. Charset");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -292,136 +298,140 @@ int CheckMgroup(void)
|
|||||||
*/
|
*/
|
||||||
int EditMGrpRec(int Area)
|
int EditMGrpRec(int Area)
|
||||||
{
|
{
|
||||||
FILE *fil;
|
FILE *fil;
|
||||||
static char mfile[PATH_MAX], temp[13];
|
static char mfile[PATH_MAX], temp[13];
|
||||||
static long offset;
|
static long offset;
|
||||||
static int i, j, tmp;
|
static int i, j, tmp;
|
||||||
unsigned long crc, crc1;
|
unsigned long crc, crc1;
|
||||||
|
|
||||||
clr_index();
|
clr_index();
|
||||||
working(1, 0, 0);
|
working(1, 0, 0);
|
||||||
IsDoing("Edit MessageGroup");
|
IsDoing("Edit MessageGroup");
|
||||||
|
|
||||||
sprintf(mfile, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
|
sprintf(mfile, "%s/etc/mgroups.temp", getenv("MBSE_ROOT"));
|
||||||
if ((fil = fopen(mfile, "r")) == NULL) {
|
if ((fil = fopen(mfile, "r")) == NULL) {
|
||||||
working(2, 0, 0);
|
working(2, 0, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = sizeof(mgrouphdr) + ((Area -1) * sizeof(mgroup));
|
offset = sizeof(mgrouphdr) + ((Area -1) * sizeof(mgroup));
|
||||||
if (fseek(fil, offset, 0) != 0) {
|
if (fseek(fil, offset, 0) != 0) {
|
||||||
working(2, 0, 0);
|
working(2, 0, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(&mgroup, sizeof(mgroup), 1, fil);
|
fread(&mgroup, sizeof(mgroup), 1, fil);
|
||||||
fclose(fil);
|
fclose(fil);
|
||||||
crc = 0xffffffff;
|
crc = 0xffffffff;
|
||||||
crc = upd_crc32((char *)&mgroup, crc, sizeof(mgroup));
|
crc = upd_crc32((char *)&mgroup, crc, sizeof(mgroup));
|
||||||
MgScreen();
|
MgScreen();
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
set_color(WHITE, BLACK);
|
set_color(WHITE, BLACK);
|
||||||
show_str( 7,16,12, mgroup.Name);
|
show_str( 7,16,12, mgroup.Name);
|
||||||
show_str( 8,16,55, mgroup.Comment);
|
show_str( 8,16,55, mgroup.Comment);
|
||||||
show_str( 9,16,64, mgroup.BasePath);
|
show_str( 9,16,64, mgroup.BasePath);
|
||||||
show_sec( 10,16, mgroup.RDSec);
|
show_sec( 10,16, mgroup.RDSec);
|
||||||
show_sec( 11,16, mgroup.WRSec);
|
show_sec( 11,16, mgroup.WRSec);
|
||||||
show_sec( 12,16, mgroup.SYSec);
|
show_sec( 12,16, mgroup.SYSec);
|
||||||
mvprintw( 13,22, getflag(mgroup.LinkSec.flags, mgroup.LinkSec.notflags));
|
mvprintw( 13,22, getflag(mgroup.LinkSec.flags, mgroup.LinkSec.notflags));
|
||||||
show_int( 14,16, mgroup.StartArea);
|
show_int( 14,16, mgroup.StartArea);
|
||||||
show_int( 15,16, mgroup.NetReply);
|
show_int( 15,16, mgroup.NetReply);
|
||||||
show_bool(16,16, mgroup.UsrDelete);
|
show_bool(16,16, mgroup.UsrDelete);
|
||||||
show_bool(17,16, mgroup.Aliases);
|
show_bool(17,16, mgroup.Aliases);
|
||||||
show_bool(18,16, mgroup.Quotes);
|
show_bool(18,16, mgroup.Quotes);
|
||||||
show_bool(19,16, mgroup.Active);
|
show_bool(19,16, mgroup.Active);
|
||||||
|
|
||||||
show_bool(14,57, mgroup.Deleted);
|
show_bool(14,42, mgroup.Deleted);
|
||||||
show_bool(15,57, mgroup.AutoChange);
|
show_bool(15,42, mgroup.AutoChange);
|
||||||
show_bool(16,57, mgroup.UserChange);
|
show_bool(16,42, mgroup.UserChange);
|
||||||
show_aka( 17,57, mgroup.UseAka);
|
show_aka( 17,42, mgroup.UseAka);
|
||||||
show_aka( 18,57, mgroup.UpLink);
|
show_aka( 18,42, mgroup.UpLink);
|
||||||
show_str( 19,57,12, mgroup.AreaFile);
|
show_str( 19,42,12, mgroup.AreaFile);
|
||||||
|
|
||||||
j = select_menu(19);
|
show_charset(14,70, mgroup.Charset);
|
||||||
switch(j) {
|
|
||||||
case 0: if (!mgroup.StartArea && strlen(mgroup.AreaFile)) {
|
j = select_menu(20);
|
||||||
errmsg("Areas file defined but no BBS start area");
|
switch(j) {
|
||||||
break;
|
case 0: if (!mgroup.StartArea && strlen(mgroup.AreaFile)) {
|
||||||
}
|
errmsg("Areas file defined but no BBS start area");
|
||||||
crc1 = 0xffffffff;
|
break;
|
||||||
crc1 = upd_crc32((char *)&mgroup, crc1, sizeof(mgroup));
|
}
|
||||||
if (crc != crc1) {
|
crc1 = 0xffffffff;
|
||||||
if (yes_no((char *)"Record is changed, save") == 1) {
|
crc1 = upd_crc32((char *)&mgroup, crc1, sizeof(mgroup));
|
||||||
working(1, 0, 0);
|
if (crc != crc1) {
|
||||||
if ((fil = fopen(mfile, "r+")) == NULL) {
|
if (yes_no((char *)"Record is changed, save") == 1) {
|
||||||
WriteError("$Can't reopen %s", mfile);
|
working(1, 0, 0);
|
||||||
working(2, 0, 0);
|
if ((fil = fopen(mfile, "r+")) == NULL) {
|
||||||
return -1;
|
WriteError("$Can't reopen %s", mfile);
|
||||||
}
|
working(2, 0, 0);
|
||||||
fseek(fil, offset, 0);
|
return -1;
|
||||||
fwrite(&mgroup, sizeof(mgroup), 1, fil);
|
|
||||||
fclose(fil);
|
|
||||||
MGrpUpdated = 1;
|
|
||||||
working(6, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IsDoing("Browsing Menu");
|
|
||||||
return 0;
|
|
||||||
case 1: if (CheckMgroup())
|
|
||||||
break;
|
|
||||||
strcpy(mgroup.Name, edit_str(7,16,12, mgroup.Name, (char *)"The ^name^ for this message group"));
|
|
||||||
if (strlen(mgroup.BasePath) == 0) {
|
|
||||||
memset(&temp, 0, sizeof(temp));
|
|
||||||
strcpy(temp, mgroup.Name);
|
|
||||||
for (i = 0; i < strlen(temp); i++) {
|
|
||||||
if (temp[i] == '.')
|
|
||||||
temp[i] = '/';
|
|
||||||
if (isupper(temp[i]))
|
|
||||||
temp[i] = tolower(temp[i]);
|
|
||||||
}
|
}
|
||||||
sprintf(mgroup.BasePath, "%s/var/mail/%s", getenv("MBSE_ROOT"), temp);
|
fseek(fil, offset, 0);
|
||||||
|
fwrite(&mgroup, sizeof(mgroup), 1, fil);
|
||||||
|
fclose(fil);
|
||||||
|
MGrpUpdated = 1;
|
||||||
|
working(6, 0, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
IsDoing("Browsing Menu");
|
||||||
|
return 0;
|
||||||
|
case 1: if (CheckMgroup())
|
||||||
break;
|
break;
|
||||||
case 2: E_STR( 8,16,55, mgroup.Comment, "The ^desription^ for this message group")
|
strcpy(mgroup.Name, edit_str(7,16,12, mgroup.Name, (char *)"The ^name^ for this message group"));
|
||||||
case 3: E_PTH( 9,16,64, mgroup.BasePath, "The ^Base path^ where new JAM areas are created", 0770)
|
if (strlen(mgroup.BasePath) == 0) {
|
||||||
case 4: E_SEC( 10,16, mgroup.RDSec, "9.1.4 MESSAGE GROUP READ SECURITY", MgScreen)
|
memset(&temp, 0, sizeof(temp));
|
||||||
case 5: E_SEC( 11,16, mgroup.WRSec, "9.1.5 MESSAGE GROUP WRITE SECURITY", MgScreen)
|
strcpy(temp, mgroup.Name);
|
||||||
case 6: E_SEC( 12,16, mgroup.SYSec, "9.1.6 MESSAGE GROUP SYSOP SECURITY", MgScreen)
|
for (i = 0; i < strlen(temp); i++) {
|
||||||
case 7: mgroup.LinkSec = edit_asec(mgroup.LinkSec, (char *)"9.1.7 DEFAULT SECURITY FOR NEW AREAS");
|
if (temp[i] == '.')
|
||||||
MgScreen();
|
temp[i] = '/';
|
||||||
break;
|
if (isupper(temp[i]))
|
||||||
case 8: E_INT( 14,16, mgroup.StartArea, "The ^Start area number^ from where to add areas")
|
temp[i] = tolower(temp[i]);
|
||||||
case 9: E_INT( 15,16, mgroup.NetReply, "The ^Area Number^ for netmail replies")
|
}
|
||||||
case 10:E_BOOL(16,16, mgroup.UsrDelete, "Allow users to ^Delete^ their messages")
|
sprintf(mgroup.BasePath, "%s/var/mail/%s", getenv("MBSE_ROOT"), temp);
|
||||||
case 11:E_BOOL(17,16, mgroup.Aliases, "Allow ^Aliases^ or real names only")
|
}
|
||||||
case 12:E_BOOL(18,16, mgroup.Quotes, "Allow random ^quotes^ to new messages")
|
break;
|
||||||
case 13:if (CheckMgroup())
|
case 2: E_STR( 8,16,55, mgroup.Comment, "The ^desription^ for this message group")
|
||||||
break;
|
case 3: E_PTH( 9,16,64, mgroup.BasePath, "The ^Base path^ where new JAM areas are created", 0770)
|
||||||
E_BOOL(19,16, mgroup.Active, "Is this message group ^active^")
|
case 4: E_SEC( 10,16, mgroup.RDSec, "9.1.4 MESSAGE GROUP READ SECURITY", MgScreen)
|
||||||
case 14:if (CheckMgroup())
|
case 5: E_SEC( 11,16, mgroup.WRSec, "9.1.5 MESSAGE GROUP WRITE SECURITY", MgScreen)
|
||||||
break;
|
case 6: E_SEC( 12,16, mgroup.SYSec, "9.1.6 MESSAGE GROUP SYSOP SECURITY", MgScreen)
|
||||||
E_BOOL(14,57, mgroup.Deleted, "Is this group ^Deleted^")
|
case 7: mgroup.LinkSec = edit_asec(mgroup.LinkSec, (char *)"9.1.7 DEFAULT SECURITY FOR NEW AREAS");
|
||||||
case 15:E_BOOL(15,57, mgroup.AutoChange, "^Auto change^ areas from new areas lists")
|
MgScreen();
|
||||||
case 16:tmp = edit_bool(16,57, mgroup.UserChange, (char *)"^Auto add/delete^ areas from downlinks requests");
|
break;
|
||||||
if (tmp && !mgroup.UpLink.zone)
|
case 8: E_INT( 14,16, mgroup.StartArea, "The ^Start area number^ from where to add areas")
|
||||||
errmsg("It looks like you are the toplevel, no Uplink defined");
|
case 9: E_INT( 15,16, mgroup.NetReply, "The ^Area Number^ for netmail replies")
|
||||||
else
|
case 10:E_BOOL(16,16, mgroup.UsrDelete, "Allow users to ^Delete^ their messages")
|
||||||
mgroup.UserChange = tmp;
|
case 11:E_BOOL(17,16, mgroup.Aliases, "Allow ^Aliases^ or real names only")
|
||||||
break;
|
case 12:E_BOOL(18,16, mgroup.Quotes, "Allow random ^quotes^ to new messages")
|
||||||
case 17:tmp = PickAka((char *)"9.1.17", TRUE);
|
case 13:if (CheckMgroup())
|
||||||
if (tmp != -1)
|
break;
|
||||||
memcpy(&mgroup.UseAka, &CFG.aka[tmp], sizeof(fidoaddr));
|
E_BOOL(19,16, mgroup.Active, "Is this message group ^active^")
|
||||||
MgScreen();
|
case 14:if (CheckMgroup())
|
||||||
break;
|
break;
|
||||||
case 18:mgroup.UpLink = PullUplink((char *)"9.1.18");
|
E_BOOL(14,42, mgroup.Deleted, "Is this group ^Deleted^")
|
||||||
MgScreen();
|
case 15:E_BOOL(15,42, mgroup.AutoChange, "^Auto change^ areas from new areas lists")
|
||||||
break;
|
case 16:tmp = edit_bool(16,42, mgroup.UserChange, (char *)"^Auto add/delete^ areas from downlinks requests");
|
||||||
case 19:E_STR( 19,57,12, mgroup.AreaFile, "The name of the ^Areas File^ from the uplink")
|
if (tmp && !mgroup.UpLink.zone)
|
||||||
}
|
errmsg("It looks like you are the toplevel, no Uplink defined");
|
||||||
|
else
|
||||||
|
mgroup.UserChange = tmp;
|
||||||
|
break;
|
||||||
|
case 17:tmp = PickAka((char *)"9.1.17", TRUE);
|
||||||
|
if (tmp != -1)
|
||||||
|
memcpy(&mgroup.UseAka, &CFG.aka[tmp], sizeof(fidoaddr));
|
||||||
|
MgScreen();
|
||||||
|
break;
|
||||||
|
case 18:mgroup.UpLink = PullUplink((char *)"9.1.18");
|
||||||
|
MgScreen();
|
||||||
|
break;
|
||||||
|
case 19:E_STR( 19,42,12, mgroup.AreaFile, "The name of the ^Areas File^ from the uplink")
|
||||||
|
case 20:mgroup.Charset = edit_charset(14, 70, mgroup.Charset);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -667,7 +677,8 @@ int mail_group_doc(FILE *fp, FILE *toc, int page)
|
|||||||
fprintf(fp, " Use aliases %s\n", getboolean(mgroup.Aliases));
|
fprintf(fp, " Use aliases %s\n", getboolean(mgroup.Aliases));
|
||||||
fprintf(fp, " Add quotes %s\n", getboolean(mgroup.Quotes));
|
fprintf(fp, " Add quotes %s\n", getboolean(mgroup.Quotes));
|
||||||
fprintf(fp, " Auto add/del areas %s\n", getboolean(mgroup.AutoChange));
|
fprintf(fp, " Auto add/del areas %s\n", getboolean(mgroup.AutoChange));
|
||||||
fprintf(fp, " user add/del areas %s\n", getboolean(mgroup.UserChange));
|
fprintf(fp, " User add/del areas %s\n", getboolean(mgroup.UserChange));
|
||||||
|
fprintf(fp, " Default charset %s\n", getchrs(mgroup.Charset));
|
||||||
fprintf(fp, " Start area date %s", ctime(&mgroup.StartDate));
|
fprintf(fp, " Start area date %s", ctime(&mgroup.StartDate));
|
||||||
fprintf(fp, " Last active date %s\n", ctime(&mgroup.LastDate));
|
fprintf(fp, " Last active date %s\n", ctime(&mgroup.LastDate));
|
||||||
fprintf(fp, "\n\n");
|
fprintf(fp, "\n\n");
|
||||||
|
@ -420,7 +420,7 @@ int EditNewRec(int Area)
|
|||||||
case 10:E_BOOL(16,18, newfiles.Active, "If this report is ^active^")
|
case 10:E_BOOL(16,18, newfiles.Active, "If this report is ^active^")
|
||||||
case 11:E_BOOL(17,18, newfiles.Deleted, "Is this record ^deleted^")
|
case 11:E_BOOL(17,18, newfiles.Deleted, "Is this record ^deleted^")
|
||||||
case 12:E_BOOL(16,58, newfiles.HiAscii, "Allow ^High ASCII^ in this report")
|
case 12:E_BOOL(16,58, newfiles.HiAscii, "Allow ^High ASCII^ in this report")
|
||||||
case 13:if (E_Group(&fgr, (char *)"12.12 NEWFILE GROUPS"))
|
case 13:if (E_Group(&fgr, (char *)"12.13 NEWFILE GROUPS"))
|
||||||
GrpChanged = TRUE;
|
GrpChanged = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user