Added support for external message editor

This commit is contained in:
Michiel Broek 2002-03-05 21:32:52 +00:00
parent 55734a6215
commit 6b441def07
24 changed files with 315 additions and 109 deletions

View File

@ -4596,6 +4596,7 @@ v0.33.20 10-Feb-2002
Updated German, Spanish and Galego languages. Updated German, Spanish and Galego languages.
The location of the sourcefiles is not important anymore. The location of the sourcefiles is not important anymore.
Added detection of vpopmail in default installation path. Added detection of vpopmail in default installation path.
Changed language prompts 372, 373, 387, 388, 389 and 390.
common.a: common.a:
Added 2 functions to return the OS name and CPU family. Added 2 functions to return the OS name and CPU family.
@ -4615,6 +4616,9 @@ v0.33.20 10-Feb-2002
that area are moved to the new path. that area are moved to the new path.
It is now possible to move file areas. It is now possible to move file areas.
It is now possible to move JAM message bases. It is now possible to move JAM message bases.
Added edit of external message editor in menu 1.4.
Added edit of NoPrompt setting in menus for doors.
Changed edit of message editor in user editor.
mbfido: mbfido:
In AreaMgr and FileMgr changed aka matching for area In AreaMgr and FileMgr changed aka matching for area
@ -4685,6 +4689,12 @@ v0.33.20 10-Feb-2002
mbsebbs: mbsebbs:
On some systems the download taglists contained garbage after On some systems the download taglists contained garbage after
the short filename causing wrong filenames at the users side. the short filename causing wrong filenames at the users side.
Added support for external message editor written by Redy.
Doors are now passed the parameter to display a prompt after
the door or return silently.
mbnewusr:
New users have the default internal fullscreen editor.
mbuser: mbuser:
If a new user has registered and not yet used the bbs, mbuser If a new user has registered and not yet used the bbs, mbuser

View File

@ -370,8 +370,8 @@
369 file.c YN|Are you Sure? [Y/n]: 369 file.c YN|Are you Sure? [Y/n]:
370 change.c |New Files check is now ON 370 change.c |New Files check is now ON
371 change.c |New Files check is now OFF 371 change.c |New Files check is now OFF
372 change.c |Fullscreen Editor is now ON 372 change.c |Now using the
373 change.c |Fullscreen Editor is now OFF 373 change.c 123|Select: 1) Line editor, 2) Fullscreen editor, 3) External editor
374 offline.c |No messages found to download! 374 offline.c |No messages found to download!
375 funcs4.c |Press (Enter) to continue: 375 funcs4.c |Press (Enter) to continue:
376 lineedit.c |Center 376 lineedit.c |Center
@ -385,10 +385,10 @@
384 funcs4.c |ie. John Doe, login = jdoe 384 funcs4.c |ie. John Doe, login = jdoe
385 funcs4.c |login > 385 funcs4.c |login >
386 funcs4.c |That login name already exists, please choose another one. 386 funcs4.c |That login name already exists, please choose another one.
387 | 387 change.c |Line
388 | 388 change.c |Fullscreen
389 | 389 change.c |External
390 | 390 change.c |Editor
391 offline.c |New 391 offline.c |New
392 offline.c |Local 392 offline.c |Local
393 offline.c |Netmail 393 offline.c |Netmail

View File

@ -370,8 +370,8 @@ SV|(S)chakel aktief, (V)erwijder alles, (ENTER) voor doorgaan:
JN|Zeker weten? [J/n]: JN|Zeker weten? [J/n]:
|Tonen nieuwe Bestanden is nu AAN |Tonen nieuwe Bestanden is nu AAN
|Tonen nieuwe Bestanden is nu UIT |Tonen nieuwe Bestanden is nu UIT
|Schermgestuurde Tekstverwerker is nu AAN |U gebruikt nu de
|Schermgestuurde Tekstverwerker is nu UIT 123|Kies: 1) Regel editer, 2) Volle scherm editer, 3) Externe editer
|Geen berichten gevonden voor download! |Geen berichten gevonden voor download!
|Geef (Enter) voor doorgaan: |Geef (Enter) voor doorgaan:
|Centreer |Centreer
@ -385,10 +385,10 @@ JN|Zeker weten? [J/n]:
|bv. Piet Snot, login = psnot |bv. Piet Snot, login = psnot
|login > |login >
|Die login naam bestaat al, kies iets anders. |Die login naam bestaat al, kies iets anders.
| |Regel
| |Volle scherm
| |Externe
| |Textverwerker
|Nieuw |Nieuw
|Lokaal |Lokaal
|Netmail |Netmail

View File

