Small fixes

This commit is contained in:
Michiel Broek 2003-02-18 19:58:52 +00:00
parent 00b30215f2
commit c5d2ce9327
4 changed files with 334 additions and 305 deletions

View File

@ -30,6 +30,8 @@ v0.37.01 14-Jan-2003.
installed.
Documented menu 318, was present for a long time, just not in
the html docs.
The main Makefile now sets each txtfiles directory to mode 775
to allow doors to write ansi/ascii screens.
nodelist.a:
Added experimental support for IP nodes lookup using a default
@ -108,6 +110,8 @@ v0.37.01 14-Jan-2003.
Fixed send online message to send to user real names, handles
and unix names again.
The menus are machine endian independant.
Maybe removed a bug where the bbs sometimes crashed during
mail reading.
examples:
The English and Dutch templates are updated to show the new

View File

@ -82,6 +82,7 @@ install:
mkdir ${PREFIX}/dutch/macro ; \
${CHOWN} -R ${OWNER}:${GROUP} ${PREFIX}/dutch ; \
fi
@chmod 0775 ${PREFIX}/dutch/txtfiles
@if [ ! -d ${PREFIX}/english ] ; then \
mkdir ${PREFIX}/english ; \
mkdir ${PREFIX}/english/txtfiles ; \
@ -89,6 +90,7 @@ install:
mkdir ${PREFIX}/english/macro ; \
${CHOWN} -R ${OWNER}:${GROUP} ${PREFIX}/english ; \
fi
@chmod 0775 ${PREFIX}/english/txtfiles
@if [ ! -d ${PREFIX}/italian ] ; then \
mkdir ${PREFIX}/italian ; \
mkdir ${PREFIX}/italian/txtfiles ; \
@ -96,6 +98,7 @@ install:
mkdir ${PREFIX}/italian/macro ; \
${CHOWN} -R ${OWNER}:${GROUP} ${PREFIX}/italian ; \
fi
@chmod 0775 ${PREFIX}/italian/txtfiles
@if [ ! -d ${PREFIX}/spanish ] ; then \
mkdir ${PREFIX}/spanish ; \
mkdir ${PREFIX}/spanish/txtfiles ; \
@ -103,6 +106,7 @@ install:
mkdir ${PREFIX}/spanish/macro ; \
${CHOWN} -R ${OWNER}:${GROUP} ${PREFIX}/spanish ; \
fi
@chmod 0775 ${PREFIX}/spanish/txtfiles
@if [ ! -d ${PREFIX}/galego ] ; then \
mkdir ${PREFIX}/galego ; \
mkdir ${PREFIX}/galego/txtfiles ; \
@ -110,6 +114,7 @@ install:
mkdir ${PREFIX}/galego/macro ; \
${CHOWN} -R ${OWNER}:${GROUP} ${PREFIX}/galego ; \
fi
@chmod 0775 ${PREFIX}/galego/txtfiles
@if [ ! -d ${PREFIX}/german ] ; then \
mkdir ${PREFIX}/german; \
mkdir ${PREFIX}/german/txtfiles ; \
@ -117,6 +122,7 @@ install:
mkdir ${PREFIX}/german/macro ; \
${CHOWN} -R ${OWNER}:${GROUP} ${PREFIX}/german; \
fi
@chmod 0775 ${PREFIX}/german/txtfiles
@if [ ! -d ${PREFIX}/ftp ] ; then \
mkdir ${PREFIX}/ftp ; \
mkdir ${PREFIX}/ftp/pub ; \

1
TODO
View File

@ -41,6 +41,7 @@ mbsebbs:
L: ChangeHandle, allow own unix name as handle.
N: Delete messages.
newuser:
L: Allow handles to be the same as the unixname.

View File

