Added user .signature file

This commit is contained in:
Michiel Broek 2001-11-04 12:44:59 +00:00
parent c02352a9de
commit d5739ef30c
3 changed files with 51 additions and 8 deletions

View File

@ -4243,6 +4243,10 @@ v0.33.19 26-Oct-2001
doing. Also time online is correct now.
Added control-U 5, 6, 7, display users address lines 1, 2
and 3.
If a user doesn't have a .signature file in his homedir, a
simple one will be created.
If a user saves a message at the bbs, the message will be
signed using the .signature file.
mbtask:
Changed to handle the External Doors flag in the lastcaller

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: bbs/funcs4.c
* $Id$
* Purpose ...............: Misc functions, also for some utils.
* Last modification date : 27-Oct-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -732,6 +731,7 @@ char *ChangeHomeDir(char *Name, int Mailboxes)
{
char *temp;
static char temp1[PATH_MAX];
FILE *fp;
temp = calloc(PATH_MAX, sizeof(char));
@ -771,6 +771,23 @@ char *ChangeHomeDir(char *Name, int Mailboxes)
}
setenv("HOME", temp1, 1);
/*
* Check if user has a .signature file.
* If not, create a simple one.
*/
sprintf(temp, "%s/%s/.signature", CFG.bbs_usersdir, Name);
if (access(temp, R_OK)) {
Syslog('+', "Creating users .signature file");
if ((fp = fopen(temp, "w")) == NULL) {
WriteError("$Can't create %s", temp);
} else {
fprintf(fp, " Gtx, %s\n", exitinfo.sUserName);
if (CFG.EmailMode == E_PRMISP)
fprintf(fp, " email: %s@%s\n", exitinfo.Name, CFG.sysdomain);
fclose(fp);
}
}
/*
* Check subdirectories, create them if they don't exist.
*/

View File

@ -1,8 +1,7 @@
/*****************************************************************************
*
* File ..................: bbs/msgutil.c
* $Id$
* Purpose ...............: Utilities for message handling.
* Last modification date : 18-Feb-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@ -242,19 +241,42 @@ void Add_Footkludges(int Quote)
{
char *temp;
char *aka;
FILE *fp;
temp = calloc(128, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char));
aka = calloc(32, sizeof(char));
/*
* If Quote (message entered at the bbs) we append a signature.
*/
if (Quote) {
sprintf(temp, "%s/%s/.signature", CFG.bbs_usersdir, exitinfo.Name);
if ((fp = fopen(temp, "r"))) {
Syslog('m', " Add .signature");
MsgText_Add2((char *)"");
while (fgets(temp, 80, fp)) {
Striplf(temp);
MsgText_Add2(temp);
}
fclose(fp);
MsgText_Add2((char *)"");
}
}
if (msgs.Quotes && Quote) {
Syslog('m', " Add quote");
MsgText_Add2((char *)"");
sprintf(temp, "... %s", Oneliner_Get());
MsgText_Add2(temp);
MsgText_Add2((char *)"");
}
#ifdef __linux__
sprintf(temp, "--- MBSE BBS v%s (Linux)", VERSION);
#elif __FreeBSD__
sprintf(temp, "--- MBSE BBS v%s (FreeBSD)", VERSION);
#else
sprintf(temp, "--- MBSE BBS v%s (Unknown)", VERSION);
#endif
MsgText_Add2(temp);
if (msgs.Type == ECHOMAIL) {