@ -370,8 +370,8 @@ TE|(T)oggle active, (E)rase all, (ENTER) to continue:
YN|Are you Sure? [Y/n]: YN|Are you Sure? [Y/n]:
|New Files check is now ON |New Files check is now ON
|New Files check is now OFF |New Files check is now OFF
|Fullscreen Editor is now ON |Now using the
|Fullscreen Editor is now OFF 123|Select: 1) Line editor, 2) Fullscreen editor, 3) External editor
|No messages found to download! |No messages found to download!
|Press (Enter) to continue: |Press (Enter) to continue:
|Center |Center
@ -385,10 +385,10 @@ YN|Are you Sure? [Y/n]:
|ie. John Doe, login = jdoe |ie. John Doe, login = jdoe
|login > |login >
|That login name already exists, please choose another one. |That login name already exists, please choose another one.
| |Line
| |Fullscreen
| |External
| |Editor
|New |New
|Local |Local
|Netmail |Netmail

View File

@ -370,8 +370,8 @@ AT|(A)ctivar/desactivar, desactivar (T)odos, (ENTER) para seguir:
SN|¨Est s seguro? [S/n]: SN|¨Est s seguro? [S/n]:
|Comprobar ficheiros novos ACTIVADO |Comprobar ficheiros novos ACTIVADO
|Comprobar ficheios novos DESACTIVADO |Comprobar ficheios novos DESACTIVADO
|Editor a pantalla completa ACTIVADO |Now using the
|Editor a pantalla completa DESACTIVADO 123|Select: 1) Line editor, 2) Fullscreen editor, 3) External editor
|¡Non hai mensaxes! |¡Non hai mensaxes!
|Pulsa (Enter) para seguir: |Pulsa (Enter) para seguir:
|Centrar |Centrar
@ -385,10 +385,10 @@ SN|
|'Elena Nito del Bosque ' podes usar 'enitob', 'elenanb' ou 'enbosque' |'Elena Nito del Bosque ' podes usar 'enitob', 'elenanb' ou 'enbosque'
|login > |login >
|Ese nome de LOGIN xa existe. Escolle outro... |Ese nome de LOGIN xa existe. Escolle outro...
| |Line
| |Fullscreen
| |External
| |Editor
|New |New
|Local |Local
|Netmail |Netmail

View File

@ -370,8 +370,8 @@ UA|Aufgelistete (U)mschalten, alle (A)bwaehlen, <ENTER> um fortzufahren:
JN|Sind Sie sicher? [J/n]: JN|Sind Sie sicher? [J/n]:
|Check auf neue Dateien ist jetzt AN |Check auf neue Dateien ist jetzt AN
|Check auf neue Dateien ist jetzt AUS |Check auf neue Dateien ist jetzt AUS
|Vollbild-Editor ist jetzt AN |Now using the
|Vollbild-Editor ist jetzt AUS 123|Select: 1) Line editor, 2) Fullscreen editor, 3) External editor
|Es liegen keine Mitteilungen zum Herunterladen vor! |Es liegen keine Mitteilungen zum Herunterladen vor!
|Weiter mit <Enter> ... |Weiter mit <Enter> ...
|Zentrieren |Zentrieren
@ -385,10 +385,10 @@ JN|Sind Sie sicher? [J/n]:
|Beispiel: "Gerhard Schroeder", login = gschroed |Beispiel: "Gerhard Schroeder", login = gschroed
|Ihr gewuenschter Anmeldename: |Ihr gewuenschter Anmeldename:
|Dieser Anmeldename existiert bereits, bitte waehlen Sie einen anderen. |Dieser Anmeldename existiert bereits, bitte waehlen Sie einen anderen.
| |Line
| |Fullscreen
| |External
| |Editor
|Neu |Neu
|Local |Local
|Netmail |Netmail

View File

@ -370,8 +370,8 @@ CE|(C)ambia aree attive, (E)limina tutto, (INVIO) per continuare:
SN|Sei sicuro? [S/n]: SN|Sei sicuro? [S/n]:
|Controllo per i nuovi file ATTIVATO |Controllo per i nuovi file ATTIVATO
|Controllo per i nuovi file DISATTIVATO |Controllo per i nuovi file DISATTIVATO
|Editor a schermo pieno ATTIVATO |Now using the
|Editor a schermo pieno DISATTIVATO 123|Select: 1) Line editor, 2) Fullscreen editor, 3) External editor
|Nessun messaggio da scaricare trovato! |Nessun messaggio da scaricare trovato!
|Premi (Invio) per continuare: |Premi (Invio) per continuare:
|Centra |Centra
@ -385,10 +385,10 @@ SN|Sei sicuro? [S/n]:
|es. Mario Rossi, login = mrossi |es. Mario Rossi, login = mrossi
|login > |login >
|Quel login esiste gia', scegline uno leggermente diverso. |Quel login esiste gia', scegline uno leggermente diverso.
| |Line
| |Fullscreen
| |External
| |Editor
|Nuovo |Nuovo
|Locale |Locale
|Netmail |Netmail

View File

