diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-11-07 18:14:35 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-11-07 18:14:35 +0800 |
commit | 0a203d1b99591b7f478e1c45b16862a45886b17d (patch) | |
tree | 68f2a2177c901a6e38054a57f102384181f45d85 | |
parent | 677730185c30d0f88cdf345f5a3e5f94f66e1b57 (diff) | |
download | pttbbs-0a203d1b99591b7f478e1c45b16862a45886b17d.tar pttbbs-0a203d1b99591b7f478e1c45b16862a45886b17d.tar.gz pttbbs-0a203d1b99591b7f478e1c45b16862a45886b17d.tar.bz2 pttbbs-0a203d1b99591b7f478e1c45b16862a45886b17d.tar.lz pttbbs-0a203d1b99591b7f478e1c45b16862a45886b17d.tar.xz pttbbs-0a203d1b99591b7f478e1c45b16862a45886b17d.tar.zst pttbbs-0a203d1b99591b7f478e1c45b16862a45886b17d.zip |
add more permission checks
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5226 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/mail.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index 48903f9c..e263054b 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -28,6 +28,9 @@ setforward(void) int flIdiotSent2Self = 0; int oidlen = strlen(cuser.userid); + if (!HasUserPerm(PERM_LOGINOK)) + return DONOTHING; + vs_hdr("設定自動轉寄"); outs(ANSI_COLOR(1;31) "\n\n" @@ -252,6 +255,9 @@ m_internet(void) char receiver[TTLEN]; char title[TTLEN]; + if (!HasUserPerm(PERM_INTERNET)) + return DONOTHING; + clear(); mvouts(5, 0, "\t為避免成為濫發站外廣告信的來源,本功\能將於12月開始停止服務\n"); @@ -827,6 +833,9 @@ multi_reply(int ent, fileheader_t * fhdr, const char *direct) int mail_list(void) { + if (!HasUserPerm(PERM_LOGINOK)) + return DONOTHING; + vs_hdr("群組作業"); multi_send(NULL); return 0; @@ -1073,10 +1082,15 @@ void setmailalert() else currutmp->alerts &= ~ALERT_NEW_MAIL; } + int m_new(void) { struct ReadNewMailArg arg; + + if (!HasUserPerm(PERM_READMAIL)) + return DONOTHING; + clear(); setutmpmode(RMAIL); memset(&arg, 0, sizeof(arg)); @@ -1989,10 +2003,8 @@ m_read(void) { int back_bid; - /* // deprecated because now we kicks online people. - if (HasUserPerm(PERM_BASIC) && !HasUserPerm(PERM_LOGINOK)) - check_register_notify(); - */ + if (!HasUserPerm(PERM_READMAIL)) + return DONOTHING; if (get_num_records(currmaildir, sizeof(fileheader_t))) { curredit = EDIT_MAIL; |