diff --git a/ChangeLog b/ChangeLog index 07f1cab7..25442664 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/mbsebbs/funcs4.c b/mbsebbs/funcs4.c index 03c29ee6..b747fbb8 100644 --- a/mbsebbs/funcs4.c +++ b/mbsebbs/funcs4.c @@ -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 @@ -730,8 +729,9 @@ char *NameCreate(char *Name, char *Comment, char *Password) */ char *ChangeHomeDir(char *Name, int Mailboxes) { - char *temp; - static char temp1[PATH_MAX]; + 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. */ diff --git a/mbsebbs/msgutil.c b/mbsebbs/msgutil.c index 7d513384..ed5d1a8a 100644 --- a/mbsebbs/msgutil.c +++ b/mbsebbs/msgutil.c @@ -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) {