@ -370,8 +370,8 @@ AT|(A)ctivar/desactivar, desactivar (T)odos, (ENTER) para seguir:
SN|¨Est s seguro? [S/n]: SN|¨Est s seguro? [S/n]:
|Comprobar ficheros nuevos ACTIVADO |Comprobar ficheros nuevos ACTIVADO
|Comprobar ficheros nuevos DESACTIVADO |Comprobar ficheros nuevos DESACTIVADO
|Editor a pantalla completa ACTIVADO |Now using the
|Editor a pantalla completa DESACTIVADO 123|Select: 1) Line editor, 2) Fullscreen editor, 3) External editor
|¡No hay mensajes! |¡No hay mensajes!
|Pulsa (Enter) para seguir: |Pulsa (Enter) para seguir:
|Centrar |Centrar
@ -385,10 +385,10 @@ SN|
|'Elena Nito del Bosque ' puedes usar 'enitob', 'elenanb' o 'enbosque' |'Elena Nito del Bosque ' puedes usar 'enitob', 'elenanb' o 'enbosque'
|login > |login >
|Ese nombre de LOGIN ya existe. Elije otro... |Ese nombre de LOGIN ya existe. Elije otro...
| |Line
| |Fullscreen
| |External
| |Editor
|New |New
|Local |Local
|Netmail |Netmail

View File

