summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-04 11:10:20 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-04 11:10:20 +0800
commit04b5b79e7900940fc79dd4c4d8a3def9601abcd8 (patch)
treebbf1b9fae98202f6380071e02f60736751820bf8
parent631d89bd7cb7a9a2bedfeafda5158489c7265a9e (diff)
downloadpttbbs-04b5b79e7900940fc79dd4c4d8a3def9601abcd8.tar
pttbbs-04b5b79e7900940fc79dd4c4d8a3def9601abcd8.tar.gz
pttbbs-04b5b79e7900940fc79dd4c4d8a3def9601abcd8.tar.bz2
pttbbs-04b5b79e7900940fc79dd4c4d8a3def9601abcd8.tar.lz
pttbbs-04b5b79e7900940fc79dd4c4d8a3def9601abcd8.tar.xz
pttbbs-04b5b79e7900940fc79dd4c4d8a3def9601abcd8.tar.zst
pttbbs-04b5b79e7900940fc79dd4c4d8a3def9601abcd8.zip
- regform: enable kick-out mechanism for regform system
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4078 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/proto.h1
-rw-r--r--mbbsd/mbbsd.c1
-rw-r--r--mbbsd/register.c38
3 files changed, 31 insertions, 9 deletions
diff --git a/include/proto.h b/include/proto.h
index 531bf467..96fccf76 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -529,6 +529,7 @@ int setupnewuser(const userec_t *user);
int regform_estimate_queuesize();
void new_register(void);
void check_register(void);
+void check_birthday(void);
// void check_register_notify(void);
void delregcodefile(void);
char *genpasswd(char *pw);
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index b6b7c798..bdcbd0a3 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1205,6 +1205,7 @@ user_login(void)
}
check_bad_login();
check_mailbox_quota();
+ check_birthday();
check_register();
record_lasthost(fromhost);
restore_backup();
diff --git a/mbbsd/register.c b/mbbsd/register.c
index 0207014c..09e25451 100644
--- a/mbbsd/register.c
+++ b/mbbsd/register.c
@@ -741,28 +741,31 @@ check_register(void)
{
char fn[PATHLEN];
- check_birthday();
if (HasUserPerm(PERM_LOGINOK))
return;
- setuserfile(fn, FN_REJECT_NOTIFY);
-
/*
* 避免使用者被退回註冊單後,在知道退回的原因之前,
* 又送出一次註冊單。
*/
+ setuserfile(fn, FN_REJECT_NOTIFY);
if (dashf(fn))
{
more(fn, NA);
move(b_lines-3, 0);
- outs("上次註冊單審查失敗。\n"
+ outs("上次註冊單審查失敗。 (本記錄已備份於您的信箱中)\n"
"請重新申請並照上面指示正確填寫註冊單。");
while(getans("請輸入 y 繼續: ") != 'y');
unlink(fn);
- } else
+ }
+
+ // alerting by email is only used by regform1
+#ifndef USE_REGFORM2
+ else
if (ISNEWMAIL(currutmp))
m_read();
+#endif // !USE_REGFORM2
if (!HasUserPerm(PERM_SYSOP)) {
/* 回覆過身份認證信函,或曾經 E-mail post 過 */
@@ -1465,7 +1468,11 @@ regform_accept(const char *userid, const char *justify)
passwd_update(unum, &muser);
// alert online users?
- sendalert(muser.userid, ALERT_PWD_PERM|ALERT_PWD_JUSTIFY); // force to reload perm
+ if (search_ulist(unum))
+ {
+ sendalert(muser.userid, ALERT_PWD_PERM|ALERT_PWD_JUSTIFY); // force to reload perm
+ kick_all(muser.userid);
+ }
#if FOREIGN_REG_DAY > 0
if(muser.uflag2 & FOREIGN)
@@ -1497,8 +1504,12 @@ regform_reject(const char *userid, const char *reason, const RegformEntry *pre)
// update password file
passwd_update(unum, &muser);
- // alert notify users?
- sendalert(muser.userid, ALERT_PWD_PERM); // force to reload perm
+ // alert online users?
+ if (search_ulist(unum))
+ {
+ sendalert(muser.userid, ALERT_PWD_PERM); // force to reload perm
+ kick_all(muser.userid);
+ }
// last: send notification
mkuserdir(muser.userid);
@@ -1513,8 +1524,17 @@ regform_reject(const char *userid, const char *reason, const RegformEntry *pre)
// multiple abbrev loop
regform_print_reasons(reason, fp);
fclose(fp);
+
+ // XXX how to handle the notification file better?
+ // mail_log2id: do not use move.
// mail_muser(muser, "[註冊失敗]", buf);
- mail_log2id(muser.userid, "[註冊失敗]", buf, "[註冊系統]", 1, 0);
+#ifdef USE_REGFORM2
+ // use regform2! no need to set 'newmail'.
+ mail_log2id(muser.userid, "[註冊失敗記錄]", buf, "[註冊系統]", 0, 0);
+#else
+ // must set newmail
+ mail_log2id(muser.userid, "[註冊失敗記錄]", buf, "[註冊系統]", 1, 0);
+#endif
}
// Regform v1 API