summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2011-10-12 22:33:02 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2011-10-12 22:33:02 +0800
commit3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31 (patch)
tree3616e4e767113f374e1ccdea3a50a346a85e3118
parent547f2b5d17610717af2f49916306faa4a7401e3b (diff)
downloadpttbbs-3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31.tar
pttbbs-3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31.tar.gz
pttbbs-3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31.tar.bz2
pttbbs-3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31.tar.lz
pttbbs-3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31.tar.xz
pttbbs-3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31.tar.zst
pttbbs-3b56baa4e682cffd1d389a5b9d1ae593a7ee7f31.zip
improve removebm when registering new char
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5415 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/register.c9
-rw-r--r--pttbbs/util/removebm.c9
2 files changed, 17 insertions, 1 deletions
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c
index 2e14405d..f9fe7dcb 100644
--- a/pttbbs/mbbsd/register.c
+++ b/pttbbs/mbbsd/register.c
@@ -738,6 +738,15 @@ new_register(void)
exit(1);
}
log_usies("REGISTER", fromhost);
+#ifdef USE_REMOVEBM_ON_NEWREG
+ {
+ char buf[PATHLEN];
+ snprintf(buf, sizeof(buf),
+ BBSHOME "bin/removebm '%s' >/dev/null 2>&1",
+ newuser.userid);
+ system(buf);
+ }
+#endif
}
int
diff --git a/pttbbs/util/removebm.c b/pttbbs/util/removebm.c
index 5a3308e6..d04284c4 100644
--- a/pttbbs/util/removebm.c
+++ b/pttbbs/util/removebm.c
@@ -14,6 +14,9 @@ int check(void *data, int bid, boardheader_t *bh)
if (!bh->brdname[0] || !bh->BM[0])
return 0;
+ if (!strcasestr(bh->BM, userid))
+ return 0;
+
strlcpy(bmsrc, bh->BM, sizeof(bmsrc));
p = bmsrc;
@@ -43,7 +46,11 @@ int check(void *data, int bid, boardheader_t *bh)
if (!changed)
return 0;
- printf("%s: %s -> %s\n", bh->brdname, bh->BM, bmout);
+ now = time(0);
+ log_filef(BBSHOME "/log/removebm.log", LOG_CREAT,
+ "%s [%s] %s: %s->%s\n",
+ Cdatelite(&now), userid,
+ bh->brdname, bh->BM, bmout);
if (has_quote)
snprintf(bh->BM, sizeof(bh->BM), "[%s]", bmout);