Added macro templates for mbfile index

This commit is contained in:
Michiel Broek 2002-04-10 20:29:57 +00:00
parent 3e03d3bbea
commit 3b10fb8078
19 changed files with 333 additions and 405 deletions

View File

@ -4643,6 +4643,8 @@ v0.33.20 10-Feb-2002
are automatic filled in.
Splitted no TCP into no IBN, no IFC and no ITN in global and
nodes setup.
When editing a new message area, and the area was made active,
all entered data was erased.
mbfido:
In AreaMgr and FileMgr changed aka matching for area
@ -4704,6 +4706,11 @@ v0.33.20 10-Feb-2002
When started a second time it doesn't destroy the lockfile
anymore.
mbfile:
The mbfile index command now creates the html pages using the
macro templates html.main and html.areas. The files.css file
is no longer needed.
mball:
Will not crash anymore when it needs more then 10 minutes to
create the allfiles and newfiles lists.
@ -4792,3 +4799,6 @@ v0.33.20 10-Feb-2002
installed destructive, ie. all private changes will be lost
with every install. Later this will be a normal install.
rundoor.sh
Called door.bat instead of doors.bat

View File

@ -7,7 +7,7 @@ OTHER = AUTHORS ChangeLog COPYING DEBUG CRON.sh FILE_ID.DIZ.in \
INSTALL.in MBSE.FAQ Makefile Makefile.global.in NEWS \
README README.GoldED README.isdn SETUP.sh TODO UPGRADE \
aclocal.m4 \
checkbasic config.h.in configure configure.in files.css
checkbasic config.h.in configure configure.in
TARFILE = ${PACKAGE}-${VERSION}.tar.gz
###############################################################################
@ -133,14 +133,6 @@ install:
${CHOWN} ${OWNER}.${GROUP} ${PREFIX}/ftp/pub/local ; \
chmod 0755 ${PREFIX}/ftp/pub/local ; \
fi
@if [ ! -d ${PREFIX}/ftp/pub/css ] ; then \
mkdir ${PREFIX}/ftp/pub/css ; \
${CHOWN} ${OWNER}.${GROUP} ${PREFIX}/ftp/pub/css ; \
chmod 0755 ${PREFIX}/ftp/pub/css ; \
fi
@if [ ! -f ${PREFIX}/ftp/pub/css/files.css ]; then \
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0444 files.css ${PREFIX}/ftp/pub/css ; \
fi
@if [ ! -d ${PREFIX}/var/bso ] ; then \
mkdir ${PREFIX}/var/nodelist ; \
mkdir ${PREFIX}/var/bso ; \

2
TODO
View File

@ -64,8 +64,6 @@ mbcico:
N: Implement MD5 crypt in binkp protocol driver.
N: Remove code to make automatic calls after mbtask does this.
mbfile:
N: Add a check to see if the magic filenames are (still) valid.

Binary file not shown.

View File

@ -169,7 +169,7 @@ nntp.o: libs.h structs.h users.h records.h clcomm.h mbinet.h
pop3.o: libs.h structs.h users.h records.h clcomm.h mbinet.h
smtp.o: libs.h structs.h users.h records.h clcomm.h mbinet.h
diesel.o: libs.h diesel.h
mbdiesel.o: libs.h structs.h users.h records.h clcomm.h diesel.h
mbdiesel.o: libs.h structs.h users.h records.h common.h clcomm.h diesel.h
memwatch.o: ../config.h ../config.h libs.h memwatch.h
ftscprod.o: libs.h structs.h common.h
# End of generated dependencies

View File

@ -1,3 +1,5 @@
/* $Id$ */
#ifndef _DIESEL_H
#define _DIESEL_H
@ -22,7 +24,7 @@ int tracing = TRUE; /* Trace macro evalution */
/* Local variables. */
#define MAXARGS 10 /* Maximum arguments to a macro */
#define MAXSTR 256 /* Maximum string length */
#define MAXSTR 2560 /* Maximum string length */
#define MAXDEPTH 32 /* Maximum recursion depth for eval */
#define MACROCHAR '@' /* Macro trigger character */
@ -48,7 +50,8 @@ int diesel(char *, char *);
char *ParseMacro( const char *, int * );
void MacroVars( const char *, const char *, ... );
void MacroClear(void);
FILE *OpenMacro(const char *, int);
void html_massage(char *, char *);
FILE *OpenMacro(const char *, int, int);
#endif

View File

