summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-02-24 20:20:50 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-02-24 20:20:50 +0800
commit824242e7275cebbda233a9acaef4d3b53b8cbf32 (patch)
tree947c93d1cc93ee3fdbce0d989bddd6088d7e33a2 /mbbsd
parent0bf17643b07798d26cadeb927bde8db6c4f9fd0d (diff)
downloadpttbbs-824242e7275cebbda233a9acaef4d3b53b8cbf32.tar
pttbbs-824242e7275cebbda233a9acaef4d3b53b8cbf32.tar.gz
pttbbs-824242e7275cebbda233a9acaef4d3b53b8cbf32.tar.bz2
pttbbs-824242e7275cebbda233a9acaef4d3b53b8cbf32.tar.lz
pttbbs-824242e7275cebbda233a9acaef4d3b53b8cbf32.tar.xz
pttbbs-824242e7275cebbda233a9acaef4d3b53b8cbf32.tar.zst
pttbbs-824242e7275cebbda233a9acaef4d3b53b8cbf32.zip
- admin: should not allow changing info when browsing PASSWD history.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3946 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/admin.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index 82b8b9b1..96982d5e 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -98,7 +98,9 @@ search_key_user(const char *passwdfile, int mode)
FILE *fp1 = fopen(passwdfile, "r");
char friendfile[128]="", key[22], *keymatch;
int keytype = 0;
+ char isCurrentPwd = 0;
+ isCurrentPwd = (strcmp(passwdfile, FN_PASSWD) == 0) ? 1 : 0;
assert(fp1);
clear();
if (!mode)
@@ -175,7 +177,7 @@ search_key_user(const char *passwdfile, int mode)
user_display(&user, 1);
// user_display does not have linefeed in tail.
- if (HasUserPerm(PERM_ACCOUNTS))
+ if (isCurrentPwd && HasUserPerm(PERM_ACCOUNTS))
uinfo_query(&user, 1, unum);
else
outs("\n");