From 0e6883b9e56721f77f547d94c9c2938757e27b3b Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Fri, 9 Nov 2001 13:53:19 +0000 Subject: [PATCH] Added posting messages with user alias --- ChangeLog | 4 +- TODO | 6 +- html/programs/mbsebbs.html | 307 +++++++++++++++++++------------------ lang/Language.xref | 2 + lang/dutch.txt | 2 + lang/english.txt | 2 + lang/galego.txt | 2 + lang/italian.txt | 2 + lang/spanish.txt | 2 + mbsebbs/mail.c | 246 +++++++++++++++++------------ 10 files changed, 327 insertions(+), 248 deletions(-) diff --git a/ChangeLog b/ChangeLog index 395624ab..91f85926 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4220,7 +4220,8 @@ v0.33.19 26-Oct-2001 lang: Changed language prompt 71. Added language prompts 472 and 473 for FS editor. - Added language prompts 474 and 475 for address entry. + Added language prompts 474, 475 and 476 for address entry. + Added language prompts 477 and 478 for post with user alias. examples: SAVE: @@ -4253,6 +4254,7 @@ v0.33.19 26-Oct-2001 - Fixed display file with more that stopped after every line. - Added display file "mainlogo" before the "welcome" file. - Added display files "welcome2..9" after "welcome1" file. + Posting message with users alias is now possible. mbtask: Changed to handle the External Doors flag in the lastcaller diff --git a/TODO b/TODO index 98d4f3bb..90eebc66 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +$Id$ + MBSE BBS V0.33.19 TODO list. ---------------------------- @@ -21,7 +23,7 @@ mbsebbs: It works with direct serial connections. Note, this also happens on busy LAN's between Linux boxes with normal xterm's. Note: this problem almost dissapeared after kernel upgrade to - 2.2.16. + 2.2.16. Another note, this does not happen over ssh. L: Must include SEEN-BY and other hidden lines into BlueWave and QWK mail, must be user selectable. see remarks of William McBrine. @@ -35,8 +37,6 @@ mbsebbs: N: Check for tagged files before logoff - N: Can't post messages to users handle. - L: Implement telnet door. L: Spell checker in full screen editor. diff --git a/html/programs/mbsebbs.html b/html/programs/mbsebbs.html index 632d1243..1a036f43 100644 --- a/html/programs/mbsebbs.html +++ b/html/programs/mbsebbs.html @@ -1,149 +1,158 @@ - - - - - - - - -MBSE BBS Programs - mbsebbs - The main BBS program. - - - -
-
Last update 31-Jan-2001
-

 

- -

mbsebbs - The main BBS program

-

- -

Synopsis.

-

-mbsebbs -

 

- -

Description.

-

-mbsebbs is the main bbs program for the users. -To be able to use the bbs, the bbs mustbe set open with mbstat open -or users may not login. This is normally done at system boot. -Also Zone Mail Hour is honored if the user logs in -on a tty that has the honor ZMH flag set to true. If it -is ZMH and the ZMH flag is true, the user will be kicked out of the bbs. You -should only set this flag on the modem lines where you need to be available -for ZMH if your "Fidonet" network requires that. -

-The first visible action is to show the logo.ans file. Because it is not -known who is trying to login, you only need to place this file in the -default language directory. -

-The next check is to see if the user is allowed to login on the tty he -currently is on. -If this tty is not available or is not in your setup, the user is kicked -out. If he is allowed to login, a message is shown at which port he is on, -unless you have turned this feature off in the setup. -

-If a user logs in the first check is if he/she has a Unix account or not. -Unix users bypass the login prompt. Other users will get the normal prompt -the same way DOS based bbs programs do. At that time it is checked if the -user has IEMSI capabilities, if that is true, IEMSI login will be tried. -If the user is not known, the newuser procedure begins. -

-If the user login is successfull, his favourite language will be loaded. -Then it is checked if the user is the Sysop, if so, the Sysop flag is set. -If the user has a blank password, he is asked to create a new password. -Next it is checked if the user has an Unix account, if not he is forced to -create a Unix account. This situation can exist after switching to MBSE BBS -and you have converted your old userbase to the userbase for MBSE BBS. -If the users Date of Birth is invalid, he is forced to enter the right -Date of Birth. -The next check is to see if the user has passed the expiry date, this is a -usefull feature for systems with donating users. -Finally the access limits are set for the user and time remaining for today and -download limits are set. -

-After successfull login the user can be presented with a bunch of advertising -screens. I will only name the screens without filename extension, as these -screens are searched for in the following order;
-

    -
  1. filename.ans in the users favourite language directory. -
  2. filename.ans in the default language directory. -
  3. filename.asc in the users favourite language directory. -
  4. filename.asc in the default language directory. -
  5. If nothing is found, nothing is displayed. -