@ -50,8 +50,8 @@ void MacroVars( const char *codes, const char *fmt, ...)
char vc;
double vf;
tmp1=calloc(256,sizeof(char));
tmp2=calloc(256,sizeof(char));
tmp1=calloc(MAXSTR, sizeof(char));
tmp2=calloc(MAXSTR, sizeof(char));
va_start(ap,fmt);
for ( j=0; (codes[j] != '\0') && (fmt[j] != '\0') ; j++ ){
@ -103,7 +103,7 @@ void MacroClear(void)
char *ParseMacro( const char *line, int *dieselrc)
{
static char res[256];
static char res[MAXSTR];
char *tmp1, *tmp2, *tmp3, *i;
int j, l;
char code;
@ -114,9 +114,9 @@ char *ParseMacro( const char *line, int *dieselrc)
if ( *line == '#' )
return res;
tmp1 = calloc(256,sizeof(char));
tmp2 = calloc(256,sizeof(char));
tmp3 = calloc(256,sizeof(char));
tmp1 = calloc(MAXSTR, sizeof(char));
tmp2 = calloc(MAXSTR, sizeof(char));
tmp3 = calloc(MAXSTR, sizeof(char));
tmp1[0]='\0';
@ -235,12 +235,139 @@ void Cookie(void)
FILE *OpenMacro(const char *filename, int Language)
/*
* Translate ISO 8859-1 characters to named character entities
*/
void html_massage(char *inbuf, char *outbuf)
{
char *inptr = inbuf;
char *outptr = outbuf;
memset(outbuf, 0, sizeof(outbuf));
while (*inptr) {
switch ((unsigned char)*inptr) {
case '"': sprintf(outptr, """); break;
case '&': sprintf(outptr, "&"); break;
case '<': sprintf(outptr, "&lt;"); break;
case '>': sprintf(outptr, "&gt;"); break;
case 160: sprintf(outptr, "&nbsp;"); break;
case 161: sprintf(outptr, "&iexcl;"); break;
case 162: sprintf(outptr, "&cent;"); break;
case 163: sprintf(outptr, "&pound;"); break;
case 164: sprintf(outptr, "&curren;"); break;
case 165: sprintf(outptr, "&yen;"); break;
case 166: sprintf(outptr, "&brvbar;"); break;
case 167: sprintf(outptr, "&sect;"); break;
case 168: sprintf(outptr, "&uml;"); break;
case 169: sprintf(outptr, "&copy;"); break;
case 170: sprintf(outptr, "&ordf;"); break;
case 171: sprintf(outptr, "&laquo;"); break;
case 172: sprintf(outptr, "&not;"); break;
case 173: sprintf(outptr, "&shy;"); break;
case 174: sprintf(outptr, "&reg;"); break;
case 175: sprintf(outptr, "&macr;"); break;
case 176: sprintf(outptr, "&deg;"); break;
case 177: sprintf(outptr, "&plumn;"); break;
case 178: sprintf(outptr, "&sup2;"); break;
case 179: sprintf(outptr, "&sup3;"); break;
case 180: sprintf(outptr, "&acute;"); break;
case 181: sprintf(outptr, "&micro;"); break;
case 182: sprintf(outptr, "&para;"); break;
case 183: sprintf(outptr, "&middot;"); break;
case 184: sprintf(outptr, "&cedil;"); break;
case 185: sprintf(outptr, "&supl;"); break;
case 186: sprintf(outptr, "&ordm;"); break;
case 187: sprintf(outptr, "&raquo;"); break;
case 188: sprintf(outptr, "&frac14;"); break;
case 189: sprintf(outptr, "&frac12;"); break;
case 190: sprintf(outptr, "&frac34;"); break;
case 191: sprintf(outptr, "&iquest;"); break;
case 192: sprintf(outptr, "&Agrave;"); break;
case 193: sprintf(outptr, "&Aacute;"); break;
case 194: sprintf(outptr, "&Acirc;"); break;
case 195: sprintf(outptr, "&Atilde;"); break;
case 196: sprintf(outptr, "&Auml;"); break;
case 197: sprintf(outptr, "&Aring;"); break;
case 198: sprintf(outptr, "&AElig;"); break;
case 199: sprintf(outptr, "&Ccedil;"); break;
case 200: sprintf(outptr, "&Egrave;"); break;
case 201: sprintf(outptr, "&Eacute;"); break;
case 202: sprintf(outptr, "&Ecirc;"); break;
case 203: sprintf(outptr, "&Euml;"); break;
case 204: sprintf(outptr, "&Igrave;"); break;
case 205: sprintf(outptr, "&Iacute;"); break;
case 206: sprintf(outptr, "&Icirc;"); break;
case 207: sprintf(outptr, "&Iuml;"); break;
case 208: sprintf(outptr, "&ETH;"); break;
case 209: sprintf(outptr, "&Ntilde;"); break;
case 210: sprintf(outptr, "&Ograve;"); break;
case 211: sprintf(outptr, "&Oacute;"); break;
case 212: sprintf(outptr, "&Ocirc;"); break;
case 213: sprintf(outptr, "&Otilde;"); break;
case 214: sprintf(outptr, "&Ouml;"); break;
case 215: sprintf(outptr, "&times;"); break;
case 216: sprintf(outptr, "&Oslash;"); break;
case 217: sprintf(outptr, "&Ugrave;"); break;
case 218: sprintf(outptr, "&Uacute;"); break;
case 219: sprintf(outptr, "&Ucirc;"); break;
case 220: sprintf(outptr, "&Uuml;"); break;
case 221: sprintf(outptr, "&Yacute;"); break;
case 222: sprintf(outptr, "&THORN;"); break;
case 223: sprintf(outptr, "&szlig;"); break;
case 224: sprintf(outptr, "&agrave;"); break;
case 225: sprintf(outptr, "&aacute;"); break;
case 226: sprintf(outptr, "&acirc;"); break;
case 227: sprintf(outptr, "&atilde;"); break;
case 228: sprintf(outptr, "&auml;"); break;
case 229: sprintf(outptr, "&aring;"); break;
case 230: sprintf(outptr, "&aelig;"); break;
case 231: sprintf(outptr, "&ccedil;"); break;
case 232: sprintf(outptr, "&egrave;"); break;
case 233: sprintf(outptr, "&eacute;"); break;
case 234: sprintf(outptr, "&ecirc;"); break;
case 235: sprintf(outptr, "&euml;"); break;
case 236: sprintf(outptr, "&igrave;"); break;
case 237: sprintf(outptr, "&iacute;"); break;
case 238: sprintf(outptr, "&icirc;"); break;
case 239: sprintf(outptr, "&iuml;"); break;
case 240: sprintf(outptr, "&eth;"); break;
case 241: sprintf(outptr, "&ntilde;"); break;
case 242: sprintf(outptr, "&ograve;"); break;
case 243: sprintf(outptr, "&oacute;"); break;
case 244: sprintf(outptr, "&ocirc;"); break;
case 245: sprintf(outptr, "&otilde;"); break;
case 246: sprintf(outptr, "&ouml;"); break;
case 247: sprintf(outptr, "&divide;"); break;
case 248: sprintf(outptr, "&oslash;"); break;
case 249: sprintf(outptr, "&ugrave;"); break;
case 250: sprintf(outptr, "&uacute;"); break;
case 251: sprintf(outptr, "&ucirc;"); break;
case 252: sprintf(outptr, "&uuml;"); break;
case 253: sprintf(outptr, "&yacute;"); break;
case 254: sprintf(outptr, "&thorn;"); break;
case 255: sprintf(outptr, "&yuml;"); break;
default: *outptr++ = *inptr; *outptr = '\0'; break;
}
while (*outptr)
outptr++;
inptr++;
}
*outptr = '\0';
}
FILE *OpenMacro(const char *filename, int Language, int htmlmode)
{
FILE *pLang, *fi = NULL;
char *temp;
char *temp, *aka, linebuf[1024], outbuf[1024];
temp = calloc(PATH_MAX, sizeof(char));
aka = calloc(81, sizeof(char));
temp[0] = '\0';
if (Language != '\0') {
@ -282,11 +409,33 @@ FILE *OpenMacro(const char *filename, int Language)
else {
Syslog('d', "OpenMacro(%s, %c): using %s", filename, Language, temp);
sprintf(temp, "%s-%s", OsName(), OsCPU());
if (CFG.aka[0].point)
sprintf(aka, "%d:%d/%d.%d@%s", CFG.aka[0].zone, CFG.aka[0].net, CFG.aka[0].node, CFG.aka[0].point, CFG.aka[0].domain);
else
sprintf(aka, "%d:%d/%d@%s", CFG.aka[0].zone, CFG.aka[0].net, CFG.aka[0].node, CFG.aka[0].domain);
if (htmlmode) {
MacroVars("HMOUVYZ", "ssssssd", CFG.www_url, CFG.sysdomain, temp, CFG.sysop, VERSION, aka, 0);
sprintf(linebuf, "%s", CFG.location);
html_massage(linebuf, outbuf);
MacroVars("L", "s", outbuf);
sprintf(linebuf, "%s", CFG.bbs_name);
html_massage(linebuf, outbuf);
MacroVars("N", "s", outbuf);
sprintf(linebuf, "%s", CFG.sysop_name);
html_massage(linebuf, outbuf);
MacroVars("S", "s", outbuf);
sprintf(linebuf, "%s", CFG.comment);
html_massage(linebuf, outbuf);
MacroVars("T", "s", outbuf);
} else {
MacroVars("HLMNOSTUVYZ", "ssssssssssd", CFG.www_url, CFG.location, CFG.sysdomain, CFG.bbs_name, temp,
CFG.sysop_name, CFG.comment, CFG.sysop, VERSION, aka2str(CFG.aka[0]), 0);
CFG.sysop_name, CFG.comment, CFG.sysop, VERSION, aka, 0);
}
Cookie();
}
free(aka);
free(temp);
return fi;
}

View File

@ -47,7 +47,7 @@ MBAFF_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/l
../lib/libdbase.a ../lib/libdiesel.a
MBINDEX_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
MBDIFF_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
MBFILE_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
MBFILE_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a ../lib/libdiesel.a
MBMSG_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a
OTHER = Makefile README maptabs.tgz paths.h.in
TARGET = mbfido mbseq mbaff mbindex mbdiff mbfile mbmsg
@ -166,7 +166,7 @@ utic.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/co
announce.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h grlist.h msgutil.h announce.h
fflist.o: ../lib/libs.h ../lib/clcomm.h ../lib/msg.h fflist.h
ftn2rfc.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/dbftn.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/common.h ../lib/clcomm.h rollover.h aliasdb.h postemail.h backalias.h ftn2rfc.h
makestat.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h makestat.h
makestat.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/diesel.h makestat.h
mbindex.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbftn.h mbindex.h
msgutil.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h ../lib/msgtext.h ../lib/diesel.h msgutil.h
postecho.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ftn2rfc.h postecho.h storeecho.h addpkt.h rollover.h
@ -192,7 +192,7 @@ scannews.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../li
tosspkt.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h tosspkt.h postnetmail.h postecho.h rollover.h createm.h
mbfkill.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfkill.h mbfutil.h
mbfutil.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfutil.h mbfile.h
mbfindex.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfutil.h mbfindex.h
mbfindex.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/diesel.h mbfutil.h mbfindex.h
mbfcheck.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfutil.h mbfcheck.h
mbfpack.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfutil.h mbfpack.h
mbflist.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfutil.h mbflist.h

View File

@ -242,7 +242,7 @@ void FinishMsg(int Final, long filepos)
temp = calloc(PATH_MAX, sizeof(char));
if (Final && ((fi = OpenMacro(newfiles.Template, newfiles.Language)) != NULL)) {
if (Final && ((fi = OpenMacro(newfiles.Template, newfiles.Language, FALSE)) != NULL)) {
/*
* Message footer
*/
@ -298,7 +298,7 @@ long Report(gr_list *ta, long filepos)
break;
}
if ((fi = OpenMacro(newfiles.Template, newfiles.Language)) != NULL) {
if ((fi = OpenMacro(newfiles.Template, newfiles.Language, FALSE)) != NULL) {
/*
* Area block header
*/

View File

@ -92,7 +92,7 @@ void A_Help(faddr *t, char *replyid)
GetRpSubject("areamgr.help",subject);
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", subject , replyid)) != NULL) {
if ((fi = OpenMacro("areamgr.help", nodes.Language)) != NULL ){
if ((fi = OpenMacro("areamgr.help", nodes.Language, FALSE)) != NULL ){
MacroVars("sAYP", "ssss", nodes.Sysop, "Areamgr", ascfnode(bestaka_s(t), 0xf), nodes.Apasswd );
MacroRead(fi, fp);
fclose(fi);
@ -137,22 +137,22 @@ void A_List(faddr *t, char *replyid, int Notify)
case LIST_NOTIFY: Syslog('+', "AreaMgr: Notify to %s", ascfnode(t, 0xff));
sprintf(subject,"AreaMgr Notify");
GetRpSubject("areamgr.notify.list",subject);
fi = OpenMacro("areamgr.notify.list", nodes.Language);
fi = OpenMacro("areamgr.notify.list", nodes.Language, FALSE);
break;
case LIST_LIST: Syslog('+', "AreaMgr: List");
sprintf(subject,"AreaMgr list");
GetRpSubject("areamgr.list",subject);
fi = OpenMacro("areamgr.list", nodes.Language);
fi = OpenMacro("areamgr.list", nodes.Language, FALSE);
break;
case LIST_QUERY: Syslog('+', "AreaMgr: Query");
sprintf(subject,"AreaMgr Query");
GetRpSubject("areamgr.query",subject);
fi = OpenMacro("areamgr.query", nodes.Language);
fi = OpenMacro("areamgr.query", nodes.Language, FALSE);
break;
case LIST_UNLINK: Syslog('+', "AreaMgr: Unlinked");
sprintf(subject,"AreaMgr: Unlinked areas");
GetRpSubject("areamgr.unlink",subject);
fi = OpenMacro("areamgr.unlink", nodes.Language);
fi = OpenMacro("areamgr.unlink", nodes.Language, FALSE);
break;
}
@ -321,12 +321,12 @@ void A_Flow(faddr *t, char *replyid, int Notify)
Syslog('+', "AreaMgr: Flow report to %s", ascfnode(t, 0xff));
sprintf(subject,"AreaMgr Notify Flow Report");
GetRpSubject("areamgr.notify.flow",subject);
fi = OpenMacro("areamgr.notify.flow", nodes.Language);
fi = OpenMacro("areamgr.notify.flow", nodes.Language, FALSE);
}else{
Syslog('+', "AreaMgr: Flow report");
sprintf(subject,"AreaMgr Flow Report");
GetRpSubject("areamgr.flow",subject);
fi = OpenMacro("areamgr.flow", nodes.Language);
fi = OpenMacro("areamgr.flow", nodes.Language, FALSE);
}
if (fi == 0) {
@ -489,7 +489,7 @@ void A_Status(faddr *t, char *replyid)
);
GetRpSubject("areamgr.status",subject);
if ((fi = OpenMacro("areamgr.status", nodes.Language)) == NULL ){
if ((fi = OpenMacro("areamgr.status", nodes.Language, FALSE)) == NULL ){
MacroClear();
free(subject);
return;

View File

@ -210,7 +210,7 @@ void FinishReply(int Reported, int Total, long filepos)
temp = calloc(PATH_MAX, sizeof(char));
if ((fi = OpenMacro(scanmgr.template, scanmgr.Language)) != NULL) {
if ((fi = OpenMacro(scanmgr.template, scanmgr.Language, FALSE)) != NULL) {
MacroVars("CD", "dd", Reported, Total);
fseek(fi, filepos, SEEK_SET);
Msg_Macro(fi);
@ -373,7 +373,7 @@ void ScanFiles(ff_list *tmp)
fflush(stdout);
}
if (((filepos = StartReply(tmp)) != -1) && ((fi = OpenMacro(scanmgr.template, scanmgr.Language)) != NULL)) {
if (((filepos = StartReply(tmp)) != -1) && ((fi = OpenMacro(scanmgr.template, scanmgr.Language, FALSE)) != NULL)) {
areanr = 0;
sprintf(temp, "%s/etc/fareas.data", getenv("MBSE_ROOT"));

View File

@ -86,7 +86,7 @@ void F_Help(faddr *t, char *replyid)
GetRpSubject("filemgr.help",subject);
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", subject, replyid)) != NULL) {
if ((fi = OpenMacro("filemgr.help", nodes.Language)) != NULL ){
if ((fi = OpenMacro("filemgr.help", nodes.Language, FALSE)) != NULL ){
MacroVars("sAYP", "ssss", nodes.Sysop, (char *)"Filemgr", ascfnode(bestaka_s(t), 0xf), nodes.Fpasswd );
MacroRead(fi, fp);
MacroClear();
@ -128,22 +128,22 @@ void F_List(faddr *t, char *replyid, int Notify)
case LIST_NOTIFY: Syslog('+', "FileMgr: Notify to %s", ascfnode(t, 0xff));
sprintf(subject,"FileMgr Notify");
GetRpSubject("filemgr.notify.list",subject);
fi=OpenMacro("filemgr.notify.list", nodes.Language);
fi=OpenMacro("filemgr.notify.list", nodes.Language, FALSE);
break;
case LIST_LIST: Syslog('+', "FileMgr: List");
sprintf(subject,"FileMgr list");
GetRpSubject("filemgr.list",subject);
fi=OpenMacro("filemgr.list", nodes.Language);
fi=OpenMacro("filemgr.list", nodes.Language, FALSE);
break;
case LIST_QUERY: Syslog('+', "FileMgr: Query");
sprintf(subject,"FileMgr Query");
GetRpSubject("filemgr.query",subject);
fi=OpenMacro("filemgr.query", nodes.Language);
fi=OpenMacro("filemgr.query", nodes.Language, FALSE);
break;
default: Syslog('+', "FileMgr: Unlinked");
sprintf(subject,"FileMgr: Unlinked areas");
GetRpSubject("filemgr.unlink",subject);
fi=OpenMacro("filemgr.unlink", nodes.Language);
fi=OpenMacro("filemgr.unlink", nodes.Language, FALSE);
break;
}
@ -318,7 +318,7 @@ void F_Status(faddr *t, char *replyid)
);
GetRpSubject("filemgr.status",subject);
if ((fi = OpenMacro("filemgr.status", nodes.Language)) == NULL ) {
if ((fi = OpenMacro("filemgr.status", nodes.Language, FALSE)) == NULL ) {
free(subject);
MacroClear();
return;

View File

@ -135,7 +135,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
*/
if (nodes.Message) {
if ((net = SendMgrMail(fido2faddr(Node), CFG.ct_KeepMgr, TRUE, (char *)"Filemgr", subject, NULL)) != NULL) {
if ((fi = OpenMacro("forward.tic", nodes.Language)) != NULL) {
if ((fi = OpenMacro("forward.tic", nodes.Language, FALSE)) != NULL) {
MacroVars("abcdfghijmns", "ssdssddsssss", TIC.TicIn.Area, tic.Comment, TIC.FileCost, fgroup.Comment,
TIC.TicIn.FullName, TIC.FileSize, TIC.FileSize / 1024,
TIC.TicIn.Crc, TIC.TicIn.Origin, " ", TIC.TicIn.Desc, nodes.Sysop);

View File

@ -34,135 +34,11 @@
#include "../lib/records.h"
#include "../lib/common.h"
#include "../lib/clcomm.h"
#include "../lib/diesel.h"
#include "makestat.h"
/*
* Translate ISO 8859-1 characters to named character entities
*/
void html_massage(char *, char *);
void html_massage(char *inbuf, char *outbuf)
{
char *inptr = inbuf;
char *outptr = outbuf;
memset(outbuf, 0, sizeof(outbuf));
while (*inptr) {
switch ((unsigned char)*inptr) {
case '"': sprintf(outptr, "&quot;"); break;
case '&': sprintf(outptr, "&amp;"); break;
case '<': sprintf(outptr, "&lt;"); break;
case '>': sprintf(outptr, "&gt;"); break;
case 160: sprintf(outptr, "&nbsp;"); break;
case 161: sprintf(outptr, "&iexcl;"); break;
case 162: sprintf(outptr, "&cent;"); break;
case 163: sprintf(outptr, "&pound;"); break;
case 164: sprintf(outptr, "&curren;"); break;
case 165: sprintf(outptr, "&yen;"); break;
case 166: sprintf(outptr, "&brvbar;"); break;
case 167: sprintf(outptr, "&sect;"); break;
case 168: sprintf(outptr, "&uml;"); break;
case 169: sprintf(outptr, "&copy;"); break;
case 170: sprintf(outptr, "&ordf;"); break;
case 171: sprintf(outptr, "&laquo;"); break;
case 172: sprintf(outptr, "&not;"); break;
case 173: sprintf(outptr, "&shy;"); break;
case 174: sprintf(outptr, "&reg;"); break;
case 175: sprintf(outptr, "&macr;"); break;
case 176: sprintf(outptr, "&deg;"); break;
case 177: sprintf(outptr, "&plumn;"); break;
case 178: sprintf(outptr, "&sup2;"); break;
case 179: sprintf(outptr, "&sup3;"); break;
case 180: sprintf(outptr, "&acute;"); break;
case 181: sprintf(outptr, "&micro;"); break;
case 182: sprintf(outptr, "&para;"); break;
case 183: sprintf(outptr, "&middot;"); break;
case 184: sprintf(outptr, "&cedil;"); break;
case 185: sprintf(outptr, "&supl;"); break;
case 186: sprintf(outptr, "&ordm;"); break;
case 187: sprintf(outptr, "&raquo;"); break;
case 188: sprintf(outptr, "&frac14;"); break;
case 189: sprintf(outptr, "&frac12;"); break;
case 190: sprintf(outptr, "&frac34;"); break;
case 191: sprintf(outptr, "&iquest;"); break;
case 192: sprintf(outptr, "&Agrave;"); break;
case 193: sprintf(outptr, "&Aacute;"); break;
case 194: sprintf(outptr, "&Acirc;"); break;
case 195: sprintf(outptr, "&Atilde;"); break;
case 196: sprintf(outptr, "&Auml;"); break;
case 197: sprintf(outptr, "&Aring;"); break;
case 198: sprintf(outptr, "&AElig;"); break;
case 199: sprintf(outptr, "&Ccedil;"); break;
case 200: sprintf(outptr, "&Egrave;"); break;
case 201: sprintf(outptr, "&Eacute;"); break;
case 202: sprintf(outptr, "&Ecirc;"); break;
case 203: sprintf(outptr, "&Euml;"); break;
case 204: sprintf(outptr, "&Igrave;"); break;
case 205: sprintf(outptr, "&Iacute;"); break;
case 206: sprintf(outptr, "&Icirc;"); break;
case 207: sprintf(outptr, "&Iuml;"); break;
case 208: sprintf(outptr, "&ETH;"); break;
case 209: sprintf(outptr, "&Ntilde;"); break;
case 210: sprintf(outptr, "&Ograve;"); break;
case 211: sprintf(outptr, "&Oacute;"); break;
case 212: sprintf(outptr, "&Ocirc;"); break;
case 213: sprintf(outptr, "&Otilde;"); break;
case 214: sprintf(outptr, "&Ouml;"); break;
case 215: sprintf(outptr, "&times;"); break;
case 216: sprintf(outptr, "&Oslash;"); break;
case 217: sprintf(outptr, "&Ugrave;"); break;
case 218: sprintf(outptr, "&Uacute;"); break;
case 219: sprintf(outptr, "&Ucirc;"); break;
case 220: sprintf(outptr, "&Uuml;"); break;
case 221: sprintf(outptr, "&Yacute;"); break;
case 222: sprintf(outptr, "&THORN;"); break;
case 223: sprintf(outptr, "&szlig;"); break;
case 224: sprintf(outptr, "&agrave;"); break;
case 225: sprintf(outptr, "&aacute;"); break;
case 226: sprintf(outptr, "&acirc;"); break;
case 227: sprintf(outptr, "&atilde;"); break;
case 228: sprintf(outptr, "&auml;"); break;
case 229: sprintf(outptr, "&aring;"); break;
case 230: sprintf(outptr, "&aelig;"); break;
case 231: sprintf(outptr, "&ccedil;"); break;
case 232: sprintf(outptr, "&egrave;"); break;
case 233: sprintf(outptr, "&eacute;"); break;
case 234: sprintf(outptr, "&ecirc;"); break;
case 235: sprintf(outptr, "&euml;"); break;
case 236: sprintf(outptr, "&igrave;"); break;
case 237: sprintf(outptr, "&iacute;"); break;
case 238: sprintf(outptr, "&icirc;"); break;
case 239: sprintf(outptr, "&iuml;"); break;
case 240: sprintf(outptr, "&eth;"); break;
case 241: sprintf(outptr, "&ntilde;"); break;
case 242: sprintf(outptr, "&ograve;"); break;
case 243: sprintf(outptr, "&oacute;"); break;
case 244: sprintf(outptr, "&ocirc;"); break;
case 245: sprintf(outptr, "&otilde;"); break;
case 246: sprintf(outptr, "&ouml;"); break;
case 247: sprintf(outptr, "&divide;"); break;
case 248: sprintf(outptr, "&oslash;"); break;
case 249: sprintf(outptr, "&ugrave;"); break;
case 250: sprintf(outptr, "&uacute;"); break;
case 251: sprintf(outptr, "&ucirc;"); break;
case 252: sprintf(outptr, "&uuml;"); break;
case 253: sprintf(outptr, "&yacute;"); break;
case 254: sprintf(outptr, "&thorn;"); break;
case 255: sprintf(outptr, "&yuml;"); break;
default: *outptr++ = *inptr; *outptr = '\0'; break;
}
while (*outptr)
outptr++;
inptr++;
}
*outptr = '\0';
}
FILE *newpage(char *, char *);
FILE *newpage(char *Name, char *Title)

View File

@ -35,6 +35,7 @@
#include "../lib/common.h"
#include "../lib/clcomm.h"
#include "../lib/dbcfg.h"
#include "../lib/diesel.h"
#include "mbfutil.h"
#include "mbfindex.h"
@ -42,6 +43,7 @@
extern int do_quiet; /* Supress screen output */
int lastfile; /* Last file number */
long gfilepos = 0; /* Global file position */
typedef struct _Index {
@ -131,128 +133,43 @@ int comp_index(Findex **fap1, Findex **fap2)
/*
* Translate ISO 8859-1 characters to named character entities
*/
void html_massage(char *, char *);
void html_massage(char *inbuf, char *outbuf)
void MacroRead(FILE *fi, FILE *fp)
{
char *inptr = inbuf;
char *outptr = outbuf;
char *line, *temp;
int res, i;
memset(outbuf, 0, sizeof(outbuf));
line = calloc(MAXSTR, sizeof(char));
temp = calloc(MAXSTR, sizeof(char));
while (*inptr) {
switch ((unsigned char)*inptr) {
case '"': sprintf(outptr, "&quot;"); break;
case '&': sprintf(outptr, "&amp;"); break;
case '<': sprintf(outptr, "&lt;"); break;
case '>': sprintf(outptr, "&gt;"); break;
case 160: sprintf(outptr, "&nbsp;"); break;
case 161: sprintf(outptr, "&iexcl;"); break;
case 162: sprintf(outptr, "&cent;"); break;
case 163: sprintf(outptr, "&pound;"); break;
case 164: sprintf(outptr, "&curren;"); break;
case 165: sprintf(outptr, "&yen;"); break;
case 166: sprintf(outptr, "&brvbar;"); break;
case 167: sprintf(outptr, "&sect;"); break;
case 168: sprintf(outptr, "&uml;"); break;
case 169: sprintf(outptr, "&copy;"); break;
case 170: sprintf(outptr, "&ordf;"); break;
case 171: sprintf(outptr, "&laquo;"); break;
case 172: sprintf(outptr, "&not;"); break;
case 173: sprintf(outptr, "&shy;"); break;
case 174: sprintf(outptr, "&reg;"); break;
case 175: sprintf(outptr, "&macr;"); break;
case 176: sprintf(outptr, "&deg;"); break;
case 177: sprintf(outptr, "&plumn;"); break;
case 178: sprintf(outptr, "&sup2;"); break;
case 179: sprintf(outptr, "&sup3;"); break;
case 180: sprintf(outptr, "&acute;"); break;
case 181: sprintf(outptr, "&micro;"); break;
case 182: sprintf(outptr, "&para;"); break;
case 183: sprintf(outptr, "&middot;"); break;
case 184: sprintf(outptr, "&cedil;"); break;
case 185: sprintf(outptr, "&supl;"); break;
case 186: sprintf(outptr, "&ordm;"); break;
case 187: sprintf(outptr, "&raquo;"); break;
case 188: sprintf(outptr, "&frac14;"); break;
case 189: sprintf(outptr, "&frac12;"); break;
case 190: sprintf(outptr, "&frac34;"); break;
case 191: sprintf(outptr, "&iquest;"); break;
case 192: sprintf(outptr, "&Agrave;"); break;
case 193: sprintf(outptr, "&Aacute;"); break;
case 194: sprintf(outptr, "&Acirc;"); break;
case 195: sprintf(outptr, "&Atilde;"); break;
case 196: sprintf(outptr, "&Auml;"); break;
case 197: sprintf(outptr, "&Aring;"); break;
case 198: sprintf(outptr, "&AElig;"); break;
case 199: sprintf(outptr, "&Ccedil;"); break;
case 200: sprintf(outptr, "&Egrave;"); break;
case 201: sprintf(outptr, "&Eacute;"); break;
case 202: sprintf(outptr, "&Ecirc;"); break;
case 203: sprintf(outptr, "&Euml;"); break;
case 204: sprintf(outptr, "&Igrave;"); break;
case 205: sprintf(outptr, "&Iacute;"); break;
case 206: sprintf(outptr, "&Icirc;"); break;
case 207: sprintf(outptr, "&Iuml;"); break;
case 208: sprintf(outptr, "&ETH;"); break;
case 209: sprintf(outptr, "&Ntilde;"); break;
case 210: sprintf(outptr, "&Ograve;"); break;
case 211: sprintf(outptr, "&Oacute;"); break;
case 212: sprintf(outptr, "&Ocirc;"); break;
case 213: sprintf(outptr, "&Otilde;"); break;
case 214: sprintf(outptr, "&Ouml;"); break;
case 215: sprintf(outptr, "&times;"); break;
case 216: sprintf(outptr, "&Oslash;"); break;
case 217: sprintf(outptr, "&Ugrave;"); break;
case 218: sprintf(outptr, "&Uacute;"); break;
case 219: sprintf(outptr, "&Ucirc;"); break;
case 220: sprintf(outptr, "&Uuml;"); break;
case 221: sprintf(outptr, "&Yacute;"); break;
case 222: sprintf(outptr, "&THORN;"); break;
case 223: sprintf(outptr, "&szlig;"); break;
case 224: sprintf(outptr, "&agrave;"); break;
case 225: sprintf(outptr, "&aacute;"); break;
case 226: sprintf(outptr, "&acirc;"); break;
case 227: sprintf(outptr, "&atilde;"); break;
case 228: sprintf(outptr, "&auml;"); break;
case 229: sprintf(outptr, "&aring;"); break;
case 230: sprintf(outptr, "&aelig;"); break;
case 231: sprintf(outptr, "&ccedil;"); break;
case 232: sprintf(outptr, "&egrave;"); break;
case 233: sprintf(outptr, "&eacute;"); break;
case 234: sprintf(outptr, "&ecirc;"); break;
case 235: sprintf(outptr, "&euml;"); break;
case 236: sprintf(outptr, "&igrave;"); break;
case 237: sprintf(outptr, "&iacute;"); break;
case 238: sprintf(outptr, "&icirc;"); break;
case 239: sprintf(outptr, "&iuml;"); break;
case 240: sprintf(outptr, "&eth;"); break;
case 241: sprintf(outptr, "&ntilde;"); break;
case 242: sprintf(outptr, "&ograve;"); break;
case 243: sprintf(outptr, "&oacute;"); break;
case 244: sprintf(outptr, "&ocirc;"); break;
case 245: sprintf(outptr, "&otilde;"); break;
case 246: sprintf(outptr, "&ouml;"); break;
case 247: sprintf(outptr, "&divide;"); break;
case 248: sprintf(outptr, "&oslash;"); break;
case 249: sprintf(outptr, "&ugrave;"); break;
case 250: sprintf(outptr, "&uacute;"); break;
case 251: sprintf(outptr, "&ucirc;"); break;
case 252: sprintf(outptr, "&uuml;"); break;
case 253: sprintf(outptr, "&yacute;"); break;
case 254: sprintf(outptr, "&thorn;"); break;
case 255: sprintf(outptr, "&yuml;"); break;
default: *outptr++ = *inptr; *outptr = '\0'; break;
while ((fgets(line, MAXSTR-2, fi) != NULL) && ((line[0]!='@') || (line[1]!='|'))) {
/*
* Skip comment lines
*/
if (line[0] != '#') {
Striplf(line);
if (strlen(line) == 0) {
/*
* Empty lines are just written
*/
fputc('\n', fp);
} else {
strncpy(temp, ParseMacro(line,&res), MAXSTR-1);
if (res)
Syslog('!', "Macro error line: \"%s\"", line);
/*
* Only output if something was evaluated
*/
if (strlen(temp)) {
for (i = 0; i < strlen(temp); i++)
fputc(temp[i], fp);
fputc('\n', fp);
}
while (*outptr)
outptr++;
inptr++;
}
*outptr = '\0';
}
}
free(line);
free(temp);
gfilepos = ftell(fi);
}
@ -273,41 +190,42 @@ char *rfcdate(time_t now)
/*
* Create the macro's for the navigation bar.
*/
void pagelink(FILE *, char *, int, int);
void pagelink(FILE *fa, char *Path, int inArea, int Current)
{
char nr[20];
fprintf(fa, "<DIV align=center>\n");
char temp[256], nr[25];
if ((Current >= CFG.www_files_page) && (inArea >= CFG.www_files_page)) {
if (((Current / CFG.www_files_page) - 1) > 0)
if (((Current / CFG.www_files_page) - 1) > 0) {
sprintf(nr, "%d", (Current / CFG.www_files_page) -1);
else
} else {
nr[0] = '\0';
fprintf(fa, "<A HREF=\"%s/%s%s/index%s.html\"><IMG SRC=\"/icons/%s\" ALT=\"%s\" BORDER=0>%s</A>&nbsp;\n",
CFG.www_url, CFG.www_link2ftp, Path+strlen(CFG.ftp_base), nr,
CFG.www_icon_prev, CFG.www_name_prev, CFG.www_name_prev);
}
fprintf(fa, "<A HREF=\"%s/index.html\"><IMG SRC=\"/icons/%s\" ALT=\"%s\" BORDER=0>%s</A>&nbsp;\n",
CFG.www_url, CFG.www_icon_home, CFG.www_name_home, CFG.www_name_home);
fprintf(fa, "<A HREF=\"%s/%s/index.html\"><IMG SRC=\"/icons/%s\" ALT=\"%s\" BORDER=0>%s</A>\n",
CFG.www_url, CFG.www_link2ftp, CFG.www_icon_back, CFG.www_name_back, CFG.www_name_back);
sprintf(temp, "%s/%s%s/index%s.html", CFG.www_url, CFG.www_link2ftp, Path+strlen(CFG.ftp_base), nr);
MacroVars("c", "s", temp);
} else {
MacroVars("c", "s", "");
}
if ((Current < (inArea - CFG.www_files_page)) && (inArea >= CFG.www_files_page)) {
fprintf(fa, "&nbsp;<A HREF=\"%s/%s%s/index%d.html\"><IMG SRC=\"/icons/%s\" ALT=\"%s\" BORDER=0>%s</A>\n",
CFG.www_url, CFG.www_link2ftp, Path+strlen(CFG.ftp_base), (Current / CFG.www_files_page) + 1,
CFG.www_icon_next, CFG.www_name_next, CFG.www_name_next);
sprintf(temp, "%s/%s%s/index%d.html", CFG.www_url, CFG.www_link2ftp, Path+strlen(CFG.ftp_base),
(Current / CFG.www_files_page) + 1);
MacroVars("d", "s", temp);
} else {
MacroVars("d", "s", "");
}
fprintf(fa, "</DIV><P>\n");
}
FILE *newpage(char *, char *, time_t, int, int);
FILE *newpage(char *Path, char *Name, time_t later, int inArea, int Current)
/*
* Start a new file areas page
*/
FILE *newpage(char *, char *, time_t, int, int, FILE *);
FILE *newpage(char *Path, char *Name, time_t later, int inArea, int Current, FILE *fi)
{
char linebuf[1024], outbuf[1024];
static FILE* fa;
@ -322,21 +240,9 @@ FILE *newpage(char *Path, char *Name, time_t later, int inArea, int Current)
} else {
sprintf(linebuf, "%s", Name);
html_massage(linebuf, outbuf);
fprintf(fa, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n");
fprintf(fa, "<HTML>\n");
fprintf(fa, "<!-- Page created by MBSE BBS v%s -->\n", VERSION);
fprintf(fa, "<META http-equiv=\"Expires\" content=\"%s\">\n", rfcdate(later));
fprintf(fa, "<META http-equiv=\"Cache-Control\" content=\"no-cache, must-revalidate\">\n");
fprintf(fa, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n", CFG.www_charset);
fprintf(fa, "<META name=\"%s\" lang=\"en\" content=\"%s\">\n", CFG.www_author, outbuf);
fprintf(fa, "<HEAD><TITLE>%s</TITLE>\n", outbuf);
fprintf(fa, "<LINK rel=stylesheet HREF=\"%s/%s/css/files.css\">\n", CFG.www_url, CFG.www_link2ftp);
fprintf(fa, "<STYLE TYPE=\"text/css\">\n");
fprintf(fa, "</STYLE>\n</HEAD>\n<BODY>\n");
MacroVars("ab", "ss", rfcdate(later), outbuf);
pagelink(fa, Path, inArea, Current);
fprintf(fa, "<H1 align=center>File index of %s</H1><P>\n", outbuf);
fprintf(fa, "<TABLE align=center width=750>\n");
fprintf(fa, "<TR><TH>Nr.</TH><TH>Filename</TH><TH>Date</TH><TH>Size</TH><TH>Downloads</TH><TH>Description</TH></TR>\n");
MacroRead(fi, fa);
return fa;
}
return NULL;
@ -344,8 +250,11 @@ FILE *newpage(char *Path, char *Name, time_t later, int inArea, int Current)
void closepage(FILE *, char *, int, int);
void closepage(FILE *fa, char *Path, int inArea, int Current)
/*
* Finish a files area page
*/
void closepage(FILE *, char *, int, int, FILE *);
void closepage(FILE *fa, char *Path, int inArea, int Current, FILE *fi)
{
char *temp1, *temp2;
@ -354,9 +263,7 @@ void closepage(FILE *fa, char *Path, int inArea, int Current)
temp1 = calloc(PATH_MAX, sizeof(char));
temp2 = calloc(PATH_MAX, sizeof(char));
fprintf(fa, "</TABLE><P>\n");
pagelink(fa, Path, inArea, lastfile);
fprintf(fa, "</BODY></HTML>\n");
MacroRead(fi, fa);
fclose(fa);
if (lastfile) {
sprintf(temp1, "%s/index%d.html", Path, lastfile / CFG.www_files_page);
@ -380,17 +287,18 @@ void closepage(FILE *fa, char *Path, int inArea, int Current)
*/
void Index(void)
{
FILE *pAreas, *pFile, *pIndex, *fa, *fm, *fp;
FILE *pAreas, *pFile, *pIndex, *fa, *fb = NULL, *fm, *fp, *fi = NULL;
unsigned long i, iAreas, iAreasNew = 0, record, KSize = 0L, aSize = 0;
int iTotal = 0, AreaNr = 0, j, z, x = 0, Areas = 0;
int iTotal = 0, AreaNr = 0, j, k, z, x = 0, Areas = 0;
int Total = 0, aTotal = 0, inArea = 0, filenr;
int fbAreas = 0, fbFiles = 0;
char *sAreas, *fAreas, *newdir = NULL, *sIndex, *fn, *temp;
char linebuf[1024], outbuf[1024];
char linebuf[1024], outbuf[1024], desc[1500];
time_t last = 0L, later;
Findex *fdx = NULL;
Findex *tmp;
struct FILEIndex idx;
long fileptr = 0, fileptr1 = 0;
sAreas = calloc(PATH_MAX, sizeof(char));
fAreas = calloc(PATH_MAX, sizeof(char));
@ -436,6 +344,14 @@ void Index(void)
Syslog('+', "FTP/HTML not defined, skipping html pages creation");
}
if (fm) {
if ((fi = OpenMacro("html.main", 'E', TRUE)) == NULL) {
Syslog('+', "Can't open macro file, skipping html pages creation");
fclose(fm);
unlink(fn);
}
}
if (fm) {
/*
* Because these web pages are dynamic, ie. they change everytime you
@ -445,22 +361,9 @@ void Index(void)
* also have an author name, this is the bbs name, and a content
* description for search engines. Automatic advertising.
*/
sprintf(linebuf, "File areas at %s", CFG.bbs_name);
html_massage(linebuf, outbuf);
fprintf(fm, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n");
fprintf(fm, "<HTML>\n");
fprintf(fm, "<!-- Page created by MBSE BBS v%s -->\n", VERSION);
fprintf(fm, "<META http-equiv=\"Expires\" content=\"%s\">\n", rfcdate(later));
fprintf(fm, "<META http-equiv=\"Cache-Control\" content=\"no-cache, must-revalidate\">\n");
fprintf(fm, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n", CFG.www_charset);
fprintf(fm, "<META name=\"%s\" lang=\"en\" content=\"%s\">\n", CFG.www_author, outbuf);
fprintf(fm, "<HEAD><TITLE>%s</TITLE>\n", outbuf);
fprintf(fm, "<LINK rel=stylesheet HREF=\"%s/%s/css/files.css\">\n", CFG.www_url, CFG.www_link2ftp);
fprintf(fm, "<STYLE TYPE=\"text/css\">\n");
fprintf(fm, "</STYLE>\n</HEAD>\n<BODY>\n");
fprintf(fm, "<H2 align=center>%s</H2><P>\n", outbuf);
fprintf(fm, "<TABLE align=center width=750>\n");
fprintf(fm, "<TR><TH>Area</TH><TH>Description</TH><TH>Files</TH><TH>Total size</TH><TH>Last added</TH></TR>\n");
MacroVars("acd", "sdd", rfcdate(later), 0, 0);
MacroRead(fi, fm);
fileptr = ftell(fi);
}
for (i = 1; i <= iAreas; i++) {
@ -576,7 +479,12 @@ void Index(void)
aSize = 0L;
aTotal = 0;
last = 0L;
fa = newpage(area.Path, area.Name, later, inArea, aTotal);
if ((fb = OpenMacro("html.areas", 'E', TRUE)) == NULL) {
fa = NULL;
} else {
fa = newpage(area.Path, area.Name, later, inArea, aTotal, fb);
fileptr1 = gfilepos;
}
while (fread(&file, sizeof(file), 1, pFile) == 1) {
if ((!file.Deleted) && (!file.Missing)) {
/*
@ -601,7 +509,7 @@ void Index(void)
}
}
fprintf(fa, "<TR><TD align=right valign=top>%d</TD>", aTotal);
MacroVars("e", "d", aTotal);
/*
* Check if this is a .gif or .jpg file, if so then
* check if a thumbnail file exists. If not try to
@ -619,44 +527,47 @@ void Index(void)
chmod(outbuf, 0644);
}
}
fprintf(fa, "<TD align=center valign=top><A HREF=\"%s/%s%s/%s\">",
CFG.www_url, CFG.www_link2ftp,
sprintf(outbuf, "%s/%s%s/%s", CFG.www_url, CFG.www_link2ftp,
area.Path+strlen(CFG.ftp_base), file.LName);
fprintf(fa, "<IMG SRC=\"%s/%s%s/.%s\" ALT=\"%s\" BORDER=0>",
CFG.www_url, CFG.www_link2ftp,
area.Path+strlen(CFG.ftp_base), file.LName, file.LName);
fprintf(fa, "</A></TD>");
sprintf(linebuf, "%s/%s%s/.%s", CFG.www_url, CFG.www_link2ftp,
area.Path+strlen(CFG.ftp_base), file.LName);
MacroVars("fghi", "dsss", 1, outbuf, file.LName, linebuf);
} else {
fprintf(fa, "<TD valign=top><A HREF=\"%s/%s%s/%s\">%s</A></TD>",
CFG.www_url, CFG.www_link2ftp,
area.Path+strlen(CFG.ftp_base), file.LName, file.LName);
sprintf(outbuf, "%s/%s%s/%s", CFG.www_url, CFG.www_link2ftp,
area.Path+strlen(CFG.ftp_base), file.LName);
MacroVars("fghi", "dsss", 0, outbuf, file.LName, "");
}
fprintf(fa, "<TD valign=top>%s</TD>", StrDateDMY(file.FileDate));
fprintf(fa, "<TD align=right valign=top>%lu Kb.</TD>",
(long)(file.Size / 1024));
fprintf(fa, "<TD valign=top>%8ld</TD>",
file.TimesDL + file.TimesFTP + file.TimesReq);
fprintf(fa, "<TD><PRE>");
sprintf(outbuf, "%lu Kb.", (long)(file.Size / 1024));
MacroVars("jkl", "ssd", StrDateDMY(file.FileDate), outbuf, file.TimesDL+file.TimesFTP+file.TimesReq);
memset(&desc, 0, sizeof(desc));
k = 0;
for (j = 0; j < 25; j++)
if (strlen(file.Desc[j])) {
if (j)
fprintf(fa, "\n");
if (j) {
sprintf(desc+k, "\n");
k += 1;
}
sprintf(linebuf, "%s", strkconv(file.Desc[j], CHRS_DEFAULT_FTN, CHRS_DEFAULT_RFC));
html_massage(linebuf, outbuf);
fprintf(fa, "%s", outbuf);
sprintf(desc+k, "%s", outbuf);
k += strlen(outbuf);
}
fprintf(fa, "</PRE></TD></TR>\n");
MacroVars("m", "s", desc);
fseek(fb, fileptr1, SEEK_SET);
MacroRead(fb, fa);
aSize += file.Size;
if (file.FileDate > last)
last = file.FileDate;
if ((aTotal % CFG.www_files_page) == 0) {
closepage(fa, area.Path, inArea, aTotal);
fa = newpage(area.Path, area.Name, later, inArea, aTotal);
closepage(fa, area.Path, inArea, aTotal, fb);
fseek(fb, 0, SEEK_SET);
fa = newpage(area.Path, area.Name, later, inArea, aTotal, fb);
}
} /* if (!file.deleted) */
}
KSize += aSize / 1024;
closepage(fa, area.Path, inArea, aTotal);
closepage(fa, area.Path, inArea, aTotal, fb);
fclose(fb);
fclose(fp);
chmod(temp, 0644);
@ -674,17 +585,18 @@ void Index(void)
Syslog('+', "Removed obsolete %s", linebuf);
}
fprintf(fm, "<TR><TD align=right>%d</TD><TD><A HREF=\"%s/%s%s/index.html\">%s</A></TD>",
AreaNr, CFG.www_url, CFG.www_link2ftp, area.Path+strlen(CFG.ftp_base), area.Name);
fprintf(fm, "<TD align=right>%d</TD>", aTotal);
sprintf(linebuf, "%s/%s%s/index.html", CFG.www_url, CFG.www_link2ftp, area.Path+strlen(CFG.ftp_base));
if (aSize > 1048576)
fprintf(fm, "<TD align=right>%ld Mb.</TD>", aSize / 1048576);
sprintf(outbuf, "%ld Mb.", aSize / 1048576);
else
fprintf(fm, "<TD align=right>%ld Kb.</TD>", aSize / 1024);
sprintf(outbuf, "%ld Kb.", aSize / 1024);
MacroVars("efghi", "dssds", AreaNr, linebuf, area.Name, aTotal, outbuf);
if (last == 0L)
fprintf(fm, "<TD>&nbsp;</TD></TR>\n");
MacroVars("j", "s", "&nbsp;");
else
fprintf(fm, "<TD align=center>%s</TD></TR>\n", StrDateDMY(last));
MacroVars("j", "s", StrDateDMY(last));
fseek(fi, fileptr, SEEK_SET);
MacroRead(fi, fm);
}
}
fclose(pFile);
@ -693,12 +605,10 @@ void Index(void)
}
if (fm) {
fprintf(fm, "<TR align=right><TH>&nbsp;</TH><TH>Total</TH><TD>%d</TD><TD>%ld Mb.</TD><TD>&nbsp;</TD></TR>\n",
Total, KSize / 1024);
fprintf(fm, "</TABLE><P>\n");
fprintf(fm, "<A HREF=\"/index.html\"><IMG SRC=\"/icons/%s\" ALT=\"%s\" BORDER=0>%s</A>\n",
CFG.www_icon_home, CFG.www_name_home, CFG.www_name_home);
fprintf(fm, "</BODY></HTML>\n");
sprintf(linebuf, "%ld Mb.", KSize / 1024);
MacroVars("cd", "ds", Total, linebuf);
MacroRead(fi, fm);
fclose(fi);
fclose(fm);
sprintf(linebuf, "%s/index.html", CFG.ftp_base);
rename(fn, linebuf);

View File

@ -93,7 +93,7 @@ void WriteMailGroups(FILE *fp, faddr *f)
faddr *g;
fpos_t fileptr;
if ((fi = OpenMacro("areamgr.group", nodes.Language)) == NULL)
if ((fi = OpenMacro("areamgr.group", nodes.Language, FALSE)) == NULL)
return;
MacroRead(fi, fp);
@ -150,7 +150,7 @@ void WriteFileGroups(FILE *fp, faddr *f)
faddr *g;
fpos_t fileptr;
if ((fi = OpenMacro("filemgr.group", nodes.Language)) == NULL)
if ((fi = OpenMacro("filemgr.group", nodes.Language, FALSE)) == NULL)
return;
MacroRead(fi, fp);
@ -414,7 +414,7 @@ void GetRpSubject(const char *report, char* subject)
int res;
temp = calloc(256,sizeof(char));
if ((fi=OpenMacro(report, nodes.Language))!=NULL){
if ((fi=OpenMacro(report, nodes.Language, FALSE))!=NULL){
while ( fgets(temp, 254, fi) != NULL )
if (temp[0] != '#')
ParseMacro(temp,&res);
@ -439,7 +439,7 @@ int MsgResult(const char * report, FILE *fo)
temp = calloc(256,sizeof(char));
resp = calloc(256,sizeof(char));
if ((fi = OpenMacro(report, nodes.Language)) != NULL){
if ((fi = OpenMacro(report, nodes.Language, FALSE)) != NULL){
while ( fgets(temp, 254, fi) != NULL ){
if (temp[0] != '#') {
strncpy(resp, ParseMacro(temp, &res), 80);

View File

@ -148,7 +148,7 @@ long Msg_Top(char *template, int language, fidoaddr aka)
temp = calloc(PATH_MAX, sizeof(char));
if ((fi = OpenMacro(template, language))) {
if ((fi = OpenMacro(template, language, FALSE))) {
/*
* First override default aka with current aka, then display header.
*/

View File

@ -1199,18 +1199,8 @@ int EditMsgRec(int Area)
changed = TRUE;
}
}
if (!msgs.Active && Active) {
InitMsgRec();
if (!msgs.Active && Active)
msgs.Active = TRUE;
/*
* Clear connections, just in case from older mbse versions
* might have left garbage here.
*/
fseek(tfil, 0, SEEK_SET);
memset(&System, 0, sizeof(System));
for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++)
fwrite(&System, sizeof(System), 1, tfil);
}
SetScreen();
break;
case 15:E_INT( 13,52, msgs.DaysOld, "Maximum ^days^ to keep mail in this area")

View File

@ -11,7 +11,7 @@
# by Redy Rodriguez and Michiel Broek.
#
DOOR=`basename $0`
COMMANDO="\"door $DOOR $*\r\""
COMMANDO="\"doors $DOOR $*\r\""
/usr/bin/sudo /opt/mbse/bin/bbsdoor.sh $DOOR $1
/usr/bin/sudo /opt/dosemu/bin/dosemu.bin \