Fixed deleting messages, added menu item 206

This commit is contained in:
Michiel Broek 2003-02-20 21:06:46 +00:00
parent 6aacdea786
commit 827cbede63
12 changed files with 270 additions and 197 deletions

View File

@ -44,6 +44,7 @@ v0.37.01 14-Jan-2003.
Removed charset conversion/translation.
Added integer endian byteorder swapper, usefull for non-Intel
hardware.
The poutCR function for the bbs never did send a newline.
mbtask:
Arcmail for non-CM nodes and Txx nodes is now sent during the
@ -113,6 +114,10 @@ v0.37.01 14-Jan-2003.
Maybe removed a bug where the bbs sometimes crashed during
mail reading.
Fixed some minor things to the door.sys file.
Normal users were allowed to delete messages of other users,
now only the writer or those with sysop access to the area are
allowed to delete messages.
Finally wrote Delete Message from the menu (menu 206).
examples:
The English and Dutch templates are updated to show the new
@ -121,7 +126,8 @@ v0.37.01 14-Jan-2003.
functions.
lang:
Changed english and dutch language prompts 11, 12, 13 and 107.
Changed english and dutch language prompts 11, 12, 13, 14 and
107.
Changed in other languages as well, but in English.

4
TODO
View File

@ -41,10 +41,6 @@ mbsebbs:
L: ChangeHandle, allow own unix name as handle.
N: Delete messages from the menu.
N: With delete message during reading there is no check.
newuser:
L: Allow handles to be the same as the unixname.

View File

@ -12,7 +12,7 @@
</HEAD>
<BODY>
<BLOCKQUOTE>
<DIV align=right><h5>Last update 08-Feb-2003</h5></DIV>
<DIV align=right><h5>Last update 20-Feb-2003</h5></DIV>
<DIV align=center><h1>MBSE BBS Message Area Menus</h1></DIV>
<hr>
@ -53,7 +53,7 @@
<P>
<LI value="206"><strong>Delete a Message:</strong> This option will let the
user delete a specific message. He must the the owner or recipient of that
user delete a specific message. He must the the owner of that
message or have sysop rights in that area to be able to delete a message.<br>
<strong>Optional data:</strong> None.<br>
<P>

View File

@ -12,7 +12,7 @@
11 mail.c email.c HR|Export to (H)ome or (R)ules directory:
12 mail.c email.c |Message exported to rules directory as
13 dispfile.c |No rules found for this area
14 .c |
14 mail.c |You are not allowed to delete that message
15 .c |
16 .c |
17 .c |
@ -329,7 +329,7 @@
328 bbslist.c | Date of Entry :
329 bbslist.c | Entry Name :
330 bbslist.c |Delete BBS
331 bbslist.c oneline.c |Please enter number to delete:
331 bbslist.c oneline.c mail.c |Please enter number to delete:
332 bbslist.c oneline.c |Record
333 bbslist.c oneline.c |does not belong to you.
334 bbslist.c oneline.c |already marked for deletion

View File

@ -12,7 +12,7 @@ JN|Is Uw naam juist gespeld? [J/n]
HR|Exporteer naar (H)ome of (R)egels directory:
|Bericht geexporteerd naar rules directory als
|Geen regels gevonden voor dit gebied
|Bytes op de rekening
|Je mag dit bericht niet verwijderen
|Tijd gestort vandaag
|Bytes gestort vandaag
|Tijd opgenomen vandaag

View File

@ -12,7 +12,7 @@ YN|Did you spell your name correctly? [Y/n]
HR|Export to (H)ome or (R)ules directory:
|Message exported to rules directory as
|No rules found for this area
|Bytes in account
|You are not allowed to delete that message
|Time deposited today
|Bytes deposited today
|Time withdrawn today

View File

@ -12,7 +12,7 @@ SN|
HR|Export to (H)ome or (R)ules directory:
|Message exported to rules directory as
|No rules found for this area
|Bytes na cuenta :
|You are not allowed to delete that message
|Tempo depositado hoxe :
|Bytes depositados hoxe :
|Tempo retirado hoxe :

View File

@ -12,7 +12,7 @@ JN|Haben Sie Ihren Namen korrekt eingegeben? [J/n]
HR|Export to (H)ome or (R)ules directory:
|Message exported to rules directory as
|No rules found for this area
|Kontostand Daten (KBytes) . . . . :
|You are not allowed to delete that message
|Heute gesparte Zeit . . . . . . . :
|Heute gesparte KBytes . . . . . . :
|Heute abgehobene Zeit . . . . . . :

View File

@ -12,7 +12,7 @@ SN|Hai scritto il tuo nome e cognome correttamente? [S/n]
HR|Export to (H)ome or (R)ules directory:
|Message exported to rules directory as
|No rules found for this area
|Byte disponibili :
|You are not allowed to delete that message
|Tempo depositato oggi:
|Byte depositati oggi :
|Tempo prelevato oggi :

View File

@ -12,7 +12,7 @@ SN|
HR|Export to (H)ome or (R)ules directory:
|Message exported to rules directory as
|No rules found for this area
|Bytes en la cuenta :
|You are not allowed to delete that message
|Tiempo depositado hoy :
|Bytes depositados hoy :
|Tiempo retirado hoy :

View File

