diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-10 10:49:28 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-10 10:49:28 +0800 |
commit | 719b39ec2c97fb3900924c03514e039513e9a3ff (patch) | |
tree | c34d6e0a2755dd8715694ea0bed7a341c0aec592 | |
parent | 269c5c063adceae07fee4cac961f70a26cbc67d9 (diff) | |
download | pttbbs-719b39ec2c97fb3900924c03514e039513e9a3ff.tar pttbbs-719b39ec2c97fb3900924c03514e039513e9a3ff.tar.gz pttbbs-719b39ec2c97fb3900924c03514e039513e9a3ff.tar.bz2 pttbbs-719b39ec2c97fb3900924c03514e039513e9a3ff.tar.lz pttbbs-719b39ec2c97fb3900924c03514e039513e9a3ff.tar.xz pttbbs-719b39ec2c97fb3900924c03514e039513e9a3ff.tar.zst pttbbs-719b39ec2c97fb3900924c03514e039513e9a3ff.zip |
Ban email automatically when killing userid.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5616 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/user.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index e9deb626..5f51b6ea 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -12,6 +12,20 @@ static const char * const chess_type[3] = { }; #endif +void +ban_usermail(const userec_t *u, const char *reason) { + assert(u); + if (!(u->userlevel & PERM_LOGINOK)) + return; + if (!strchr(u->email, '@')) + return; + if (!reason || !*reason) + reason = "(站長忘了打)"; + log_filef("etc/banemail", LOG_CREAT, + "# %s: %s (by %s)\nA%s\n", + u->userid, reason, cuser.userid, u->email); +} + int kill_user(int num, const char *userid) { @@ -394,6 +408,7 @@ violate_law(userec_t * u, int unum) kick_all(u->userid); delete_allpost(u->userid); + ban_usermail(u, reason); kill_user(unum, u->userid); post_violatelaw(u->userid, cuser.userid, reason, "砍除 ID"); } else { |