@ -523,7 +523,7 @@ struct sysconfig {
char inbound[65]; /* Inbound directory */ char inbound[65]; /* Inbound directory */
char pinbound[65]; /* Protected inbound */ char pinbound[65]; /* Protected inbound */
char outbound[65]; /* Outbound */ char outbound[65]; /* Outbound */
char xsequencer[65]; char externaleditor[65]; /* External mail editor */
char dospath[65]; /* DOS path */ char dospath[65]; /* DOS path */
char uxpath[65]; /* Unix path */ char uxpath[65]; /* Unix path */

View File

@ -36,6 +36,8 @@
#define Max_passlen 14 /* Define maximum passwd length */ #define Max_passlen 14 /* Define maximum passwd length */
typedef enum {LINEEDIT, FSEDIT, EXTEDIT} MSGEDITOR;
/************************************************************************ /************************************************************************
* *
@ -78,7 +80,7 @@ struct userhdr {
struct userrec { struct userrec {
char sUserName[36]; /* User First and Last Name */ char sUserName[36]; /* User First and Last Name */
char Name[9]; /* Unix name */ char Name[9]; /* Unix name */
unsigned long xPassword; /* Users Password (CRC) */ unsigned long xPassword;
char sVoicePhone[20]; /* Voice Number */ char sVoicePhone[20]; /* Voice Number */
char sDataPhone[20]; /* Data/Business Number */ char sDataPhone[20]; /* Data/Business Number */
char sLocation[28]; /* Users Location */ char sLocation[28]; /* Users Location */
@ -102,7 +104,7 @@ struct userrec {
unsigned DoNotDisturb : 1; /* DoNot disturb */ unsigned DoNotDisturb : 1; /* DoNot disturb */
unsigned Cls : 1; /* CLS on/off */ unsigned Cls : 1; /* CLS on/off */
unsigned More : 1; /* More prompt */ unsigned More : 1; /* More prompt */
unsigned FsMsged : 1; /* Fullscreen editor */ unsigned xFsMsged : 1;
unsigned MailScan : 1; /* New Mail scan */ unsigned MailScan : 1; /* New Mail scan */
unsigned Guest : 1; /* Is guest account */ unsigned Guest : 1; /* Is guest account */
unsigned OL_ExtInfo : 1; /* OLR extended msg info */ unsigned OL_ExtInfo : 1; /* OLR extended msg info */
@ -115,7 +117,7 @@ struct userrec {
unsigned xHangUps; unsigned xHangUps;
long Credit; /* Users credit */ long Credit; /* Users credit */
int Paged; /* Times paged today */ int Paged; /* Times paged today */
int xOfflineFmt; int MsgEditor; /* Message Editor to use */
int LastPktNum; /* Todays Last packet number*/ int LastPktNum; /* Todays Last packet number*/
char Archiver[6]; /* Archiver to use */ char Archiver[6]; /* Archiver to use */

View File

@ -30,7 +30,7 @@ MBSEBBS_OBJS = bank.o bbslist.o chat.o file.o funcs.o mail.o menu.o \
MBSEBBS_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ MBSEBBS_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \
../lib/libdbase.a ../lib/libmbinet.a ../lib/libdbase.a ../lib/libmbinet.a
MBNEWUSR_OBJS = mbnewusr.o newuser.o language.o timeout.o dispfile.o oneline.o \ MBNEWUSR_OBJS = mbnewusr.o newuser.o language.o timeout.o dispfile.o oneline.o \
timecheck.o input.o exitinfo.o funcs.o misc.o change.o \ timecheck.o input.o exitinfo.o funcs.o misc.o change.o door.o \
filesub.o mail.o email.o msgutil.o pop3.o lineedit.o fsedit.o whoson.o filesub.o mail.o email.o msgutil.o pop3.o lineedit.o fsedit.o whoson.o
MBNEWUSR_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ MBNEWUSR_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \
../lib/libdbase.a ../lib/libmbinet.a ../lib/libdbase.a ../lib/libmbinet.a
@ -150,7 +150,7 @@ mbuser.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/
page.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h dispfile.h input.h chat.h page.h timeout.h mail.h language.h page.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h dispfile.h input.h chat.h page.h timeout.h mail.h language.h
bye.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h dispfile.h misc.h language.h bye.h bye.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h dispfile.h misc.h language.h bye.h
funcs.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h funcs.h funcs.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h funcs.h
mail.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/clcomm.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h whoson.h mail.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/clcomm.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h door.h whoson.h
newuser.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h funcs.h input.h newuser.h language.h timeout.h change.h dispfile.h newuser.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h funcs.h input.h newuser.h language.h timeout.h change.h dispfile.h
pinfo.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h pinfo.h input.h pinfo.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h pinfo.h input.h
timecheck.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h timecheck.o: ../lib/libs.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h

View File

@ -392,27 +392,53 @@ void Chg_FileCheck()
/* /*
* Toggle Fullscreen Editor * Choose Message Editor
*/ */
void Chg_FsMsged() void Chg_FsMsged()
{ {
ReadExitinfo(); int z;
Enter(2);
if (exitinfo.FsMsged) { ReadExitinfo();
exitinfo.FsMsged = FALSE; Enter(2);
/* Fullscreen Editor is now OFF */
pout(10, 0, (char *) Language(373));
} else {
exitinfo.FsMsged = TRUE;
/* Fullscreen Editor is now ON */
pout(10, 0, (char *) Language(372));
}
Enter(2); /* Now using the */
sleep(2); pout(LIGHTMAGENTA, BLACK, (char *)Language(372));
Syslog('+', "Fullscreen Editor changed to %s", exitinfo.FsMsged ?"True":"False"); /* Line/Fullscreen/External */
WriteExitinfo(); colour(LIGHTCYAN, BLACK);
printf(" %s ", Language(387 + (exitinfo.MsgEditor & 3)));
/* Editor */
pout(LIGHTMAGENTA, BLACK, (char *)Language(390));
Enter(1);
pout(WHITE, BLACK, (char *)Language(373));
fflush(stdout);
alarm_on();
z = toupper(Getone());
if (z == Keystroke(373, 0)) {
exitinfo.MsgEditor = LINEEDIT;
Syslog('+', "User selected line editor");
} else if (z == Keystroke(373, 1)) {
exitinfo.MsgEditor = FSEDIT;
Syslog('+', "User selected fullscreen editor");
} else if (z == Keystroke(373, 2)) {
exitinfo.MsgEditor = EXTEDIT;
Syslog('+', "User selected external editor");
}
Enter(2);
/* Now using the */
pout(LIGHTMAGENTA, BLACK, (char *)Language(372));
/* Line/Fullscreen/External */
colour(LIGHTCYAN, BLACK);
printf(" %s ", Language(387 + (exitinfo.MsgEditor & 3)));
/* Editor */
pout(LIGHTMAGENTA, BLACK, (char *)Language(390));
Enter(2);
sleep(2);
WriteExitinfo();
} }

View File

@ -391,7 +391,15 @@ void ControlCodeU(int ch)
break; break;
case '3': case '3':
printf("%s", exitinfo.FsMsged ? (char *) Language(147) : (char *) Language(148)); switch(exitinfo.MsgEditor) {
case LINEEDIT: printf(Language(387));
break;
case FSEDIT: printf(Language(388));
break;
case EXTEDIT: printf(Language(389));
break;
default: printf("?");
}
break; break;
case '4': case '4':

View File

@ -95,7 +95,7 @@ char *Rdate(char *ind, int Y2K)
/* /*
* Function will run a external program or door * Function will run a external program or door
*/ */
void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSuid) void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSuid, int NoPrompt)
{ {
char *String, *String1; char *String, *String1;
int i, rc; int i, rc;
@ -232,7 +232,9 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu
free(temp1); free(temp1);
printf("\n\n"); printf("\n\n");
Pause();
if (!NoPrompt)
Pause();
} }

View File

@ -3,7 +3,7 @@
#ifndef _DOOR_H #ifndef _DOOR_H
#define _DOOR_H #define _DOOR_H
void ExtDoor(char *, int, int, int, int); /* Run external door */ void ExtDoor(char *, int, int, int, int, int); /* Run external door */
int exec_nosuid(char *); /* Execute as real user */ int exec_nosuid(char *); /* Execute as real user */
#endif #endif

View File

@ -58,6 +58,7 @@
#include "msgutil.h" #include "msgutil.h"
#include "pop3.h" #include "pop3.h"
#include "email.h" #include "email.h"
#include "door.h"
#include "whoson.h" #include "whoson.h"
@ -375,10 +376,12 @@ void SysopComment(char *Cmt)
*/ */
int Edit_Msg() int Edit_Msg()
{ {
if (exitinfo.FsMsged) switch (exitinfo.MsgEditor) {
return Fs_Edit(); case LINEEDIT: return Line_Edit();
else case FSEDIT: return Fs_Edit();
return Line_Edit(); case EXTEDIT: return Ext_Edit();
}
return 0;
} }
@ -2218,3 +2221,85 @@ void SetMsgArea(unsigned long AreaNum)
} }
/*
* External Message Editor
*/
int Ext_Edit()
{
int changed;
int j, i;
char *l, *tmpname;
FILE *fd;
struct stat st1,st2;
changed=FALSE;
tmpname = calloc(PATH_MAX, sizeof(char));
sprintf(tmpname, "%s/%s/%s", CFG.bbs_usersdir, exitinfo.Name, "data.msg");
if ((fd = fopen(tmpname, "w")) == NULL) {
Syslog('+',"EXT_EDIT: Unable to open %s for writing", tmpname);
} else {
fprintf(fd,"AREA='%s'\n",sMsgAreaDesc);
fprintf(fd,"AREANUM='%d'\n",iMsgAreaNumber+1);
fprintf(fd,"AREATYPE='%d'\n",iMsgAreaType);
fprintf(fd,"MSGFROM='%s'\n",Msg.From);
fprintf(fd,"MSGTO='%s'\n",Msg.To);
fprintf(fd,"MSGTOADDR='%s'\n",Msg.ToAddress);
fprintf(fd,"MSGSUBJECT='%s'\n",Msg.Subject);
fprintf(fd,"BBSLANGUAGE='%c'\n",exitinfo.iLanguage);
fprintf(fd,"BBSFSEDKEYS='%d'\n",exitinfo.FSemacs);
fclose(fd);
}
sprintf(tmpname, "%s/%s/%s", CFG.bbs_usersdir, exitinfo.Name, "edit.msg");
if ((fd = fopen(tmpname, "w")) == NULL) {
Syslog('+',"EXT_EDIT: Unable to open %s for writing", tmpname);
} else {
for (i = 1; i <= Line; i++) {
fprintf(fd,"%s\n",Message[i]);
}
fclose(fd);
stat( tmpname, &st1 );
ExtDoor(CFG.externaleditor,FALSE,TRUE,TRUE,FALSE,TRUE);
stat( tmpname, &st2 );
}
if ( st1.st_mtime != st2.st_mtime ) {
l = calloc(81, sizeof(char));
if ((fd = fopen(tmpname, "r")) == NULL) {
Syslog('+',"EXT_EDIT: Unable to open %s for reading", tmpname);
} else {
i=1;
while ( (fgets(l,80,fd) != NULL) && (i < TEXTBUFSIZE ) ) {
for (j = 0; i < strlen(l); j++) {
if (*(l + j) == '\0')
break;
if (*(l + j) == '\n')
*(l + j) = '\0';
if (*(l + j) == '\r')
*(l + j) = '\0';
/*
* Make sure that any tear or origin lines are
* made invalid.
*/
if (strncmp(l, (char *)"--- ", 4) == 0)
l[1] = 'v';
if (strncmp(l, (char *)" * Origin:", 10) == 0)
l[1] = '+';
}
sprintf(Message[i],"%s",l);
i++;
}
changed=TRUE;
Line=i;
fclose(fd);
}
free(l);
}
free(tmpname);
return changed;
}