-welcome. This screen can contain information about the session -the user has, his download limits, time left etc. -

-welcome1 is shown if the user has show bulletins set to true. -

-birthday is shown if the user logs in at his birthday and if he -has show bullentins set to true. -

-dd-mm is shown if dd is the date of today and -mm is the current month and if the user has show bulletins -set to true. -

-sec20 is shown if the user has the security level in the -filename, level 20 in this example. Als the display bulletins must be set to -true. -

-news is shown if the user has the display bulletins set to -true. -

-onceonly is shown only if the user has never seen this screen, -the test is to compare the users last login date against the date of this file. -

-After all these screens the users Offline Reader areas are checked to see if -you as sysop didn't change the message areas. If you made changes, the users -setup is adjusted and he will be notified. This means he sees a list -with deleted areas and new areas. -

-Next if the user has newmail scan set to true all message bases are checked to -see if the user has new mail. This includes a check to see if he has Unix mail. -If there is Unix mail, those mails are retrieved from the POP3 server and stored -in his private mailbox. -If there is new mail for the user, the user sees a list of areas with the messages -in it and he is offered to read and reply these messages. -

-Then if the user has show newfiles set to true and he is not a new bbs user -he will see a list of new files you have on your bbs. During this display -he can tag files for later download. -

-The final setup is to set the users "do not disturb" flag and then the menu -system is started. The menu system will run forever, until the user chooses -to logoff, the connection is lost or his daily timelimit is reached. For the -possibilities and setup of the menus see -MBSE BBS Menu System -

 

- -

Environment.

-

-In order to run mbsebbs you must set the global variable -$MBSE_ROOT. This variable must point to the root directory -of the bbs structure. The main configuration file config.data -must be present in the ~/etc directory. -

-If the environment variable CONNECT is present, a log entry -will be made with the connect speed. -

-If the environment variable CALLER_ID is present, a log entry -will be made with the caller id. -

-If the environment variable LOGNAME is present and it is not -bbs then it is assumed that it is a Unixmode login of the -user who's Unixname is in the LOGNAME environment variable. -This variable is set by the /bin/login program, so users that telnet to your -bbs or login via mgetty and login with their Unixname will -set this. If the LOGNAME is bbs then the -user is prompted to enter his Fidonet style name. By the way, you can change -that default bbs username with mbsetup. -

 

- - -Index Back to index  -Main Back to Main index -

- - - + + + + + + + + +MBSE BBS Programs - mbsebbs - The main BBS program. + + + +
+
Last update 09-Nov-2001
+

 

+ +

mbsebbs - The main BBS program

+

+ +

Synopsis.

+

+mbsebbs +

 

+ +

Description.

+

+mbsebbs is the main bbs program for the users. +To be able to use the bbs, the bbs mustbe set open with mbstat open +or users may not login. This is normally done at system boot. +Also Zone Mail Hour is honored if the user logs in +on a tty that has the honor ZMH flag set to true. If it +is ZMH and the ZMH flag is true, the user will be kicked out of the bbs. You +should only set this flag on the modem lines where you need to be available +for ZMH if your "Fidonet" network requires that. +

+The first visible action is to show the logo.ans file. Because it is not +known who is trying to login, you only need to place this file in the +default language directory. +

+The next check is to see if the user is allowed to login on the tty he +currently is on. +If this tty is not available or is not in your setup, the user is kicked +out. If he is allowed to login, a message is shown at which port he is on, +unless you have turned this feature off in the setup. +

+If a user logs in the first check is if he/she has a Unix account or not. +Unix users bypass the login prompt. Other users will get the normal prompt +the same way DOS based bbs programs do. At that time it is checked if the +user has IEMSI capabilities, if that is true, IEMSI login will be tried. +If the user is not known, the newuser procedure begins. +

+If the user login is successfull, his favourite language will be loaded. +Then it is checked if the user is the Sysop, if so, the Sysop flag is set. +If the user has a blank password, he is asked to create a new password. +Next it is checked if the user has an Unix account, if not he is forced to +create a Unix account. This situation can exist after switching to MBSE BBS +and you have converted your old userbase to the userbase for MBSE BBS. +If the users Date of Birth is invalid, he is forced to enter the right +Date of Birth. +The next check is to see if the user has passed the expiry date, this is a +usefull feature for systems with donating users. +Finally the access limits are set for the user and time remaining for today and +download limits are set. +

+After successfull login the user can be presented with a bunch of advertising +screens. I will only name the screens without filename extension, as these +screens are searched for in the following order;
+

    +
  1. filename.ans in the users favourite language directory. +
  2. filename.ans in the default language directory. +
  3. filename.asc in the users favourite language directory. +
  4. filename.asc in the default language directory. +
  5. If nothing is found, nothing is displayed. +
