diff --git a/ChangeLog b/ChangeLog index 760ea176..056ff0f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,11 +12,21 @@ v0.81.0 07-Oct-2005 mbsebbs: Automatic dynamic detection of the users screensize. + There is no check anymore for a valid tty with network calls, + instead a fake ttyinfo record is created. Modem/ISDN and + console still need a valid configured tty. + + mbnewusr: + There is no check anymore for a valid tty with network calls, + instead a fake ttyinfo record is created. Modem/ISDN and + console still need a valid configured tty. mbsetup: Removed settings for users screenlength. lang: Removed prompts 64, 80 and 81. + Changed prompt 348. + Added prompt 31. examples: removed Change Screenlength from the English menus and diff --git a/lang/Language.xref b/lang/Language.xref index 4e729fc9..1de10e39 100644 --- a/lang/Language.xref +++ b/lang/Language.xref @@ -29,7 +29,7 @@ 28 page.c |Enter a short reason for chat 29 chat.c |The Sysop cannot use the bbs to chat! Use mbmon to chat 30 chat.c |Sorry, the chatserver is not available -31 .c | +31 mbsebbs.c |line 32 .c | 33 .c | 34 .c | @@ -346,7 +346,7 @@ 345 oneline.c | # A Date User Description 346 oneline.c | # Description 347 oneline.c |Please enter number to list: -348 mbsebbs.c |Connected on port +348 mbsebbs.c |Connected from 349 file.c |File(s) : 350 file.c |Size : 351 file.c |Protocol : diff --git a/lang/chinese.txt b/lang/chinese.txt index d4048368..9b0ed226 100644 --- a/lang/chinese.txt +++ b/lang/chinese.txt @@ -29,7 +29,7 @@ YN|Check for new files at login [Y/n]: |Enter a short reason for chat |The Sysop cannot use the bbs to chat! Use mbmon to chat |Sorry, the chatserver is not available -| +|line | | | @@ -346,7 +346,7 @@ YN|View this BBS? [Y/n]: | # A Date User Description | # Description |Please enter number to list: -|Connected on port +|Connected from |File(s) : |Size : |Protocol : diff --git a/lang/dutch.txt b/lang/dutch.txt index 9fa1d6c3..61cfabe3 100644 --- a/lang/dutch.txt +++ b/lang/dutch.txt @@ -29,7 +29,7 @@ JN|Kijk voor nieuwe bestanden tijdens login [J/n]: |Geef een korte reden om te kletsen |De sysop kan niet kletsen via het bbs! Gebruik mbmon |Sorry, de chatserver is niet beschikbaar -| +|lijn | | | @@ -346,7 +346,7 @@ JN|Bekijk dit BBS? [J/n]: | # A Datum Gebruiker Omschrijving | # Omschrijving |Geef nummer om te bekijken: -|Verbonden via poort +|Verbonden vanaf |Bestand(en): |Grootte : |Protocol : diff --git a/lang/english.txt b/lang/english.txt index 3cbedccf..2a1ddbf0 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -29,7 +29,7 @@ YN|Check for new files at login [Y/n]: |Enter a short reason for chat |The Sysop cannot use the bbs to chat! Use mbmon to chat |Sorry, the chatserver is not available -| +|line | | | @@ -346,7 +346,7 @@ YN|View this BBS? [Y/n]: | # A Date User Description | # Description |Please enter number to list: -|Connected on port +|Connected from |File(s) : |Size : |Protocol : diff --git a/lang/french.txt b/lang/french.txt index 1c396ea2..e006e0ea 100644 --- a/lang/french.txt +++ b/lang/french.txt @@ -29,7 +29,7 @@ YN|Check for new files at login [Y/n]: |Enter a short reason for chat |The Sysop cannot use the bbs to chat! Use mbmon to chat |Sorry, the chatserver is not available -| +|line | | | @@ -346,7 +346,7 @@ YN|View this BBS? [Y/n]: | # A Date User Description | # Description |Please enter number to list: -|Connected on port +|Connected from |File(s) : |Size : |Protocol : diff --git a/lang/galego.txt b/lang/galego.txt index 7aa74295..e6764b44 100644 --- a/lang/galego.txt +++ b/lang/galego.txt @@ -29,7 +29,7 @@ YN|Check for new files at login [Y/n]: |Enter a short reason for chat |The Sysop cannot use the bbs to chat! Use mbmon to chat |Sorry, the chatserver is not available -| +|line | | | @@ -346,7 +346,7 @@ SN| BBS? [S/n]: |n A Fecha Usuario Descripcin | # Descripcin |Teclee nmero a listar: -|Conectado no porto +|Connected from |Ficheiros : |Tamao : |Protocolo : diff --git a/lang/german.txt b/lang/german.txt index 5fb6d84e..441ea4ce 100644 --- a/lang/german.txt +++ b/lang/german.txt @@ -29,7 +29,7 @@ YN|Check for new files at login [Y/n]: |Enter a short reason for chat |The Sysop cannot use the bbs to chat! Use mbmon to chat |Sorry, the chatserver is not available -| +|line | | | @@ -346,7 +346,7 @@ JN|BBS-Details anzeigen ? [J/n]: | # A Datum User Beschreibung | # Beschreibung |Bitte aufzulistende Nummer eingeben: -|Verbunden an Port +|Verbunden von |Datei(en) : |Groesse : |Protokoll : diff --git a/lang/germandu.txt b/lang/germandu.txt index 158cb2b6..b02ab2e2 100644 --- a/lang/germandu.txt +++ b/lang/germandu.txt @@ -29,7 +29,7 @@ YN|Check for new files at login [Y/n]: |Enter a short reason for chat |The Sysop cannot use the bbs to chat! Use mbmon to chat |Sorry, the chatserver is not available -| +|line | | | @@ -346,7 +346,7 @@ JN|BBS-Details anzeigen ? [a/ein]: | # A Datum User Beschreibung | # Beschreibung |Bitte aufzulistende Nummer eingeben: -|Verbunden an Port +|Verbunden von |Datei(en) : |Groesse : |Protokoll : diff --git a/lang/spanish.txt b/lang/spanish.txt index 173e3db7..e9cdb22e 100644 --- a/lang/spanish.txt +++ b/lang/spanish.txt @@ -29,7 +29,7 @@ YN|Check for new files at login [Y/n]: |Enter a short reason for chat |The Sysop cannot use the bbs to chat! Use mbmon to chat |Sorry, the chatserver is not available -| +|line | | | @@ -346,7 +346,7 @@ SN| |n A Fecha Usuario Descripcin | # Descripcin |Teclee nmero a listar: -|Conectado en puerto +|Connected from |Ficheros : |Tamao : |Protocolo : diff --git a/mbsebbs/change.c b/mbsebbs/change.c index f024bc7e..07ce86c6 100644 --- a/mbsebbs/change.c +++ b/mbsebbs/change.c @@ -45,10 +45,6 @@ #include "ttyio.h" -extern int cols; -extern int rows; - - int Chg_Language(int NewMode) { diff --git a/mbsebbs/chat.c b/mbsebbs/chat.c index 63873e53..46cbc406 100644 --- a/mbsebbs/chat.c +++ b/mbsebbs/chat.c @@ -43,9 +43,11 @@ #include "timeout.h" +#define RBUFLEN 81 + int chat_with_sysop = FALSE; /* Global sysop chat flag */ int chatting = FALSE; /* Global chatting flag */ -char rbuf[50][81]; /* Chat receive buffer */ /* FIXME: must be a dynamic buffer */ +char rbuf[50][RBUFLEN]; /* Chat receive buffer */ /* FIXME: must be a dynamic buffer */ int rpointer = 0; /* Chat receive pointer */ int rsize = 5; /* Chat receive size */ extern pid_t mypid; @@ -126,7 +128,7 @@ void DispMsg(char *msg) { int i; - strncpy(rbuf[rpointer], msg, 81); + strncpy(rbuf[rpointer], msg, RBUFLEN); Showline(2 + rpointer, 1, rbuf[rpointer]); if (rpointer == rsize) { /* @@ -135,7 +137,7 @@ void DispMsg(char *msg) for (i = 0; i <= rsize; i++) { locate(i + 2, 1); clrtoeol(); - snprintf(rbuf[i], 81, "%s", rbuf[i+1]); + snprintf(rbuf[i], RBUFLEN, "%s", rbuf[i+1]); Showline(i + 2, 1, rbuf[i]); } } else { diff --git a/mbsebbs/mbnewusr.c b/mbsebbs/mbnewusr.c index 0431c4cc..19a94e78 100644 --- a/mbsebbs/mbnewusr.c +++ b/mbsebbs/mbnewusr.c @@ -127,8 +127,6 @@ int main(int argc, char **argv) if ((p = getenv("CALLER_ID")) != NULL) if (strncmp(p, "none", 4)) Syslog('+', "CALLER %s", p); - if ((p = getenv("REMOTEHOST")) != NULL) - Syslog('+', "REMOTEHOST %s", p); if ((p = getenv("TERM")) != NULL) Syslog('+', "TERM=%s %dx%d", p, cols, rows); else @@ -188,43 +186,60 @@ int main(int argc, char **argv) pout(WHITE, BLACK, (char *)COPYRIGHT); Enter(2); - /* - * Check if this port is available. - */ - snprintf(temp, PATH_MAX, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT")); - - if ((pTty = fopen(temp, "r")) == NULL) { - WriteError("Can't read %s", temp); - } else { - fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, pTty); - - while (fread(&ttyinfo, ttyinfohdr.recsize, 1, pTty) == 1) { - if (strcmp(ttyinfo.tty, pTTY) == 0) - break; - } - fclose(pTty); - - if ((strcmp(ttyinfo.tty, pTTY) != 0) || (!ttyinfo.available)) { - Syslog('+', "No BBS allowed on port \"%s\"", pTTY); - PUTSTR((char *)"No BBS on this port allowed!"); - Enter(2); - Fast_Bye(MBERR_OK); - } - - /* - * Ask whether to display Connect String + if ((p = getenv("REMOTEHOST")) != NULL) { + /* + * Network connection, no tty checking but fill a ttyinfo record. */ - if (CFG.iConnectString) { - /* Connected on port */ - snprintf(temp, 81, "%s\"%s\" ", (char *) Language(348), ttyinfo.comment); - pout(CYAN, BLACK, temp); - /* on */ - snprintf(temp, 81, "%s %s", (char *) Language(135), ctime(<ime)); - PUTSTR(temp); - Enter(1); + memset(&ttyinfo, 0, sizeof(ttyinfo)); + snprintf(ttyinfo.comment, 41, "%s", p); + snprintf(ttyinfo.tty, 7, "%s", pTTY); + snprintf(ttyinfo.speed, 21, "10 mbit"); + snprintf(ttyinfo.flags, 31, "IBN,IFC,XX"); + ttyinfo.type = NETWORK; + ttyinfo.available = TRUE; + snprintf(ttyinfo.name, 36, "Network port #%d", iNode); + } else { + /* + * Check if this port is available. + */ + snprintf(temp, PATH_MAX, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT")); + + if ((pTty = fopen(temp, "r")) == NULL) { + WriteError("Can't read %s", temp); + } else { + fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, pTty); + + while (fread(&ttyinfo, ttyinfohdr.recsize, 1, pTty) == 1) { + if (strcmp(ttyinfo.tty, pTTY) == 0) + break; + } + fclose(pTty); + + if ((strcmp(ttyinfo.tty, pTTY) != 0) || (!ttyinfo.available)) { + Syslog('+', "No BBS allowed on port \"%s\"", pTTY); + PUTSTR((char *)"No BBS on this port allowed!"); + Enter(2); + Fast_Bye(MBERR_OK); + } } } + /* + * Ask whether to display Connect String + */ + if (CFG.iConnectString) { + /* Connected from */ + snprintf(temp, 81, "%s\"%s\" ", (char *) Language(348), ttyinfo.comment); + pout(CYAN, BLACK, temp); + /* line */ + snprintf(temp, 81, "%s%d ", (char *) Language(31), iNode); + pout(CYAN, BLACK, temp); + /* on */ + snprintf(temp, 81, "%s %s", (char *) Language(135), ctime(<ime)); + PUTSTR(temp); + Enter(1); + } + alarm_on(); Pause(); diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index 55d862b3..7f4453a3 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -120,8 +120,6 @@ int main(int argc, char **argv) if ((p = getenv("CALLER_ID")) != NULL) if (strncmp(p, "none", 4)) Syslog('+', "CALLER_ID %s", p); - if ((p = getenv("REMOTEHOST")) != NULL) - Syslog('+', "REMOTEHOST %s", p); if ((p = getenv("TERM")) != NULL) Syslog('+', "TERM=%s %dx%d", p, cols, rows); else @@ -137,7 +135,7 @@ int main(int argc, char **argv) InitLanguage(); InitMenu(); memset(&MsgBase, 0, sizeof(MsgBase)); - + i = getpid(); if ((tty = ttyname(0)) == NULL) { @@ -188,7 +186,19 @@ int main(int argc, char **argv) snprintf(temp, 81, "MBSE BBS v%s (Release: %s) on %s/%s", VERSION, ReleaseDate, OsName(), OsCPU()); poutCR(YELLOW, BLACK, temp); pout(WHITE, BLACK, (char *)COPYRIGHT); - Enter(2); + + /* + * Check and report screens that are too small + */ + if ((cols < 80) || (rows < 24)) { + snprintf(temp, 81, "Your screen is set to %dx%d, we use 80x24 at least", cols, rows); + poutCR(LIGHTRED, BLACK, temp); + Enter(1); + cols = 80; + rows = 24; + } else { + Enter(2); + } /* * Check users homedirectory, some *nix systems let users in if no @@ -202,50 +212,65 @@ int main(int argc, char **argv) Quick_Bye(MBERR_OK); } - /* - * Check if this port is available. In iNode we set a fake - * line number, this will be used by doors. - */ - snprintf(temp, PATH_MAX, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT")); - if ((pTty = fopen(temp, "r")) == NULL) { - WriteError("Can't read %s", temp); - } else { - fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, pTty); - while (fread(&ttyinfo, ttyinfohdr.recsize, 1, pTty) == 1) { - if (strcmp(ttyinfo.tty, pTTY) == 0) - break; - } - fclose(pTty); - - if ((strcmp(ttyinfo.tty, pTTY) != 0) || (!ttyinfo.available)) { - Syslog('+', "No BBS allowed on port \"%s\"", pTTY); - snprintf(temp, 81, "No BBS on this port allowed!\r\n\r\n"); - PUTSTR(temp); - Free_Language(); - Quick_Bye(MBERR_OK); - } - - /* - * Display Connect String if turned on. + if ((p = getenv("REMOTEHOST")) != NULL) { + /* + * Network connection, no tty checking but fill a ttyinfo record. */ - if (CFG.iConnectString) { - /* Connected on port */ - snprintf(temp, 81, "%s\"%s\" ", (char *) Language(348), ttyinfo.comment); - pout(CYAN, BLACK, temp); - /* on */ - snprintf(temp, 81, "%s %s", (char *) Language(135), ctime(<ime)); - PUTSTR(temp); - Enter(1); + memset(&ttyinfo, 0, sizeof(ttyinfo)); + snprintf(ttyinfo.comment, 41, "%s", p); + snprintf(ttyinfo.tty, 7, "%s", pTTY); + snprintf(ttyinfo.speed, 21, "10 mbit"); + snprintf(ttyinfo.flags, 31, "IBN,IFC,XX"); + ttyinfo.type = NETWORK; + ttyinfo.available = TRUE; + snprintf(ttyinfo.name, 36, "Network port #%d", iNode); + } else { + /* + * Check if this port is available. + */ + snprintf(temp, PATH_MAX, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT")); + if ((pTty = fopen(temp, "r")) == NULL) { + WriteError("Can't read %s", temp); + } else { + fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, pTty); + + while (fread(&ttyinfo, ttyinfohdr.recsize, 1, pTty) == 1) { + if (strcmp(ttyinfo.tty, pTTY) == 0) + break; + } + fclose(pTty); + + if ((strcmp(ttyinfo.tty, pTTY) != 0) || (!ttyinfo.available)) { + Syslog('+', "No BBS allowed on port \"%s\"", pTTY); + snprintf(temp, 81, "No BBS on this port allowed!\r\n\r\n"); + PUTSTR(temp); + Free_Language(); + Quick_Bye(MBERR_OK); + } } } + /* + * Display Connect String if turned on. + */ + if (CFG.iConnectString) { + /* Connected from */ + snprintf(temp, 81, "%s\"%s\" ", (char *) Language(348), ttyinfo.comment); + pout(CYAN, BLACK, temp); + /* line */ + snprintf(temp, 81, "%s%d ", (char *) Language(31), iNode); + pout(CYAN, BLACK, temp); + /* on */ + snprintf(temp, 81, "%s %s", (char *) Language(135), ctime(<ime)); + PUTSTR(temp); + Enter(1); + } + /* * Some debugging for me */ Syslog('b', "setlocale(LC_ALL, NULL) returns \"%s\"", printable(setlocale(LC_ALL, NULL), 0)); - /* Next is not usefull */ - Syslog('b', "nl_langinfo(LC_CTYPE) returns \"%s\"", printable(nl_langinfo(LC_CTYPE), 0)); snprintf(sMailbox, 21, "mailbox"); colour(LIGHTGRAY, BLACK); diff --git a/mbsebbs/user.c b/mbsebbs/user.c index e27109c9..fbeff3dc 100644 --- a/mbsebbs/user.c +++ b/mbsebbs/user.c @@ -235,7 +235,7 @@ void user(void) } else strncpy(FirstName, UserName, sizeof(FirstName)-1); strncpy(UserName, usrconfig.sUserName, sizeof(UserName)-1); - Syslog('+', "%s On-Line at \"%s\", node %d", UserName, ttyinfo.comment, iNode); + Syslog('+', "%s On-Line from \"%s\", node %d", UserName, ttyinfo.comment, iNode); IsDoing("Just Logged In"); /*