View File

@ -1,20 +1,24 @@
/* $Id$ */
#ifndef _MAIL_H #ifndef _MAIL_H
#define _MAIL_H #define _MAIL_H
#define TEXTBUFSIZE 500 #define TEXTBUFSIZE 500
int LC(int); /* More prompt for reading messages */ int LC(int); /* More prompt for reading messages */
int Edit_Msg(void); /* Edit a message */ int Edit_Msg(void); /* Edit a message */
int Ext_Edit(void); /* External Message editor */
int CheckLine(int, int, int); /* Check linecounter for read */ int CheckLine(int, int, int); /* Check linecounter for read */
void SysopComment(char *); /* Comment to Sysop */ void SysopComment(char *); /* Comment to Sysop */
void Post_Msg(void); /* Post a message */ void Post_Msg(void); /* Post a message */
void Read_Msgs(void); /* Read Messages */ void Read_Msgs(void); /* Read Messages */
void QuickScan_Msgs(void); /* List Message Headers */ void QuickScan_Msgs(void); /* List Message Headers */
void Delete_Msg(void); /* Delete a specified message */ void Delete_Msg(void); /* Delete a specified message */
void MsgArea_List(char *); /* Select message area */ void MsgArea_List(char *); /* Select message area */
void CheckMail(void); /* Check for new mail */ void CheckMail(void); /* Check for new mail */
void MailStatus(void); /* Mail status in areas */ void MailStatus(void); /* Mail status in areas */
void SetMsgArea(unsigned long); /* Set message area and variables */ void SetMsgArea(unsigned long); /* Set message area and variables */
#endif #endif

View File