+mainlogo. Here you can put a logo or something. +welcome. This screen can contain information about the session +the user has, his download limits, time left etc. +

+welcome1 is shown if the user has show bulletins set to true. +welcome2 is shown if the user has show bulletins set to true. +welcome3 is shown if the user has show bulletins set to true. +welcome4 is shown if the user has show bulletins set to true. +welcome5 is shown if the user has show bulletins set to true. +welcome6 is shown if the user has show bulletins set to true. +welcome7 is shown if the user has show bulletins set to true. +welcome8 is shown if the user has show bulletins set to true. +welcome9 is shown if the user has show bulletins set to true. +

+birthday is shown if the user logs in at his birthday and if he +has show bullentins set to true. +

+dd-mm is shown if dd is the date of today and +mm is the current month and if the user has show bulletins +set to true. +

+sec20 is shown if the user has the security level in the +filename, level 20 in this example. Als the display bulletins must be set to +true. +

+news is shown if the user has the display bulletins set to +true. +

+onceonly is shown only if the user has never seen this screen, +the test is to compare the users last login date against the date of this file. +

+After all these screens the users Offline Reader areas are checked to see if +you as sysop didn't change the message areas. If you made changes, the users +setup is adjusted and he will be notified. This means he sees a list +with deleted areas and new areas. +

+Next if the user has newmail scan set to true all message bases are checked to +see if the user has new mail. This includes a check to see if he has Unix mail. +If there is Unix mail, those mails are retrieved from the POP3 server and stored +in his private mailbox. +If there is new mail for the user, the user sees a list of areas with the messages +in it and he is offered to read and reply these messages. +

+Then if the user has show newfiles set to true and he is not a new bbs user +he will see a list of new files you have on your bbs. During this display +he can tag files for later download. +

+The final setup is to set the users "do not disturb" flag and then the menu +system is started. The menu system will run forever, until the user chooses +to logoff, the connection is lost or his daily timelimit is reached. For the +possibilities and setup of the menus see +MBSE BBS Menu System +

 

+ +

Environment.

+

+In order to run mbsebbs you must set the global variable +$MBSE_ROOT. This variable must point to the root directory +of the bbs structure. The main configuration file config.data +must be present in the ~/etc directory. +

+If the environment variable CONNECT is present, a log entry +will be made with the connect speed. +

+If the environment variable CALLER_ID is present, a log entry +will be made with the caller id. +

+If the environment variable LOGNAME is present and it is not +bbs then it is assumed that it is a Unixmode login of the +user who's Unixname is in the LOGNAME environment variable. +This variable is set by the /bin/login program, so users that telnet to your +bbs or login via mgetty and login with their Unixname will +set this. If the LOGNAME is bbs then the +user is prompted to enter his Fidonet style name. By the way, you can change +that default bbs username with mbsetup. +

 

+ + +Index Back to index  +Main Back to Main index +

