diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-11-15 23:57:25 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-11-15 23:57:25 +0800 |
commit | 46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48 (patch) | |
tree | 96a334053e3166f95dec80ba9b5c1759dbda8aa4 /mbbsd | |
parent | 8fd6a97dd9ba2275cc628fa3c529f07a927a8acc (diff) | |
download | pttbbs-46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48.tar pttbbs-46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48.tar.gz pttbbs-46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48.tar.bz2 pttbbs-46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48.tar.lz pttbbs-46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48.tar.xz pttbbs-46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48.tar.zst pttbbs-46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48.zip |
add restriction to PERM_VIOLATELAW
no chat
no write
no plan file
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3238 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/chat.c | 6 | ||||
-rw-r--r-- | mbbsd/talk.c | 4 | ||||
-rw-r--r-- | mbbsd/user.c | 29 |
3 files changed, 28 insertions, 11 deletions
diff --git a/mbbsd/chat.c b/mbbsd/chat.c index 917f8c8d..fc8507d1 100644 --- a/mbbsd/chat.c +++ b/mbbsd/chat.c @@ -318,6 +318,12 @@ t_chat(void) char fpath[80]; struct ChatBuf chatbuf; + if(HasUserPerm(PERM_VIOLATELAW)) + { + vmsg("�Х�ú�@��~��ϥβ�ѫ�!"); + return -1; + } + memset(&chatbuf, 0, sizeof(chatbuf)); outs(" �X���e�� �б��........ "); diff --git a/mbbsd/talk.c b/mbbsd/talk.c index d6f0dbc6..af9aad56 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -52,7 +52,7 @@ iswritable_stat(const userinfo_t * uentp, int fri_stat) if (HasUserPerm(PERM_SYSOP)) return 1; - if (!HasUserPerm(PERM_LOGINOK)) + if (!HasUserPerm(PERM_LOGINOK) || HasUserPerm(PERM_VIOLATELAW)) return 0; return (uentp->pager != PAGER_ANTIWB && @@ -471,7 +471,7 @@ my_query(const char *uident) if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible)) prints("�m �� �O �n%-28.28s\n", sex[muser.sex % 8]); - showplans(muser.userid); + showplans_userec(&muser); if(HasUserPerm(PERM_SYSOP|PERM_POLICE) ) { if(vmsg("T: �}�@��")=='T') diff --git a/mbbsd/user.c b/mbbsd/user.c index f9a407bc..0b6c7b37 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1012,15 +1012,20 @@ u_cloak(void) } void -showplans(const char *uid) +showplans_userec(userec_t *user) { char genbuf[200]; + if(user->userlevel & PERM_VIOLATELAW) + { + outs("���H�H�W �|��ú��@��"); + return; + } + #ifdef CHESSCOUNTRY if (user_query_mode) { int i = 0; FILE *fp; - userec_t xuser; sethomefile(genbuf, uid, chess_photo_name[user_query_mode - 1]); if ((fp = fopen(genbuf, "r")) != NULL) @@ -1043,13 +1048,12 @@ showplans(const char *uid) i++; } - getuser(uid, &xuser); if (user_query_mode == 1) { - win = xuser.five_win; - lost = xuser.five_lose; + win = user->five_win; + lost = user->five_lose; } else if(user_query_mode == 2) { - win = xuser.chc_win; - lost = xuser.chc_lose; + win = user->chc_win; + lost = user->chc_lose; } prints("%s <�`�@���Z> %d �� %d ��\n", photo[5], win, lost); @@ -1063,11 +1067,18 @@ showplans(const char *uid) } #endif /* defined(CHESSCOUNTRY) */ - sethomefile(genbuf, uid, fn_plans); + sethomefile(genbuf, user->userid, fn_plans); if (!show_file(genbuf, 7, MAX_QUERYLINES, ONLY_COLOR)) - prints("�m�ӤH�W���n%s �ثe�S���W��", uid); + prints("�m�ӤH�W���n%s �ثe�S���W��", user->userid); } +void +showplans(const char *uid) +{ + userec_t user; + if(getuser(uid, &user)) + showplans_userec(&user); +} /* * return value: how many items displayed */ int |