From 824242e7275cebbda233a9acaef4d3b53b8cbf32 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 24 Feb 2008 12:20:50 +0000 Subject: - 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 --- mbbsd/admin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3