@ -1602,17 +1602,14 @@ int CheckLine(int FG, int BG, int Email)
void MsgArea_List(char *Option)
{
FILE *pAreas;
int iAreaCount = 6, Recno = 0;
int iOldArea = 0, iAreaNum = 0;
int iAreaCount = 6, Recno = 0, iOldArea = 0, iAreaNum = 0, loopcount = 0;
int iGotArea = FALSE; /* Flag to check if user typed in area */
int iCheckNew = FALSE; /* Flag to check for new mail in area */
long offset;
char *temp;
lastread LR;
int loopcount=0;
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp,"%s/etc/mareas.data", getenv("MBSE_ROOT"));
/*
@ -1620,10 +1617,9 @@ void MsgArea_List(char *Option)
*/
iOldArea = iMsgAreaNumber;
if(( pAreas = fopen(temp, "rb")) == NULL) {
WriteError("Can't open msg areas file: %s", temp);
if ((pAreas = fopen(temp, "rb")) == NULL) {
WriteError("$Can't open %s", temp);
free(temp);
fclose(pAreas);
return;
}
@ -1645,106 +1641,123 @@ void MsgArea_List(char *Option)
if (strcmp(Option, "N") == 0) {
iCheckNew = TRUE;
} else {
if (strcmp(Option, "U+") == 0)
if (strcmp(Option, "U+") == 0) {
while(TRUE) {
iMsgAreaNumber++;
if (iMsgAreaNumber >= iAreaNum) {
iMsgAreaNumber = 0;
loopcount++;
if ( loopcount > 1 ) {
if (loopcount > 1) {
/* No more areas with unread messages */
pout(LIGHTRED, BLACK, (char *) Language(479));
iMsgAreaNumber = iOldArea;
Enter(2);
Pause();
free(temp);
fclose(pAreas);
return;
}
}
offset = msgshdr.hdrsize + (iMsgAreaNumber * (msgshdr.recsize + msgshdr.syssize));
if(fseek(pAreas, offset, 0) != 0) {
printf("Can't move pointer there.");
if (fseek(pAreas, offset, 0) != 0) {
WriteError("$Can't move pointer in %s", temp);
}
fread(&msgs, msgshdr.recsize, 1, pAreas);
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0)) {
if(Msg_Open(msgs.Base)){
if (Msg_Open(msgs.Base)) {
MsgBase.Highest = Msg_Highest();
LR.UserID = grecno;
if ( Msg_GetLastRead(&LR) != TRUE ){
if (Msg_GetLastRead(&LR) != TRUE) {
LR.HighReadMsg = 0;
}
if (MsgBase.Highest > LR.HighReadMsg )
if (MsgBase.Highest > LR.HighReadMsg) {
Msg_Close();
break;
}
Msg_Close();
}
}
}
}
if (strcmp(Option, "U-") == 0)
if (strcmp(Option, "U-") == 0) {
while(TRUE) {
iMsgAreaNumber--;
if (iMsgAreaNumber < 0) {
iMsgAreaNumber = iAreaNum - 1;
loopcount++;
if ( loopcount > 1 ) {
if (loopcount > 1) {
/* No more areas with unread messages */
pout(LIGHTRED, BLACK, (char *) Language(479));
iMsgAreaNumber = iOldArea;
Enter(2);
Pause();
fclose(pAreas);
free(temp);
return;
}
}
offset = msgshdr.hdrsize + (iMsgAreaNumber * (msgshdr.recsize + msgshdr.syssize));
if(fseek(pAreas, offset, 0) != 0) {
printf("Can't move pointer there.");
if (fseek(pAreas, offset, 0) != 0) {
WriteError("$Can't move pointer in %s", temp);
}
fread(&msgs, msgshdr.recsize, 1, pAreas);
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0)) {
if(Msg_Open(msgs.Base)){
if (Msg_Open(msgs.Base)) {
MsgBase.Highest = Msg_Highest();
LR.UserID = grecno;
if ( Msg_GetLastRead(&LR) != TRUE ){
if (Msg_GetLastRead(&LR) != TRUE ){
LR.HighReadMsg = 0;
}
if (MsgBase.Highest > LR.HighReadMsg )
if (MsgBase.Highest > LR.HighReadMsg) {
Msg_Close();
break;
}
Msg_Close();
}
}
}
}
if (strcmp(Option, "M+") == 0)
while(TRUE) {
if (strcmp(Option, "M+") == 0) {
while (TRUE) {
iMsgAreaNumber++;
if (iMsgAreaNumber >= iAreaNum)
if (iMsgAreaNumber >= iAreaNum) {
iMsgAreaNumber = 0;
}
offset = msgshdr.hdrsize + (iMsgAreaNumber * (msgshdr.recsize + msgshdr.syssize));
if(fseek(pAreas, offset, 0) != 0) {
printf("Can't move pointer there.");
WriteError("$Can't move pointer in %s", temp);
}
fread(&msgs, msgshdr.recsize, 1, pAreas);
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0))
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0)) {
break;
}
}
}
if (strcmp(Option, "M-") == 0)
while(TRUE) {
if (strcmp(Option, "M-") == 0) {
while (TRUE) {
iMsgAreaNumber--;
if (iMsgAreaNumber < 0)
if (iMsgAreaNumber < 0) {
iMsgAreaNumber = iAreaNum -1;
}
offset = msgshdr.hdrsize + (iMsgAreaNumber * (msgshdr.recsize + msgshdr.syssize));
if(fseek(pAreas, offset, 0) != 0) {
printf("Can't move pointer there.");
if (fseek(pAreas, offset, 0) != 0) {
WriteError("$Can't move pointer in %s", temp);
}
fread(&msgs, msgshdr.recsize, 1, pAreas);
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0))
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0)) {
break;
}
}
}
SetMsgArea(iMsgAreaNumber);
Syslog('+', "Msg area %lu %s", iMsgAreaNumber, sMsgAreaDesc);
@ -1756,6 +1769,7 @@ void MsgArea_List(char *Option)
clear();
Enter(1);
/* Message Areas */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(231));
Enter(2);
@ -1774,24 +1788,24 @@ void MsgArea_List(char *Option)
colour(LIGHTBLUE, BLACK);
/* Check for New Mail if N was put on option data */
if ( iCheckNew ) {
if(Msg_Open(msgs.Base)){
if (iCheckNew) {
if (Msg_Open(msgs.Base)) {
MsgBase.Highest = Msg_Highest();
LR.UserID = grecno;
if ( Msg_GetLastRead(&LR) != TRUE ){
if (Msg_GetLastRead(&LR) != TRUE) {
LR.HighReadMsg = 0;
}
if (MsgBase.Highest > LR.HighReadMsg ) {
colour(YELLOW, BLACK);
printf(" %c ", 42 );
pout(YELLOW, BLACK, (char *)" * ");
} else {
printf(" %c ", 46 );
printf(" . ");
}
Msg_Close();
} else {
printf(" . ");
}
} else {
printf(" %c ", 46 );
}
} else {
printf(" %c ", 46);
printf(" . ");
}
colour(CYAN, BLACK);
@ -1807,7 +1821,7 @@ void MsgArea_List(char *Option)
Recno++;
if((iAreaCount / 2) == exitinfo.iScreenLen) {
if ((iAreaCount / 2) == exitinfo.iScreenLen) {
/* More (Y/n/=/Area #): */
pout(CFG.MoreF, CFG.MoreB, (char *) Language(207));
/*
@ -1835,6 +1849,7 @@ void MsgArea_List(char *Option)
*/
if (!iGotArea) {
Enter(1);
/* Select Area: */
pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(232));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(temp, 80);
@ -1845,6 +1860,7 @@ void MsgArea_List(char *Option)
*/
if ((strcmp(temp, "")) == 0) {
fclose(pAreas);
free(temp);
return;
}
iMsgAreaNumber = atoi(temp);
@ -1857,8 +1873,8 @@ void MsgArea_List(char *Option)
iMsgAreaNumber = 0;
offset = msgshdr.hdrsize + (iMsgAreaNumber * (msgshdr.recsize + msgshdr.syssize));
if(fseek(pAreas, offset, 0) != 0) {
printf("Can't move pointer there.");
if (fseek(pAreas, offset, 0) != 0) {
WriteError("$Can't move pointer in mareas.data.");
}
fread(&msgs, msgshdr.recsize, 1, pAreas);
@ -1888,7 +1904,7 @@ void MsgArea_List(char *Option)
/*
* Check if msg area has a password, if it does ask user for it
*/
if((strlen(msgs.Password)) > 2) {
if ((strlen(msgs.Password)) > 2) {
Enter(2);
/* Please enter Area Password: */
pout(WHITE, BLACK, (char *) Language(233));
@ -1896,13 +1912,15 @@ void MsgArea_List(char *Option)
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(temp, 20);
if((strcmp(temp, msgs.Password)) != 0) {
if ((strcmp(temp, msgs.Password)) != 0) {
Enter(1);
/* Password is incorrect */
pout(WHITE, BLACK, (char *) Language(234));
Syslog('!', "Incorrect Message Area # %d password given: %s", iMsgAreaNumber, temp);
SetMsgArea(iOldArea);
} else {
Enter(1);
/* Password is correct */
pout(WHITE, BLACK, (char *) Language(235));
Enter(2);
}