+ + + diff --git a/lang/Language.xref b/lang/Language.xref index 7e1f5a4e..af64832d 100644 --- a/lang/Language.xref +++ b/lang/Language.xref @@ -475,3 +475,5 @@ 474 newuser.c change.c |Your address, maximum 3 lines (only visible for the sysop): 475 newuser.c change.c |You need to enter your address here 476 change.c |Old address: +477 mail.c |Use your alias ( +478 mail.c YN|) to post this message [Y/n]: diff --git a/lang/dutch.txt b/lang/dutch.txt index bad17a15..a4997c0a 100644 --- a/lang/dutch.txt +++ b/lang/dutch.txt @@ -475,3 +475,5 @@ JN|Bestand meesturen [j/N]: |Geef adres, maximaal 3 regels (alleen zichtbaar voor de sysop): |U moet hier Uw adres opgeven |Oude adres: +|Use your alias ( +YN|) to post this message [Y/n]: diff --git a/lang/english.txt b/lang/english.txt index 9cbc839c..5da47454 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -475,3 +475,5 @@ YN|Attach file [y/N]: |Your address, maximum 3 lines (only visible for the sysop): |You need to enter your address here |Old address: +|Use your alias ( +YN|) to post this message [Y/n]: diff --git a/lang/galego.txt b/lang/galego.txt index aed6fac9..343057bc 100644 --- a/lang/galego.txt +++ b/lang/galego.txt @@ -475,3 +475,5 @@ YN|Adxuntar ficheiro [s/N]: |Your address, maximum 3 lines (only visible for the sysop): |You need to enter your address here |Old address: +|Use your alias ( +YN|) to post this message [Y/n]: diff --git a/lang/italian.txt b/lang/italian.txt index 15e05881..fc62befd 100644 --- a/lang/italian.txt +++ b/lang/italian.txt @@ -475,3 +475,5 @@ SN|Allega file [s/N]: |Your address, maximum 3 lines (only visible for the sysop): |You need to enter your address here |Old address: +|Use your alias ( +YN|) to post this message [Y/n]: diff --git a/lang/spanish.txt b/lang/spanish.txt index 857876b0..08a0e43b 100644 --- a/lang/spanish.txt +++ b/lang/spanish.txt @@ -475,3 +475,5 @@ YN|Adjuntar fichero [s/N]: |Your address, maximum 3 lines (only visible for the sysop): |You need to enter your address here |Old address: +|Use your alias ( +YN|) to post this message [Y/n]: diff --git a/mbsebbs/mail.c b/mbsebbs/mail.c index 5810d940..656609d4 100644 --- a/mbsebbs/mail.c +++ b/mbsebbs/mail.c @@ -1,8 +1,7 @@ /***************************************************************************** * - * File ..................: bbs/mail.c + * $Id$ * Purpose ...............: Message reading and writing. - * Last modification date : 26-Oct-2001 * Todo ..................: Implement message groups. * ***************************************************************************** @@ -132,7 +131,7 @@ int Post_Allowed(void) { if (msgs.MsgKinds == RONLY) { /* Message area is Readonly */ - pout(12, 0, (char *) Language(437)); + pout(LIGHTRED, BLACK, (char *) Language(437)); fflush(stdout); sleep(3); return FALSE; @@ -142,6 +141,41 @@ int Post_Allowed(void) +/* + * Check if Alias is allowed, and if so if the user + * wants to use this in the From: field. + */ +int Alias_Option(void); +int Alias_Option(void) +{ + int rc = TRUE; + + if (!msgs.Aliases) + return FALSE; + if (strlen(exitinfo.sHandle) == 0) + return FALSE; + + /* Use your alias ( */ + pout(CYAN, BLACK, (char *)Language(477)); + pout(CYAN, BLACK, exitinfo.sHandle); + /* YN|) to post this message [Y/n]: */ + pout(CYAN, BLACK, (char *)Language(478)); + colour(CFG.MsgInputColourF, CFG.MsgInputColourB); + fflush(stdout); + alarm_on(); + if (toupper(Getone()) == Keystroke(478, 1)) { + rc = FALSE; + printf("%c", Keystroke(478, 1)); + } else { + printf("%c", Keystroke(478, 0)); + } + Enter(2); + fflush(stdout); + return rc; +} + + + /* * Check if netmail may be send crash or immediate. */ @@ -161,7 +195,7 @@ int Crash_Option(faddr *Dest) if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) { if (Nlent->oflags & OL_CM) { /* Crash [y/N]: */ - pout(3, 0, (char *)Language(461)); + pout(CYAN, BLACK, (char *)Language(461)); colour(CFG.MsgInputColourF, CFG.MsgInputColourB); fflush(stdout); alarm_on(); @@ -172,7 +206,7 @@ int Crash_Option(faddr *Dest) printf("%c", Keystroke(461, 1)); } else { /* Warning: node is not CM, send Immediate [y/N]: */ - pout(3, 0, (char *)Language(462)); + pout(CYAN, BLACK, (char *)Language(462)); colour(CFG.MsgInputColourF, CFG.MsgInputColourB); fflush(stdout); alarm_on(); @@ -203,7 +237,7 @@ int IsPrivate(void) if (msgs.MsgKinds == BOTH) { Enter(1); /* Private [y/N]: */ - pout(3, 0, (char *) Language(163)); + pout(CYAN, BLACK, (char *) Language(163)); fflush(stdout); alarm_on(); if (toupper(Getone()) == Keystroke(163, 0)) { @@ -243,7 +277,7 @@ void Check_Attach(void) while (TRUE) { Enter(1); /* Attach file [y/N]: */ - pout(3, 0, (char *)Language(463)); + pout(CYAN, BLACK, (char *)Language(463)); fflush(stdout); alarm_on(); if (toupper(Getone()) == Keystroke(463, 0)) { @@ -251,7 +285,7 @@ void Check_Attach(void) printf("%c", Keystroke(463, 0)); Enter(1); /* Please enter filename: */ - pout(14, 0, (char *)Language(245)); + pout(YELLOW, BLACK, (char *)Language(245)); colour(CFG.MsgInputColourF, CFG.MsgInputColourB); fflush(stdout); alarm_on(); @@ -372,15 +406,28 @@ void Post_Msg() Msg_New(); - colour(9, 0); + colour(LIGHTBLUE, BLACK); /* Posting message in area: */ printf("\n%s\"%s\"\n", (char *) Language(156), sMsgAreaDesc); - pout(14, 0, (char *) Language(157)); - if (msgs.Type == NEWS) { - if (CFG.EmailMode == E_NOISP) { + if (Alias_Option()) { + /* + * Set Handle + */ + strcpy(Msg.From, exitinfo.sHandle); + tlcap(Msg.From); // Do we want this??? + /* From : */ + pout(YELLOW, BLACK, (char *) Language(157)); + } else { + /* + * Normal from address, no alias + */ + /* From : */ + pout(YELLOW, BLACK, (char *) Language(157)); + if (msgs.Type == NEWS) { + if (CFG.EmailMode != E_PRMISP) { /* - * If not connected to the internet, use Fido style addressing. + * If no internet mail domain, use fidonet addressing. */ Dest = fido2faddr(CFG.EmailFidoAka); strcpy(Msg.From, exitinfo.sUserName); @@ -388,19 +435,25 @@ void Post_Msg() } else { sprintf(Msg.From, "%s@%s (%s)", exitinfo.Name, CFG.sysdomain, exitinfo.sUserName); } - } else { + } else { strcpy(Msg.From, exitinfo.sUserName); tlcap(Msg.From); + } } - colour(CFG.MsgInputColourF, CFG.MsgInputColourB); - printf("%s", Msg.From); + + pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.From); Syslog('b', "Setting From: %s", Msg.From); - if (msgs.Type != NEWS) { + if ((msgs.Type == NEWS) || (msgs.Type == LIST)) { + /* + * Newsmode or maillist mode, automatic addressing to All. + * */ + strcpy(Msg.To, "All"); + } else { while (TRUE) { Enter(1); /* To : */ - pout(14, 0, (char *) Language(158)); + pout(YELLOW, BLACK, (char *) Language(158)); colour(CFG.MsgInputColourF, CFG.MsgInputColourB); Getname(Msg.To, 35); @@ -426,14 +479,14 @@ void Post_Msg() */ if (msgs.Type == LOCALMAIL) { /* Verifying user ... */ - pout(3, 0, (char *) Language(159)); + pout(CYAN, BLACK, (char *) Language(159)); x = CheckUser(Msg.To); } else x = TRUE; } } else if (msgs.Type == NETMAIL) { x = FALSE; - pout(14, 0, (char *)"Address : "); + pout(YELLOW, BLACK, (char *)"Address : "); FidoNode = calloc(61, sizeof(char)); colour(CFG.MsgInputColourF, CFG.MsgInputColourB); GetstrC(FidoNode, 60); @@ -442,7 +495,7 @@ void Post_Msg() point = Dest->point; Dest->point = 0; if (((Nlent = getnlent(Dest)) != NULL) && (Nlent->addr.zone)) { - colour(14, 0); + colour(YELLOW, BLACK); if (point) printf("Boss : "); else @@ -470,7 +523,7 @@ void Post_Msg() } else { Dest->point = point; printf("\r"); - pout(3, 0, (char *) Language(241)); + pout(CYAN, BLACK, (char *) Language(241)); fflush(stdout); alarm_on(); if (toupper(Getone()) == Keystroke(241, 0)) { @@ -489,20 +542,15 @@ void Post_Msg() if(!x) { printf("\r"); /* User not found. Try again, or (Enter) to quit */ - pout(3, 0, (char *) Language(160)); + pout(CYAN, BLACK, (char *) Language(160)); } else break; } - } else { - /* - * Newsmode, automatic addressing to All. - */ - strcpy(Msg.To, "All"); } Enter(1); /* Subject : */ - pout(14, 0, (char *) Language(161)); + pout(YELLOW, BLACK, (char *) Language(161)); colour(CFG.MsgInputColourF, CFG.MsgInputColourB); fflush(stdout); alarm_on(); @@ -512,7 +560,7 @@ void Post_Msg() if((strcmp(Msg.Subject, "")) == 0) { Enter(1); /* Abort Message [y/N] ?: */ - pout(3, 0, (char *) Language(162)); + pout(CYAN, BLACK, (char *) Language(162)); fflush(stdout); alarm_on(); @@ -646,27 +694,28 @@ void ShowMsgHdr() static char Buf1[35], Buf2[35], Buf3[81]; struct tm *tm; time_t now; + int color; Buf1[0] = '\0'; Buf2[0] = '\0'; Buf3[0] = '\0'; clear(); - colour(1,7); + colour(BLUE, LIGHTGRAY); printf(" %-70s", sMsgAreaDesc); - colour(4,7); + colour(RED, LIGHTGRAY); printf("#%-5lu\n", Msg.Id); /* Date : */ - pout(14, 0, (char *) Language(206)); - colour(10, 0); + pout(YELLOW, BLACK, (char *) Language(206)); + colour(GREEN, BLACK); /* Use intermediate variable to prevent SIGBUS on Sparc's */ now = Msg.Written; tm = gmtime(&now); printf("%02d-%02d-%d %02d:%02d:%02d", tm->tm_mday, tm->tm_mon+1, tm->tm_year+1900, tm->tm_hour, tm->tm_min, tm->tm_sec); - colour(12, 0); + colour(LIGHTRED, BLACK); if (Msg.Local) printf(" Local"); if (Msg.Intransit) printf(" Transit"); if (Msg.Private) printf(" Priv."); @@ -701,38 +750,46 @@ void ShowMsgHdr() printf("\n"); /* From : */ - pout(14,0, (char *) Language(209)); - colour(10, 0); + pout(YELLOW, BLACK, (char *) Language(209)); + if (IsMe(Msg.From)) + color = LIGHTGREEN; + else + color = GREEN; + colour(color++, BLACK); printf("%s ", Msg.From); if (iMsgAreaType != LOCALMAIL) { - colour(11, 0); + colour(color, BLACK); printf("(%s)", Msg.FromAddress); } printf("\n"); /* To : */ - pout(14,0, (char *) Language(208)); - colour(10, 0); + pout(YELLOW, BLACK, (char *) Language(208)); + if (IsMe(Msg.To)) + color = LIGHTGREEN; + else + color = GREEN; + colour(color++, BLACK); printf("%s ", Msg.To); if (iMsgAreaType == NETMAIL) { - colour(11, 0); + colour(color, BLACK); printf("(%s)", Msg.ToAddress); } printf("\n"); /* Subject : */ - pout(14,0, (char *) Language(210)); - colour(10, 0); + pout(YELLOW, BLACK, (char *) Language(210)); + colour(GREEN, BLACK); printf("%s\n", Msg.Subject); colour(CFG.HiliteF, CFG.HiliteB); - colour(14, 1); + colour(YELLOW, BLUE); if (Msg.Reply) sprintf(Buf1, "\"+\" %s %lu", (char *)Language(211), Msg.Reply); if (Msg.Original) sprintf(Buf2, " \"-\" %s %lu", (char *)Language(212), Msg.Original); sprintf(Buf3, "%s%s ", Buf1, Buf2); - colour(14, 1); + colour(YELLOW, BLUE); printf("%78s \n", Buf3); } @@ -755,7 +812,7 @@ int Export_a_Msg(unsigned long Num) * The area data is already set, so we can do the next things */ if (MsgBase.Total == 0) { - colour(15, 0); + colour(WHITE, BLACK); /* There are no messages in this area */ printf("\n%s\n\n", (char *) Language(205)); sleep(3); @@ -769,7 +826,7 @@ int Export_a_Msg(unsigned long Num) if (!Msg_ReadHeader(Num)) { perror(""); - colour(15, 0); + colour(WHITE, BLACK); printf("\n%s\n\n", (char *)Language(77)); Msg_Close(); sleep(3); @@ -853,7 +910,7 @@ int Read_a_Msg(unsigned long Num, int UpdateLR) * The area data is already set, so we can do the next things */ if (MsgBase.Total == 0) { - colour(15, 0); + colour(WHITE, BLACK); /* There are no messages in this area */ printf("\n%s\n\n", (char *) Language(205)); sleep(3); @@ -867,7 +924,7 @@ int Read_a_Msg(unsigned long Num, int UpdateLR) if (!Msg_ReadHeader(Num)) { perror(""); - colour(15, 0); + colour(WHITE, BLACK); printf("\n%s\n\n", (char *)Language(77)); Msg_Close(); sleep(3); @@ -1005,7 +1062,8 @@ void Read_Msgs() 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)); + printf("\n%s\"%s\" %s%lu %s", (char *) Language(221), sMsgAreaDesc, + (char *) Language(222), MsgBase.Total, (char *) Language(223)); /* * Check for lastread pointer, suggest lastread number for start. @@ -1027,7 +1085,7 @@ void Read_Msgs() Start = MsgBase.Highest; } - colour(15, 0); + colour(WHITE, BLACK); /* Please enter a message between */ printf("\n%s(%lu - %lu)", (char *) Language(224), MsgBase.Lowest, MsgBase.Highest); /* Message number [ */ @@ -1060,7 +1118,7 @@ int ReadPanel() WhosDoingWhat(READ_POST); - colour(15, 4); + colour(WHITE, RED); if (msgs.UsrDelete || exitinfo.Security.level >= CFG.sysop_access) { /* (A)gain, (N)ext, (L)ast, (R)eply, (E)nter, (D)elete, (Q)uit, e(X)port */ printf("%s", (char *) Language(214)); @@ -1130,7 +1188,7 @@ int ReadPanel() } } else { /* Next */ - pout(15, 0, (char *) Language(216)); + pout(WHITE, BLACK, (char *) Language(216)); if (LastNum < MsgBase.Highest) LastNum++; else @@ -1183,9 +1241,9 @@ void Reply_Msg(int IsReply) x = 0; WhosDoingWhat(READ_POST); clear(); - colour(1,7); + colour(BLUE, LIGHTGRAY); printf(" %-71s", sMsgAreaDesc); - colour(4,7); + colour(RED, LIGHTGRAY); printf("#%-5lu", MsgBase.Highest + 1); colour(CFG.HiliteF, CFG.HiliteB); @@ -1201,21 +1259,21 @@ void Reply_Msg(int IsReply) /* From : */ sprintf(Msg.From, "%s", exitinfo.sUserName); - pout(14, 0, (char *) Language(209)); + pout(YELLOW, BLACK, (char *) Language(209)); pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.From); Enter(1); /* To : */ sprintf(Msg.To, "%s", to); - pout(14, 0, (char *) Language(208)); + pout(YELLOW, BLACK, (char *) Language(208)); pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.To); Enter(1); /* Enter to keep Subject. */ - pout(12, 0, (char *) Language(219)); + pout(LIGHTRED, BLACK, (char *) Language(219)); Enter(1); /* Subject : */ - pout(14, 0, (char *) Language(210)); + pout(YELLOW, BLACK, (char *) Language(210)); sprintf(Msg.Subject, "%s", subj); pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.Subject); @@ -1342,7 +1400,7 @@ void QuickScan_Msgs() if (MsgBase.Total == 0) { Enter(1); /* There are no messages in this area. */ - pout(15, 0, (char *) Language(205)); + pout(WHITE, BLACK, (char *) Language(205)); Enter(3); sleep(3); return; @@ -1350,26 +1408,26 @@ void QuickScan_Msgs() clear(); /* # From To Subject */ - poutCR(14, 1, (char *) Language(220)); + poutCR(YELLOW, BLUE, (char *) Language(220)); if (Msg_Open(sMsgAreaBase)) { for (i = MsgBase.Lowest; i <= MsgBase.Highest; i++) { if (Msg_ReadHeader(i)) { - colour(15, 0); + colour(WHITE, BLACK); printf("%-6lu", Msg.Id); if (IsMe(Msg.From)) - colour(11, 0); + colour(LIGHTCYAN, BLACK); else - colour(3, 0); + colour(CYAN, BLACK); printf("%s ", padleft(Msg.From, 20, ' ')); if (IsMe(Msg.To)) - colour(10, 0); + colour(LIGHTGREEN, BLACK); else - colour(2, 0); + colour(GREEN, BLACK); printf("%s ", padleft(Msg.To, 20, ' ')); - colour(5, 0); + colour(MAGENTA, BLACK); printf("%s", padleft(Msg.Subject, 31, ' ')); printf("\n"); FoundMsg = TRUE; @@ -1383,7 +1441,7 @@ void QuickScan_Msgs() if(!FoundMsg) { Enter(1); /* There are no messages in this area. */ - pout(10, 0, (char *) Language(205)); + pout(LIGHTGREEN, BLACK, (char *) Language(205)); Enter(2); sleep(3); } @@ -1545,13 +1603,13 @@ void MsgArea_List(char *Option) if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active)) { msgs.Name[31] = '\0'; - colour(15,0); + colour(WHITE, BLACK); printf("%5d", Recno + 1); - colour(9,0); + colour(LIGHTBLUE, BLACK); printf(" %c ", 46); - colour(3,0); + colour(CYAN, BLACK); printf("%-31s", msgs.Name); iAreaCount++; @@ -1629,7 +1687,7 @@ void MsgArea_List(char *Option) /* * Invalid area specified - Please try again ... */ - pout(12, 0, (char *) Language(233)); + pout(LIGHTRED, BLACK, (char *) Language(233)); Enter(2); Pause(); fclose(pAreas); @@ -1648,19 +1706,19 @@ void MsgArea_List(char *Option) if((strlen(msgs.Password)) > 2) { Enter(2); /* Please enter Area Password: */ - pout(15, 0, (char *) Language(233)); + pout(WHITE, BLACK, (char *) Language(233)); fflush(stdout); colour(CFG.InputColourF, CFG.InputColourB); GetstrC(temp, 20); if((strcmp(temp, msgs.Password)) != 0) { Enter(1); - pout(15, 0, (char *) Language(234)); + pout(WHITE, BLACK, (char *) Language(234)); Syslog('!', "Incorrect Message Area # %d password given: %s", iMsgAreaNumber, temp); SetMsgArea(iOldArea); } else { Enter(1); - pout(15, 0, (char *) Language(235)); + pout(WHITE, BLACK, (char *) Language(235)); Enter(2); } Pause(); @@ -1679,7 +1737,7 @@ void Delete_MsgNum(unsigned long MsgNum) { int Result = FALSE; - pout(12, 0, (char *) Language(230)); + pout(LIGHTRED, BLACK, (char *) Language(230)); if (Msg_Open(sMsgAreaBase)) { if (Msg_Lock(15L)) { @@ -1772,9 +1830,9 @@ void CheckMail() clear(); /* Checking your mail box ... */ - language(10, 0, 150); + language(LIGHTGREEN, BLACK, 150); Enter(2); - Color = 9; + Color = LIGHTBLUE; fflush(stdout); /* @@ -1791,10 +1849,9 @@ void CheckMail() temp = calloc(PATH_MAX, sizeof(char)); if (exitinfo.Email && strlen(exitinfo.Password)) { check_popmail(exitinfo.Name, exitinfo.Password); - colour(Color, 0); + colour(Color++, BLACK); printf("\re-mail Private e-mail mailbox"); fflush(stdout); - Color++; Count = 0; sprintf(temp, "%s/%s/mailbox", CFG.bbs_usersdir, exitinfo.Name); SetEmailArea((char *)"mailbox"); @@ -1860,10 +1917,10 @@ void CheckMail() SetMsgArea(iMsgAreaNumber); sprintf(temp, "%d", iMsgAreaNumber + 1); colour(Color, 0); - if (Color < 15) + if (Color < WHITE) Color++; else - Color = 9; + Color = LIGHTBLUE; printf("\r%6s %-40s", temp, sMsgAreaDesc); fflush(stdout); Count = 0; @@ -1914,7 +1971,7 @@ void CheckMail() putchar('\r'); if (Found) { - colour(14, 0); + colour(YELLOW, BLACK); /* You have messages, read your mail now? [Y/n]: */ printf("\n%s%d %s", (char *) Language(142), Found, (char *) Language(143)); colour(CFG.InputColourF, CFG.InputColourB); @@ -1963,7 +2020,7 @@ void CheckMail() } } } else { - language(12, 0, 144); + language(LIGHTRED, BLACK, 144); Enter(1); sleep(3); } /* if (Found) */ @@ -1994,7 +2051,7 @@ void MailStatus() OldMsgArea = iMsgAreaNumber; iMsgAreaNumber = 0; clear(); - colour(14, 1); + colour(YELLOW, BLUE); /* Area Type Description Messages Personal */ printf("%-79s", (char *)Language(226)); Enter(1); @@ -2012,16 +2069,16 @@ void MailStatus() case 2: SetEmailArea((char *)"trash"); break; } - colour(12, 0); + colour(LIGHTRED, BLACK); printf(" Email"); - colour(11, 0); + colour(LIGHTCYAN, BLACK); printf(" %-40s", Language(467 + i)); - colour(14, 0); + colour(YELLOW, BLACK); if (EmailBase.Highest) printf(" %8lu", EmailBase.Highest - EmailBase.Lowest + 1); else printf(" 0"); - colour(9, 0); + colour(LIGHTBLUE, BLACK); if (EmailBase.Highest) printf(" %8lu\n", EmailBase.Highest - EmailBase.Lowest + 1); else @@ -2050,9 +2107,9 @@ void MailStatus() if ((msgs.Active) && (exitinfo.Security.level >= msgs.RDSec.level)) { SetMsgArea(iMsgAreaNumber); sprintf(temp, "%d", iMsgAreaNumber + 1); - colour(15, 0); + colour(WHITE, BLACK); printf("%5s", temp); - colour(12, 0); + colour(LIGHTRED, BLACK); switch(msgs.Type) { case LOCALMAIL: printf(" Local"); @@ -2070,7 +2127,7 @@ void MailStatus() printf(" News "); break; } - colour(11, 0); + colour(LIGHTCYAN, BLACK); printf(" %-40s", sMsgAreaDesc); Count = 0; @@ -2084,12 +2141,12 @@ void MailStatus() Msg_Close(); } else WriteError("Error open JAM %s", sMsgAreaBase); - colour(14, 0); + colour(YELLOW, BLACK); if (MsgBase.Highest) printf(" %8lu", MsgBase.Highest - MsgBase.Lowest + 1); else printf(" 0"); - colour(9, 0); + colour(LIGHTBLUE, BLACK); printf(" %8d\n", Count); if (LC(1)) break; @@ -2156,4 +2213,3 @@ void SetMsgArea(unsigned long AreaNum) } -