summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-08 00:50:45 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-08 00:50:45 +0800
commit8fbfe37b9e397580d58d3591fe9bc91718bc950c (patch)
tree9f5e397b3fdb617ddd66300b197c5662826150a7
parent235b163953b3f1aa229e0ce737234a702da0a019 (diff)
downloadpttbbs-8fbfe37b9e397580d58d3591fe9bc91718bc950c.tar
pttbbs-8fbfe37b9e397580d58d3591fe9bc91718bc950c.tar.gz
pttbbs-8fbfe37b9e397580d58d3591fe9bc91718bc950c.tar.bz2
pttbbs-8fbfe37b9e397580d58d3591fe9bc91718bc950c.tar.lz
pttbbs-8fbfe37b9e397580d58d3591fe9bc91718bc950c.tar.xz
pttbbs-8fbfe37b9e397580d58d3591fe9bc91718bc950c.tar.zst
pttbbs-8fbfe37b9e397580d58d3591fe9bc91718bc950c.zip
more perm fix. check perm_basic in menu,
and reject give_money for non-login-ok users git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5230 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/cal.c3
-rw-r--r--pttbbs/mbbsd/menu.c3
-rw-r--r--pttbbs/mbbsd/user.c2
3 files changed, 6 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c
index 6e5ccbda..3630fcd1 100644
--- a/pttbbs/mbbsd/cal.c
+++ b/pttbbs/mbbsd/cal.c
@@ -370,6 +370,9 @@ give_money_ui(const char *userid)
// like user pw/id/...
vs_hdr("給予" MONEYNAME "幣");
+ if (!HasBasicUserPerm(PERM_LOGINOK))
+ return -1;
+
if (!userid || !*userid || strcmp(userid, cuser.userid) == 0)
userid = NULL;
diff --git a/pttbbs/mbbsd/menu.c b/pttbbs/mbbsd/menu.c
index 35d5205c..cfc96520 100644
--- a/pttbbs/mbbsd/menu.c
+++ b/pttbbs/mbbsd/menu.c
@@ -6,7 +6,8 @@
#define CheckMenuPerm(x) \
( (x == MENU_UNREGONLY)? \
((!HasUserPerm(PERM_BASIC) || HasUserPerm(PERM_LOGINOK))?0:1) :\
- ((x) ? HasUserPerm(x) : 1))
+ ((!x) ? 1 : \
+ ((x & PERM_LOGINOK) ? HasBasicUserPerm(x) : HasUserPerm(x))))
/* help & menu processring */
static int refscreen = NA;
diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c
index e32c5aa0..2071d938 100644
--- a/pttbbs/mbbsd/user.c
+++ b/pttbbs/mbbsd/user.c
@@ -1307,7 +1307,7 @@ showplans_userec(userec_t *user)
sethomefile(genbuf, user->userid, fn_plans);
if (!show_file(genbuf, 7, MAX_QUERYLINES, SHOWFILE_ALLOW_COLOR))
- prints("《個人名片》%s 目前沒有名片", user->userid);
+ prints("《個人名片》%s 目前沒有名片\n", user->userid);
}
void