summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/pttstruct.h14
-rw-r--r--mbbsd/passwd.c7
-rw-r--r--mbbsd/register.c15
3 files changed, 31 insertions, 5 deletions
diff --git a/include/pttstruct.h b/include/pttstruct.h
index e5d886e2..056a837e 100644
--- a/include/pttstruct.h
+++ b/include/pttstruct.h
@@ -284,12 +284,16 @@ typedef struct msgque_t {
int msgmode;
} msgque_t;
-#define ALERT_NEW_MAIL 1
+#define ALERT_NEW_MAIL (0x01)
#define ISNEWMAIL(utmp) (utmp->alerts & ALERT_NEW_MAIL)
-#define ALERT_PWD_PERM 2
-#define ALERT_PWD_BADPOST 4
-#define ALERT_PWD_GOODPOST 8
-#define ALERT_PWD (ALERT_PWD_PERM|ALERT_PWD_BADPOST|ALERT_PWD_GOODPOST)
+#define ALERT_PWD_PERM (0x02)
+#define ALERT_PWD_BADPOST (0x04)
+#define ALERT_PWD_GOODPOST (0x08)
+#define ALERT_PWD_JUSTIFY (0x10)
+// #define ALERT_PWD_LOGINS (0x20)
+// #define ALERT_PWD_POSTS (0x40)
+#define ALERT_PWD_RELOAD (0x80) // reload entire pwd
+#define ALERT_PWD (ALERT_PWD_PERM|ALERT_PWD_BADPOST|ALERT_PWD_GOODPOST|ALERT_PWD_JUSTIFY|ALERT_PWD_RELOAD)
/* user data in shm */
/* use GAP to detect and avoid data overflow and overriding */
typedef struct userinfo_t {
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c
index ddda6a48..0446ddf2 100644
--- a/mbbsd/passwd.c
+++ b/mbbsd/passwd.c
@@ -86,6 +86,13 @@ passwd_update(int num, userec_t * buf)
cuser.goodpost = buf->goodpost = u.goodpost;
if(pwdfd & ALERT_PWD_PERM)
cuser.userlevel = buf->userlevel = u.userlevel;
+ if(pwdfd & ALERT_PWD_JUSTIFY)
+ {
+ memcpy(buf->justify, u.justify, sizeof(u.justify));
+ memcpy(cuser.justify, u.justify, sizeof(u.justify));
+ memcpy(buf->email, u.email, sizeof(u.email));
+ memcpy(cuser.email, u.email, sizeof(u.email));
+ }
currutmp->alerts &= ~ALERT_PWD;
}
if ((pwdfd = open(fn_passwd, O_WRONLY)) < 0)
diff --git a/mbbsd/register.c b/mbbsd/register.c
index e2b3a6b3..75e05287 100644
--- a/mbbsd/register.c
+++ b/mbbsd/register.c
@@ -415,15 +415,30 @@ check_birthday(void)
void
check_register(void)
{
+ char fn[PATHLEN];
+
check_birthday();
if (HasUserPerm(PERM_LOGINOK))
return;
+ // see admin.c
+ setuserfile(fn, "justify.reject");
+
+
/*
* 避免使用者被退回註冊單後,在知道退回的原因之前,
* 又送出一次註冊單。
*/
+ if (dashf(fn))
+ {
+ more(fn, NA);
+ move(b_lines-3, 0);
+ outs("上次註冊單審查失敗。\n"
+ "請重新申請並照上面指示正確填寫註冊單。");
+ while(getans("請輸入 y 繼續: ") != 'y');
+ unlink(fn);
+ } else
if (ISNEWMAIL(currutmp))
m_read();