diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 14 | ||||
-rw-r--r-- | mbbsd/menu.c | 6 | ||||
-rw-r--r-- | mbbsd/read.c | 7 | ||||
-rw-r--r-- | mbbsd/talk.c | 9 |
4 files changed, 24 insertions, 12 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index b06bf775..3082cb51 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -42,7 +42,10 @@ m_user(void) move(2, 0); if ((id = getuser(genbuf, &xuser))) { user_display(&xuser, 1); - uinfo_query(&xuser, 1, id); + if( HasUserPerm(PERM_ACCOUNTS) ) + uinfo_query(&xuser, 1, id); + else + pressanykey(); } else { outs(err_uid); clrtoeol(); @@ -54,11 +57,14 @@ m_user(void) static int retrieve_backup(userec_t *user) { - int uid; - char src[PATHLEN], dst[PATHLEN]; - char ans; + int uid; + char src[PATHLEN], dst[PATHLEN]; + char ans; if ((uid = searchuser(user->userid, user->userid))) { + userec_t orig; + passwd_query(uid, &orig); + strlcpy(user->passwd, orig.passwd, sizeof(orig.passwd)); setumoney(uid, user->money); passwd_update(uid, user); return 0; diff --git a/mbbsd/menu.c b/mbbsd/menu.c index 17d51a8b..e91e1dce 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -373,9 +373,9 @@ domenu(int cmdmode, const char *cmdtitle, int cmd, const commands_t cmdtable[]) /* administrator's maintain menu */ static const commands_t adminlist[] = { - {m_user, PERM_ACCOUNTS, "UUser 使用者資料"}, - {search_user_bypwd, PERM_SYSOP, "SSearch User 特殊搜尋使用者"}, - {search_user_bybakpwd,PERM_SYSOP, "OOld User data 查閱\備份使用者資料"}, + {m_user, PERM_SYSOP, "UUser 使用者資料"}, + {search_user_bypwd, PERM_ACCOUNTS,"SSearch User 特殊搜尋使用者"}, + {search_user_bybakpwd,PERM_ACCOUNTS,"OOld User data 查閱\備份使用者資料"}, {m_board, PERM_SYSOP, "BBoard 設定看板"}, {m_register, PERM_ACCOUNTS|PERM_ACCTREG, "RRegister 審核註冊表單"}, diff --git a/mbbsd/read.c b/mbbsd/read.c index 7e781de5..67f96d00 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -780,7 +780,7 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, break; case Ctrl('S'): - if (HasUserPerm(PERM_ACCOUNTS) && locmem->crs_ln>0) { + if (HasUserPerm(PERM_ACCOUNTS|PERM_SYSOP) && locmem->crs_ln>0) { int id; userec_t muser; @@ -791,7 +791,10 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, move(1, 0); if ((id = getuser(headers[locmem->crs_ln - locmem->top_ln].owner, &muser))) { user_display(&muser, 1); - uinfo_query(&muser, 1, id); + if( HasUserPerm(PERM_ACCOUNTS) ) + uinfo_query(&muser, 1, id); + else + pressanykey(); } mode = FULLUPDATE; } diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 8363d156..d6f0dbc6 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2669,7 +2669,7 @@ userlist(void) break; case 'u': /* 線上修改資料 */ - if (HasUserPerm(PERM_ACCOUNTS)) { + if (HasUserPerm(PERM_ACCOUNTS|PERM_SYSOP)) { int id; userec_t muser; strlcpy(currauthor, uentp->userid, sizeof(currauthor)); @@ -2677,7 +2677,10 @@ userlist(void) move(1, 0); if ((id = getuser(uentp->userid, &muser)) > 0) { user_display(&muser, 1); - uinfo_query(&muser, 1, id); + if( HasUserPerm(PERM_ACCOUNTS) ) + uinfo_query(&muser, 1, id); + else + pressanykey(); } redrawall = redraw = 1; } @@ -2716,7 +2719,7 @@ userlist(void) } break; case 'K': - if (HasUserPerm(PERM_ACCOUNTS)) { + if (HasUserPerm(PERM_ACCOUNTS|PERM_SYSOP)) { my_kick(uentp); redrawall = redraw = 1; } |