@ -334,7 +334,7 @@ void DoMenu(int Type)
case 7: case 7:
/* Run external program */ /* Run external program */
ExtDoor(menus.OptionalData, menus.NoDoorsys, menus.Y2Kdoorsys, menus.Comport, menus.NoSuid); ExtDoor(menus.OptionalData, menus.NoDoorsys, menus.Y2Kdoorsys, menus.Comport, menus.NoSuid, menus.NoPrompt);
break; break;
case 8: case 8:

View File

@ -103,7 +103,7 @@ int newuser()
FullName = calloc(81, sizeof(char)); FullName = calloc(81, sizeof(char));
usrconfig.iLanguage = iLang; usrconfig.iLanguage = iLang;
usrconfig.FsMsged = TRUE; usrconfig.MsgEditor = FSEDIT;
do { do {

View File

@ -1537,6 +1537,51 @@ int edit_newsmode(int y, int x, int val)
char *getmsgeditor(int val)
{
switch (val) {
case LINEEDIT: return (char *)"Line";
case FSEDIT: return (char *)"FS. ";
case EXTEDIT: return (char *)"Ext.";
default: return NULL;
}
}
void show_msgeditor(int y, int x, int val)
{
mvprintw(y, x, getmsgeditor(val));
}
int edit_msgeditor(int y, int x, int val)
{
int ch;
showhelp((char *)"Toggle ^Message editor^ with spacebar, press <Enter> whene done");
do {
set_color(YELLOW, BLUE);
show_msgeditor(y, x, val);
ch = readkey(y, x, YELLOW, BLUE);
if (ch == ' ') {
if (val < EXTEDIT)
val++;
else
val = LINEEDIT;
}
} while ((ch != KEY_ENTER) && (ch != '\012'));
set_color(WHITE, BLACK);
show_msgeditor(y, x, val);
return val;
}
void show_magictype(int y, int x, int val) void show_magictype(int y, int x, int val)
{ {
mvprintw(y, x, getmagictype(val)); mvprintw(y, x, getmagictype(val));

View File

@ -55,6 +55,9 @@ int edit_service(int, int, int);
char *getnewsmode(int); char *getnewsmode(int);
void show_newsmode(int, int, int); void show_newsmode(int, int, int);
int edit_newsmode(int, int, int); int edit_newsmode(int, int, int);
char *getmsgeditor(int);
void show_msgeditor(int, int, int);
int edit_msgeditor(int, int, int);
char *getlinetype(int); char *getlinetype(int);
void show_linetype(int, int, int); void show_linetype(int, int, int);
int edit_linetype(int, int, int); int edit_linetype(int, int, int);

View File

@ -226,6 +226,7 @@ void e_global2(void)
mvprintw( 9, 2, "4. LeaveCase"); mvprintw( 9, 2, "4. LeaveCase");
mvprintw(10, 2, "5. Ftp base"); mvprintw(10, 2, "5. Ftp base");
mvprintw(11, 2, "6. Arealists"); mvprintw(11, 2, "6. Arealists");
mvprintw(12, 2, "7. Ext. edit");
for (;;) { for (;;) {
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
@ -235,15 +236,17 @@ void e_global2(void)
show_bool(9,16, CFG.leavecase); show_bool(9,16, CFG.leavecase);
show_str(10,16,64, CFG.ftp_base); show_str(10,16,64, CFG.ftp_base);
show_str(11,16,64, CFG.alists_path); show_str(11,16,64, CFG.alists_path);
show_str(12,16,64, CFG.externaleditor);
switch(select_menu(6)) { switch(select_menu(7)) {
case 0: return; case 0: return;
case 1: E_PTH(16,16,64, CFG.req_magic, "The path to the ^magic filerequest^ files.") case 1: E_PTH(16,16,64, CFG.req_magic, "The path to the ^magic filerequest^ files.")
case 2: E_STR(17,16,64, CFG.dospath, "The translated ^DOS^ drive and path, empty disables translation") case 2: E_STR(17,16,64, CFG.dospath, "The translated ^DOS^ drive and path, empty disables translation")
case 3: E_PTH(18,16,64, CFG.uxpath, "The translated ^Unix^ path.") case 3: E_PTH(18,16,64, CFG.uxpath, "The translated ^Unix^ path.")
case 4: E_BOOL(19,16, CFG.leavecase, "^Leave^ outbound flo filenames as is, ^No^ forces uppercase.") case 4: E_BOOL(19,16, CFG.leavecase, "^Leave^ outbound flo filenames as is, ^No^ forces uppercase.")
case 5: E_PTH(10,16,64, CFG.ftp_base, "The ^FTP home^ directory to strip of the real directory") case 5: E_PTH(10,16,64, CFG.ftp_base, "The ^FTP home^ directory to strip of the real directory")
case 6: E_PTH(11,16,64, CFG.alists_path, "The path where ^area lists^ and ^filebone lists^ are stored.") case 6: E_PTH(11,16,64, CFG.alists_path, "The path where ^area lists^ and ^filebone lists^ are stored.")
case 7: E_STR(12,16,64, CFG.externaleditor, "The full path and filename to the ^external message editor^")
} }
}; };
} }
@ -1528,7 +1531,6 @@ void global_menu(void)
*/ */
Syslog('+', "Main config, clearing unused fields"); Syslog('+', "Main config, clearing unused fields");
memset(&CFG.alists_path, 0, sizeof(CFG.alists_path)); memset(&CFG.alists_path, 0, sizeof(CFG.alists_path));
memset(&CFG.xsequencer, 0, sizeof(CFG.xsequencer));
CFG.xmax_login = 0; CFG.xmax_login = 0;
CFG.xUseSysDomain = FALSE; CFG.xUseSysDomain = FALSE;
CFG.xChkMail = FALSE; CFG.xChkMail = FALSE;
@ -1777,6 +1779,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Leave case as is %s\n", getboolean(CFG.leavecase)); fprintf(fp, " Leave case as is %s\n", getboolean(CFG.leavecase));
fprintf(fp, " FTP base path %s\n", CFG.ftp_base); fprintf(fp, " FTP base path %s\n", CFG.ftp_base);
fprintf(fp, " Area lists %s\n", CFG.alists_path); fprintf(fp, " Area lists %s\n", CFG.alists_path);
fprintf(fp, " External editor %s\n", CFG.externaleditor);
page = newpage(fp, page); page = newpage(fp, page);
addtoc(fp, toc, 1, 6, page, (char *)"Global settings"); addtoc(fp, toc, 1, 6, page, (char *)"Global settings");

View File

@ -113,10 +113,11 @@ void Show_A_Menu(void)
mvprintw(18, 2, "11. Hi-colors"); mvprintw(18, 2, "11. Hi-colors");
mvprintw(19, 2, "12. Autoexec"); mvprintw(19, 2, "12. Autoexec");
if (menus.MenuType == 7) { if (menus.MenuType == 7) {
mvprintw(16,42, "13. No door.sys"); mvprintw(15,42, "13. No door.sys");
mvprintw(17,42, "14. Y2K style"); mvprintw(16,42, "14. Y2K style");
mvprintw(18,42, "15. Use Comport"); mvprintw(17,42, "15. Use Comport");
mvprintw(19,42, "16. Run nosuid"); mvprintw(18,42, "16. Run nosuid");
mvprintw(19,42, "17. No Prompt");
} }
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
@ -138,10 +139,11 @@ void Show_A_Menu(void)
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
show_bool(19,16, menus.AutoExec); show_bool(19,16, menus.AutoExec);
if (menus.MenuType == 7) { if (menus.MenuType == 7) {
show_bool(16,58, menus.NoDoorsys); show_bool(15,58, menus.NoDoorsys);
show_bool(17,58, menus.Y2Kdoorsys); show_bool(16,58, menus.Y2Kdoorsys);
show_bool(18,58, menus.Comport); show_bool(17,58, menus.Comport);
show_bool(19,58, menus.NoSuid); show_bool(18,58, menus.NoSuid);
show_bool(19,58, menus.NoPrompt);
} }
} }
@ -214,7 +216,7 @@ void Edit_A_Menu(void)
Show_A_Menu(); Show_A_Menu();
for (;;) { for (;;) {
switch(select_menu(16)) { switch(select_menu(17)) {
case 0: return; case 0: return;
break; break;
case 1: E_UPS( 7,16, 1, menus.MenuKey, "The ^key^ to select this menu item") case 1: E_UPS( 7,16, 1, menus.MenuKey, "The ^key^ to select this menu item")
@ -249,19 +251,23 @@ void Edit_A_Menu(void)
break; break;
case 12:E_BOOL(19,16, menus.AutoExec, "Is this an ^Autoexecute^ menu item") case 12:E_BOOL(19,16, menus.AutoExec, "Is this an ^Autoexecute^ menu item")
case 13:if (menus.MenuType == 7) { case 13:if (menus.MenuType == 7) {
E_BOOL(16,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile") E_BOOL(15,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile")
} else } else
break; break;
case 14:if (menus.MenuType == 7) { case 14:if (menus.MenuType == 7) {
E_BOOL(17,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers") E_BOOL(16,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers")
} else } else
break; break;
case 15:if (menus.MenuType == 7) { case 15:if (menus.MenuType == 7) {
E_BOOL(18,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch") E_BOOL(17,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch")
} else } else
break; break;
case 16:if (menus.MenuType == 7) { case 16:if (menus.MenuType == 7) {
E_BOOL(19,58, menus.NoSuid, "Run the door as ^real user (nosuid)^") E_BOOL(18,58, menus.NoSuid, "Run the door as ^real user (nosuid)^")
} else
break;
case 17:if (menus.MenuType == 7) {
E_BOOL(19,58, menus.NoPrompt, "^Don't display prompt^ when door is finished")
} else } else
break; break;
} }
@ -594,6 +600,8 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " No door.sys %s\n", getboolean(menus.NoDoorsys)); fprintf(fp, " No door.sys %s\n", getboolean(menus.NoDoorsys));
fprintf(fp, " Y2K door.sys %s\n", getboolean(menus.Y2Kdoorsys)); fprintf(fp, " Y2K door.sys %s\n", getboolean(menus.Y2Kdoorsys));
fprintf(fp, " Use COM port %s\n", getboolean(menus.Comport)); fprintf(fp, " Use COM port %s\n", getboolean(menus.Comport));
fprintf(fp, " No setuid %s\n", getboolean(menus.NoSuid));
fprintf(fp, " No Prompt %s\n", getboolean(menus.NoPrompt));
} }
fprintf(fp, "\n\n"); fprintf(fp, "\n\n");
j++; j++;

