diff --git a/TODO b/TODO index 260612e3..91de2a6a 100644 --- a/TODO +++ b/TODO @@ -119,6 +119,8 @@ mbfido: older entry to update the info with the later received file. Else just handle the record as a dupe (In test again). + N: Hatch statistics are not updated. + mbcico: L: Implement binkp option ND. diff --git a/mbsetup/Makefile b/mbsetup/Makefile index 18c3b26f..dd8c8f6d 100644 --- a/mbsetup/Makefile +++ b/mbsetup/Makefile @@ -84,7 +84,7 @@ ledit.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/msg.h screen.h mutil m_farea.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h m_global.h m_fgroup.h m_archive.h m_farea.h m_fgroup.h m_ngroup.h m_fido.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_fido.h m_limits.o: ../config.h ../lib/mbselib.h ../lib/users.h screen.h mutil.h ledit.h stlist.h m_global.h m_limits.h -m_menu.o: ../config.h ../lib/mbselib.h mutil.h screen.h ledit.h m_lang.h m_menu.h +m_menu.o: ../config.h ../lib/mbselib.h mutil.h screen.h ledit.h m_lang.h m_global.h m_menu.h m_ngroup.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_ngroup.h m_service.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_service.h m_tty.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_modem.h m_global.h m_tty.h diff --git a/mbsetup/m_bbs.c b/mbsetup/m_bbs.c index 23ed0e1f..1094b0e4 100644 --- a/mbsetup/m_bbs.c +++ b/mbsetup/m_bbs.c @@ -92,21 +92,6 @@ void bbs_menu(void) int bbs_doc(FILE *fp, FILE *toc, int page) { - FILE *wp; - - if ((wp = open_webdoc((char *)"bbs.html", (char *)"BBS Setup", NULL))) { - fprintf(wp, "Main\n"); - fprintf(wp, "\n"); - fclose(wp); - } - page = newpage(fp, page); addtoc(fp, toc, 8, 0, page, (char *)"BBS setup"); diff --git a/mbsetup/m_farea.c b/mbsetup/m_farea.c index 17b948ee..53910ca9 100644 --- a/mbsetup/m_farea.c +++ b/mbsetup/m_farea.c @@ -835,7 +835,8 @@ int bbs_file_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "\n"); fprintf(wp, "\n"); } - add_webtable(wp, tic.Name, tic.Comment); + fprintf(wp, "%s%s\n", + tic.Name, tic.Name, tic.Comment); tics++; } fseek(ti, tichdr.syssize, SEEK_CUR); diff --git a/mbsetup/m_fgroup.c b/mbsetup/m_fgroup.c index 772de91f..84d6be5c 100644 --- a/mbsetup/m_fgroup.c +++ b/mbsetup/m_fgroup.c @@ -772,8 +772,7 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "\n"); fprintf(wp, "\n"); } - sprintf(temp, "Area %d", i); - add_webtable(wp, temp, area.Name); + fprintf(wp, "Area %d%s\n", i, i, area.Name); refs++; } } @@ -800,7 +799,8 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "\n"); fprintf(wp, "\n"); } - add_webtable(wp, tic.Name, tic.Comment); + fprintf(wp, "%s%s\n", + tic.Name, tic.Name, tic.Comment); refs++; } fseek(ti, tichdr.syssize, SEEK_CUR); @@ -830,7 +830,9 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "\n"); fprintf(wp, "\n"); } - add_webtable(wp, aka2str(nodes.Aka[0]), nodes.Sysop); + fprintf(wp, "%s%s\n", + nodes.Aka[0].zone, nodes.Aka[0].net, nodes.Aka[0].node, nodes.Aka[0].point, + nodes.Aka[0].domain, aka2str(nodes.Aka[0]), nodes.Sysop); refs++; } } @@ -844,6 +846,11 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "\n"); fprintf(wp, "\n"); } + fprintf(wp, "
\n"); + fprintf(wp, "

Group Statistics

\n"); + add_statcnt(wp, (char *)"processed files", fgroup.Files); + add_statcnt(wp, (char *)"KBytes of files", fgroup.KBytes); + close_webdoc(wp); } fprintf(fp, " Group name %s\n", fgroup.Name); diff --git a/mbsetup/m_hatch.c b/mbsetup/m_hatch.c index 7b171e2a..2484e2d3 100644 --- a/mbsetup/m_hatch.c +++ b/mbsetup/m_hatch.c @@ -557,82 +557,120 @@ void InitHatch(void) int tic_hatch_doc(FILE *fp, FILE *toc, int page) { - char temp[PATH_MAX], *tmp = NULL; - FILE *no; - int i, j, All; + char temp[PATH_MAX], *tmp = NULL; + FILE *wp, *ip, *no; + int i, j, nr = 0, All; - sprintf(temp, "%s/etc/hatch.data", getenv("MBSE_ROOT")); - if ((no = fopen(temp, "r")) == NULL) - return page; + sprintf(temp, "%s/etc/hatch.data", getenv("MBSE_ROOT")); + if ((no = fopen(temp, "r")) == NULL) + return page; - page = newpage(fp, page); - addtoc(fp, toc, 10, 3, page, (char *)"Hatch manager"); - j = 1; + page = newpage(fp, page); + addtoc(fp, toc, 10, 3, page, (char *)"Hatch manager"); + j = 1; - fprintf(fp, "\n\n"); - fread(&hatchhdr, sizeof(hatchhdr), 1, no); + fprintf(fp, "\n\n"); + fread(&hatchhdr, sizeof(hatchhdr), 1, no); - while ((fread(&hatch, hatchhdr.recsize, 1, no)) == 1) { + ip = open_webdoc((char *)"hatch.html", (char *)"File Areas", NULL); + fprintf(ip, "Main\n"); + fprintf(ip, "\n"); + close_webdoc(ip); + + fclose(no); + return page; } diff --git a/mbsetup/m_lang.c b/mbsetup/m_lang.c index 3b480a31..fe3c0e07 100644 --- a/mbsetup/m_lang.c +++ b/mbsetup/m_lang.c @@ -525,42 +525,102 @@ int PickLanguage(char *nr) int bbs_lang_doc(FILE *fp, FILE *toc, int page) { - char temp[PATH_MAX]; - FILE *no; - int j; + char temp[PATH_MAX]; + FILE *wp, *ip, *no; + int j; + DIR *dp; + struct dirent *de; - sprintf(temp, "%s/etc/language.data", getenv("MBSE_ROOT")); - if ((no = fopen(temp, "r")) == NULL) - return page; + sprintf(temp, "%s/etc/language.data", getenv("MBSE_ROOT")); + if ((no = fopen(temp, "r")) == NULL) + return page; - page = newpage(fp, page); - addtoc(fp, toc, 8, 2, page, (char *)"BBS Language setup"); - j = 0; - fprintf(fp, "\n\n"); - fread(&langhdr, sizeof(langhdr), 1, no); + page = newpage(fp, page); + addtoc(fp, toc, 8, 2, page, (char *)"BBS Language setup"); + j = 0; + fprintf(fp, "\n\n"); + fread(&langhdr, sizeof(langhdr), 1, no); - while ((fread(&lang, langhdr.recsize, 1, no)) == 1) { + ip = open_webdoc((char *)"language.html", (char *)"BBS Language Setup", NULL); + fprintf(ip, "Main\n"); + fprintf(ip, "\n"); + close_webdoc(ip); + + fclose(no); + return page; } diff --git a/mbsetup/m_limits.c b/mbsetup/m_limits.c index bbbf4704..7c459d73 100644 --- a/mbsetup/m_limits.c +++ b/mbsetup/m_limits.c @@ -537,28 +537,67 @@ char *get_limit_name(int level) int bbs_limits_doc(FILE *fp, FILE *toc, int page) { - char temp[PATH_MAX]; - FILE *no; + char temp[PATH_MAX]; + FILE *up, *ip, *no; - sprintf(temp, "%s/etc/limits.data", getenv("MBSE_ROOT")); - if ((no = fopen(temp, "r")) == NULL) - return page; - - addtoc(fp, toc, 8, 1, page, (char *)"BBS user limits"); - - fread(&LIMIThdr, sizeof(LIMIThdr), 1, no); - - fprintf(fp, "\n"); - fprintf(fp, " Access Max. Down Down\n"); - fprintf(fp, " Level time Kb. files Active Description\n"); - fprintf(fp, " ------ ------ ------ ------ ------ ------------------------------\n"); - - while ((fread(&LIMIT, LIMIThdr.recsize, 1, no)) == 1) { - fprintf(fp, " %6ld %6ld %6ld %6d %s %s\n", LIMIT.Security, LIMIT.Time, LIMIT.DownK, - LIMIT.DownF, getboolean(LIMIT.Available), LIMIT.Description); - } - - fclose(no); + sprintf(temp, "%s/etc/limits.data", getenv("MBSE_ROOT")); + if ((no = fopen(temp, "r")) == NULL) return page; + + addtoc(fp, toc, 8, 1, page, (char *)"BBS user limits"); + + ip = open_webdoc((char *)"limits.html", (char *)"BBS User Security Limits", NULL); + fprintf(ip, "Main\n"); + fprintf(ip, "

\n"); + fprintf(ip, "\n"); + fprintf(ip, "\n"); + fprintf(ip, ""); + fprintf(ip, ""); + fprintf(ip, "\n"); + fread(&LIMIThdr, sizeof(LIMIThdr), 1, no); + + fprintf(fp, "\n"); + fprintf(fp, " Access Max. Down Down\n"); + fprintf(fp, " Level time Kb. files Active Description\n"); + fprintf(fp, " ------ ------ ------ ------ ------ ------------------------------\n"); + + while ((fread(&LIMIT, LIMIThdr.recsize, 1, no)) == 1) { + fprintf(fp, " %6ld %6ld %6ld %6d %s %s\n", + LIMIT.Security, LIMIT.Time, LIMIT.DownK, LIMIT.DownF, getboolean(LIMIT.Available), LIMIT.Description); + fprintf(ip, "\n", + LIMIT.Security, LIMIT.Time, LIMIT.DownK, LIMIT.DownF, getboolean(LIMIT.Available), LIMIT.Description); + } + + fprintf(ip, "\n"); + fprintf(ip, "
Access LevelMax. timeDown Kb.Down filesActiveDescription
%ld%ld%ld%d%s%s
\n"); + fprintf(ip, "


\n"); + fprintf(ip, "

Users in security levels

\n"); + fprintf(ip, "\n"); + fprintf(ip, "\n"); + fprintf(ip, "\n"); + fprintf(ip, "\n"); + fseek(no, LIMIThdr.hdrsize, SEEK_SET); + + sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT")); + if ((up = fopen(temp, "r"))) { + fread(&usrconfighdr, sizeof(usrconfighdr), 1, up); + + while ((fread(&LIMIT, LIMIThdr.recsize, 1, no)) == 1) { + fseek(up, usrconfighdr.hdrsize, SEEK_SET); + while (fread(&usrconfig, usrconfighdr.recsize, 1, up) == 1) { + if (strlen(usrconfig.sUserName) && (usrconfig.Security.level == LIMIT.Security)) { + fprintf(ip, "\n", + LIMIT.Security, usrconfig.sUserName, usrconfig.sLocation); + } + } + } + fclose(up); + } + + fprintf(ip, "\n"); + fprintf(ip, "
Access LevelUserLocation
%ld%s%s
\n"); + close_webdoc(ip); + fclose(no); + return page; } diff --git a/mbsetup/m_magic.c b/mbsetup/m_magic.c index 267c1d8a..91e970b9 100644 --- a/mbsetup/m_magic.c +++ b/mbsetup/m_magic.c @@ -487,59 +487,83 @@ void InitMagics(void) int tic_magic_doc(FILE *fp, FILE *toc, int page) { - char temp[PATH_MAX]; - FILE *no; - int j; + char temp[PATH_MAX]; + FILE *wp, *ip, *no; + int nr = 0i, j; - sprintf(temp, "%s/etc/magic.data", getenv("MBSE_ROOT")); - if ((no = fopen(temp, "r")) == NULL) - return page; + sprintf(temp, "%s/etc/magic.data", getenv("MBSE_ROOT")); + if ((no = fopen(temp, "r")) == NULL) + return page; - page = newpage(fp, page); - addtoc(fp, toc, 10, 4, page, (char *)"File Magic processing"); - j = 0; - fprintf(fp, "\n\n"); + page = newpage(fp, page); + addtoc(fp, toc, 10, 4, page, (char *)"File Magic processing"); + j = 0; + fprintf(fp, "\n\n"); + fread(&magichdr, sizeof(magichdr), 1, no); - fread(&magichdr, sizeof(magichdr), 1, no); - while (fread(&magic, magichdr.recsize, 1, no) == 1) { - if (j == 6) { - page = newpage(fp, page); - fprintf(fp, "\n"); - j = 0; - } - - fprintf(fp, " Filemask %s\n", magic.Mask); - fprintf(fp, " Type %s\n", getmagictype(magic.Attrib)); - fprintf(fp, " Active %s\n", getboolean(magic.Active)); - fprintf(fp, " Area %s\n", magic.From); - - switch (magic.Attrib) { - case MG_ADOPT: - case MG_MOVE: - fprintf(fp, " To area %s\n", magic.ToArea); - break; - - case MG_EXEC: - fprintf(fp, " Command %s\n", magic.Cmd); - fprintf(fp, " Compile NL %s\n", getboolean(magic.Compile)); - break; - - case MG_UNPACK: - case MG_COPY: - fprintf(fp, " Compile NL %s\n", getboolean(magic.Compile)); - fprintf(fp, " Path %s\n", magic.Path); - break; - - case MG_KEEPNUM:fprintf(fp, " Keep # file %d\n", magic.KeepNum); - break; - } - - fprintf(fp, "\n\n"); - j++; + ip = open_webdoc((char *)"magic.html", (char *)"File Magic Processing", NULL); + fprintf(ip, "Main\n"); + fprintf(ip, "\n"); + close_webdoc(ip); + + fclose(no); + return page; } diff --git a/mbsetup/m_marea.c b/mbsetup/m_marea.c index 4ef6600e..427ba346 100644 --- a/mbsetup/m_marea.c +++ b/mbsetup/m_marea.c @@ -1762,8 +1762,8 @@ void gold_areas(FILE *fp) int mail_area_doc(FILE *fp, FILE *toc, int page) { char temp[PATH_MAX], status[5]; - FILE *no; - int i = 0, j, systems, First = TRUE, LMiy; + FILE *ti, *wp, *ip, *no; + int i = 0, j, k, systems, refs, First = TRUE, LMiy; sysconnect System; struct tm *t; time_t Now; @@ -1787,6 +1787,10 @@ int mail_area_doc(FILE *fp, FILE *toc, int page) fread(&msgshdr, msgshdr.hdrsize, 1, no); systems = msgshdr.syssize / sizeof(sysconnect); + ip = open_webdoc((char *)"msgareas.html", (char *)"Message Areas", NULL); + fprintf(ip, "Main\n"); + fprintf(ip, "\n"); + close_webdoc(ip); + fclose(no); return page; } diff --git a/mbsetup/m_menu.c b/mbsetup/m_menu.c index 6b2ca48e..71240dde 100644 --- a/mbsetup/m_menu.c +++ b/mbsetup/m_menu.c @@ -34,6 +34,7 @@ #include "screen.h" #include "ledit.h" #include "m_lang.h" +#include "m_global.h" #include "m_menu.h" @@ -580,7 +581,7 @@ void EditMenus(void) int bbs_menu_doc(FILE *fp, FILE *toc, int page) { char *temp; - FILE *no, *mn; + FILE *wp, *ip, *no, *mn; DIR *dp; struct dirent *de; int j; @@ -598,45 +599,83 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page) fread(&langhdr, sizeof(langhdr), 1, no); j =0; + ip = open_webdoc((char *)"menus.html", (char *)"BBS Menus", NULL); + fprintf(ip, "Main\n"); + while ((fread(&lang, langhdr.recsize, 1, no)) == 1) { + fprintf(ip, "

BBS Menus for %s

\n", lang.Name); + fprintf(ip, "\n"); + fprintf(ip, "
\n"); } + close_webdoc(ip); + free(temp); fclose(no); return page; diff --git a/mbsetup/mbsetup.c b/mbsetup/mbsetup.c index 47a4c9b0..1b490852 100644 --- a/mbsetup/mbsetup.c +++ b/mbsetup/mbsetup.c @@ -184,6 +184,16 @@ void soft_info(void) } +int horiz; + +void dotter(void); +void dotter(void) +{ + mvprintw(8, horiz++, (char *)"."); + fflush(stdout); +} + + void site_docs(void); void site_docs(void) @@ -213,7 +223,7 @@ void site_docs(void) set_color(WHITE, BLACK); mvprintw( 5, 6, "21. CREATING SITEDOCS"); set_color(CYAN, BLACK); - mvprintw( 7,11, (char *)"Erasing directory %s/doc/html", getenv("MBSE_ROOT")); + mvprintw( 7,11, (char *)"Erasing directory %s/doc/html", getenv("MBSE_ROOT")); fflush(stdout); sprintf(temp, "-r -f %s/doc/html", getenv("MBSE_ROOT")); @@ -228,27 +238,18 @@ void site_docs(void) fprintf(hp, "
  • Modem Types
  • \n"); fprintf(hp, "
  • TTY Lines Info
  • \n"); fprintf(hp, "
  • Fidonet Nodes
  • \n"); - fprintf(hp, "
  • BBS Setup
  • \n"); - fprintf(hp, " \n"); - fprintf(hp, "
  • Mail Setup
  • \n"); - fprintf(hp, " \n"); - fprintf(hp, "
  • File Echo's Setup
  • \n"); - fprintf(hp, " \n"); + fprintf(hp, "
  • BBS: Security Limits
  • \n"); + fprintf(hp, "
  • BBS: Language Setup
  • \n"); + fprintf(hp, "
  • BBS: BBS Menus
  • \n"); + fprintf(hp, "
  • BBS: File Areas
  • \n"); + fprintf(hp, "
  • BBS: Transfer Protocols
  • \n"); + fprintf(hp, "
  • BBS: Oneliners
  • \n"); + fprintf(hp, "
  • Mail: Echomail Groups
  • \n"); + fprintf(hp, "
  • Mail: Echomail Areas
  • \n"); + fprintf(hp, "
  • TIC: FileEcho Groups
  • \n"); + fprintf(hp, "
  • TIC: Fileecho Areas
  • \n"); + fprintf(hp, "
  • TIC: Hatch Manager
  • \n"); + fprintf(hp, "
  • TIC: Magic Files
  • \n"); fprintf(hp, "
  • Newfiles Groups
  • \n"); fprintf(hp, "
  • Newfiles Reports
  • \n"); fprintf(hp, "
  • Filefind Setup
  • \n"); @@ -263,24 +264,45 @@ void site_docs(void) Syslog('+', "Can't create html documentation"); } - mvprintw( 8,11, (char *)"Create document in file %s/doc/site.doc", getenv("MBSE_ROOT")); + mvprintw(8,11, (char *)"Creating site documents"); + fflush(stdout); + horiz = 35; page = global_doc(fp, toc, page); + dotter(); page = fido_doc(fp, toc, page); + dotter(); page = archive_doc(fp, toc, page); + dotter(); page = virus_doc(fp, toc, page); + dotter(); page = modem_doc(fp, toc, page); + dotter(); page = tty_doc(fp, toc, page); + dotter(); page = node_doc(fp, toc, page); + dotter(); page = bbs_doc(fp, toc, page); + dotter(); page = mail_doc(fp, toc, page); + dotter(); page = tic_doc(fp, toc, page); + dotter(); page = newf_group_doc(fp, toc, page); + dotter(); page = new_doc(fp, toc, page); + dotter(); page = ff_doc(fp, toc, page); + dotter(); page = service_doc(fp, toc, page); + dotter(); page = domain_doc(fp, toc, page); + dotter(); page = task_doc(fp, toc, page); + dotter(); page = route_doc(fp, toc, page); + clrtoeol(); + mvprintw( 8,11, (char *)"Created site documents in %s/doc", getenv("MBSE_ROOT")); + fflush(stdout); /* * Append table of contents diff --git a/mbsetup/mutil.c b/mbsetup/mutil.c index e1130069..d6088551 100644 --- a/mbsetup/mutil.c +++ b/mbsetup/mutil.c @@ -237,3 +237,27 @@ void add_colors(FILE *fp, char *hstr, int fg, int bg) } + +void add_statcnt(FILE *fp, char * hstr, statcnt st) +{ + fprintf(fp, "\n"); + fprintf(fp, "\n"); + fprintf(fp, "\n", hstr); + fprintf(fp, "\n"); + fprintf(fp, "\n", st.tdow[0], st.tdow[1], st.tdow[2], st.tdow[3], st.tdow[4], st.tdow[5], st.tdow[6], st.tweek); + fprintf(fp, "\n", st.ldow[0], st.ldow[1], st.ldow[2], st.ldow[3], st.ldow[4], st.ldow[5], st.ldow[6], st.lweek); + fprintf(fp, "\n"); + fprintf(fp, "
    Weekdays overview of %s
     SunMonTueWedThuFriSatTotal
    This week%ld%ld%ld%ld%ld%ld%ld%ld
    Last week%ld%ld%ld%ld%ld%ld%ld%ld
    \n"); + fprintf(fp, "

    \n"); + fprintf(fp, "\n"); + fprintf(fp, "\n"); + fprintf(fp, "\n", hstr); + fprintf(fp, "\n"); + fprintf(fp, "\n", + st.month[0], st.month[1], st.month[2], st.month[3], st.month[4], st.month[5], st.month[6], st.month[7], st.month[8], st.month[0], st.month[10], st.month[11], st.total); + fprintf(fp, "\n"); + fprintf(fp, "
    Monthly overview of %sTotal ever
    JanFebMarAprMayJunJulAugSepOctNovDec
    %ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld
    \n"); + fprintf(fp, "

    \n"); +} + + diff --git a/mbsetup/mutil.h b/mbsetup/mutil.h index 3e89e5b0..56aebb82 100644 --- a/mbsetup/mutil.h +++ b/mbsetup/mutil.h @@ -13,5 +13,6 @@ void close_webdoc(FILE *); void add_webtable(FILE *, char *, char *); void add_webdigit(FILE *, char *, int); void add_colors(FILE *, char *, int, int); +void add_statcnt(FILE *, char *, statcnt); #endif