summaryrefslogtreecommitdiffstats
path: root/mbbsd/user.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-11-15 23:57:25 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-11-15 23:57:25 +0800
commit46e9fa78b7a1f2b6368c8b6cb3c7c0f0f6909b48 (patch)
tree96a334053e3166f95dec80ba9b5c1759dbda8aa4 /mbbsd/user.c
parent8fd6a97dd9ba2275cc628fa3c529f07a927a8acc (diff)
downloadpttbbs-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/user.c')
-rw-r--r--mbbsd/user.c29
1 files changed, 20 insertions, 9 deletions
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("此人違規 尚未繳交罰單");
+ 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 <總共戰績> %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("《個人名片》%s 目前沒有名片", uid);
+ prints("《個人名片》%s 目前沒有名片", user->userid);
}
+void
+showplans(const char *uid)
+{
+ userec_t user;
+ if(getuser(uid, &user))
+ showplans_userec(&user);
+}
/*
* return value: how many items displayed */
int