View File

@ -124,8 +124,17 @@ int OpenUsers(void)
*/ */
memset(&usrconfig, 0, sizeof(usrconfig)); memset(&usrconfig, 0, sizeof(usrconfig));
while (fread(&usrconfig, oldsize, 1, fin) == 1) { while (fread(&usrconfig, oldsize, 1, fin) == 1) {
fwrite(&usrconfig, sizeof(usrconfig), 1, fout); /*
memset(&usrconfig, 0, sizeof(usrconfig)); * In version 0.33.20 the message editor has 3 choices,
* adjust settings.
*/
if (usrconfig.xFsMsged && (usrconfig.MsgEditor == LINEEDIT)) {
usrconfig.MsgEditor = FSEDIT;
UsrUpdated = 1;
Syslog('+', "Adjusted editor setting for user %s", usrconfig.sUserName);
}
fwrite(&usrconfig, sizeof(usrconfig), 1, fout);
memset(&usrconfig, 0, sizeof(usrconfig));
} }
fclose(fin); fclose(fin);
@ -295,7 +304,7 @@ void Screen2(void)
mvprintw(10,63, "18. Silent"); mvprintw(10,63, "18. Silent");
mvprintw(11,63, "19. CLS"); mvprintw(11,63, "19. CLS");
mvprintw(12,63, "20. More"); mvprintw(12,63, "20. More");
mvprintw(13,63, "21. Fs Edit"); mvprintw(13,63, "21. Editor");
mvprintw(14,63, "22. MailScan"); mvprintw(14,63, "22. MailScan");
mvprintw(15,63, "23. ShowNews"); mvprintw(15,63, "23. ShowNews");
mvprintw(16,63, "24. NewFiles"); mvprintw(16,63, "24. NewFiles");
@ -331,7 +340,7 @@ void Fields2(void)
show_bool(10,76, usrconfig.DoNotDisturb); show_bool(10,76, usrconfig.DoNotDisturb);
show_bool(11,76, usrconfig.Cls); show_bool(11,76, usrconfig.Cls);
show_bool(12,76, usrconfig.More); show_bool(12,76, usrconfig.More);
show_bool(13,76, usrconfig.FsMsged); show_msgeditor(13,76, usrconfig.MsgEditor);
show_bool(14,76, usrconfig.MailScan); show_bool(14,76, usrconfig.MailScan);
show_bool(15,76, usrconfig.ieNEWS); show_bool(15,76, usrconfig.ieNEWS);
show_bool(16,76, usrconfig.ieFILE); show_bool(16,76, usrconfig.ieFILE);
@ -408,7 +417,8 @@ int EditUsrRec2(void)
case 18:E_BOOL(10,76,usrconfig.DoNotDisturb, "User will not be ^disturbed^") case 18:E_BOOL(10,76,usrconfig.DoNotDisturb, "User will not be ^disturbed^")
case 19:E_BOOL(11,76,usrconfig.Cls, "Send ^ClearScreen code^ to users terminal") case 19:E_BOOL(11,76,usrconfig.Cls, "Send ^ClearScreen code^ to users terminal")
case 20:E_BOOL(12,76,usrconfig.More, "User uses the ^More prompt^") case 20:E_BOOL(12,76,usrconfig.More, "User uses the ^More prompt^")
case 21:E_BOOL(13,76,usrconfig.FsMsged, "User uses the ^Fullscreen editor^") case 21:usrconfig.MsgEditor = edit_msgeditor(13,76,usrconfig.MsgEditor);
break;
case 22:E_BOOL(14,76,usrconfig.MailScan, "Don't check for ^new mail^") case 22:E_BOOL(14,76,usrconfig.MailScan, "Don't check for ^new mail^")
case 23:E_BOOL(15,76,usrconfig.ieNEWS, "Show ^News Bulletins^ when logging in") case 23:E_BOOL(15,76,usrconfig.ieNEWS, "Show ^News Bulletins^ when logging in")
case 24:E_BOOL(16,76,usrconfig.ieFILE, "Show ^New Files^ when logging in") case 24:E_BOOL(16,76,usrconfig.ieFILE, "Show ^New Files^ when logging in")