@ -87,6 +87,7 @@ void poutCR(int fg, int bg, char *Str)
{
colour(fg, bg);
fputs(Str, stdout);
fprintf(stdout, "\n");
fflush(stdout);
}

View File

@ -1180,14 +1180,19 @@ int ReadPanel()
WhosDoingWhat(READ_POST);
colour(WHITE, RED);
if (msgs.UsrDelete || exitinfo.Security.level >= CFG.sysop_access) {
/*
* The writer of the message, sysops, and who has sysop rights to the message area
* are allowed to delete messages.
*/
if ((msgs.UsrDelete && IsMe(Msg.From)) || (exitinfo.Security.level >= CFG.sysop_access) ||
Access(exitinfo.Security, msgs.SYSec)) {
/* (A)gain, (N)ext, (L)ast, (R)eply, (E)nter, (D)elete, (Q)uit, e(X)port */
printf("%s", (char *) Language(214));
} else {
/* (A)gain, (N)ext, (L)ast, (R)eply, (E)nter, (Q)uit, e(X)port */
printf("%s", (char *) Language(215));
}
if (exitinfo.Security.level >= CFG.sysop_access)
if ((exitinfo.Security.level >= CFG.sysop_access) || Access(exitinfo.Security, msgs.SYSec))
printf(", (!)");
printf(": ");
@ -1196,14 +1201,15 @@ int ReadPanel()
alarm_on();
input = toupper(Getone());
if (input == '!') {
if (exitinfo.Security.level >= CFG.sysop_access) {
if (input == '!') { /* ! Toggle kludges display */
if ((exitinfo.Security.level >= CFG.sysop_access) || Access(exitinfo.Security, msgs.SYSec)) {
if (Kludges)
Kludges = FALSE;
else
Kludges = TRUE;
}
Read_a_Msg(LastNum, TRUE);
} else if (input == Keystroke(214, 0)) { /* (A)gain */
Read_a_Msg(LastNum, TRUE);
@ -1240,6 +1246,8 @@ int ReadPanel()
Read_a_Msg(LastNum, TRUE);
} else if (input == Keystroke(214, 6)) { /* (D)elete */
if ((msgs.UsrDelete && IsMe(Msg.From)) || (exitinfo.Security.level >= CFG.sysop_access) ||
Access(exitinfo.Security, msgs.SYSec)) {
Delete_MsgNum(LastNum);
if (LastNum < MsgBase.Highest) {
LastNum++;
@ -1247,6 +1255,10 @@ int ReadPanel()
} else {
return FALSE;
}
} else {
Read_a_Msg(LastNum, TRUE);
}
} else {
/* Next */
pout(WHITE, BLACK, (char *) Language(216));
@ -1524,7 +1536,7 @@ void QuickScan_Msgs()
Msg_Close();
}
if(!FoundMsg) {
if (!FoundMsg) {
Enter(1);
/* There are no messages in this area. */
pout(LIGHTGREEN, BLACK, (char *) Language(205));
@ -1543,6 +1555,66 @@ void QuickScan_Msgs()
*/
void Delete_Msg()
{
char *temp;
unsigned long Msgnum = 0L;
WhosDoingWhat(READ_POST);
/*
* The area data is already set, so we can do the next things
*/
if (MsgBase.Total == 0) {
colour(WHITE, BLACK);
/* There are no messages in this area */
printf("\n%s\n\n", (char *) Language(205));
sleep(3);
return;
}
colour(CFG.TextColourF, CFG.TextColourB);
/* Message area \"%s\" contains %lu messages. */
printf("\n%s\"%s\" %s%lu %s", (char *) Language(221), sMsgAreaDesc,
(char *) Language(222), MsgBase.Total, (char *) Language(223));
colour(WHITE, BLACK);
/* Please enter a message between */
printf("\n%s(%lu - %lu): ", (char *) Language(224), MsgBase.Lowest, MsgBase.Highest);
temp = calloc(81, sizeof(char));
colour(CFG.InputColourF, CFG.InputColourB);
GetstrC(temp, 10);
if ((strcmp(temp, "")) != 0)
Msgnum = atoi(temp);
free(temp);
if (!Msg_Open(sMsgAreaBase)) {
WriteError("Error open JAM base %s", sMsgAreaBase);
return;
}
if (!Msg_ReadHeader(Msgnum)) {
perror("");
colour(WHITE, BLACK);
/* Message doesn't exist */
printf("\n%s\n\n", (char *)Language(77));
Msg_Close();
sleep(3);
return;
}
Msg_Close();
/*
* Message does exist and a valid number is suplied, check and finally mark the message deleted.
*/
if ((msgs.UsrDelete && IsMe(Msg.From)) || (exitinfo.Security.level >= CFG.sysop_access) ||
Access(exitinfo.Security, msgs.SYSec)) {
Delete_MsgNum(Msgnum);
} else {
colour(LIGHTRED, BLACK);
printf("\n%s\n\n", (char *)Language(14));
}
sleep(3);
return;
}
@ -1933,13 +2005,11 @@ void MsgArea_List(char *Option)
/*
* Function deletes a specified message.
*/
void Delete_MsgNum(unsigned long MsgNum)
{
int Result = FALSE;
/* Deleting message */
pout(LIGHTRED, BLACK, (char *) Language(230));
if (Msg_Open(sMsgAreaBase)) {