summaryrefslogtreecommitdiffstats
path: root/mbbsd/admin.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-28 15:46:17 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-28 15:46:17 +0800
commit3b77b08312028151e22bbecb8cfda713de3b13ac (patch)
treeb08d7f4dd192516a42a0dc6d3b0d7b9e730079f0 /mbbsd/admin.c
parent9ad29a4d9bfb725a12cc7869004b78e0837b5ce9 (diff)
downloadpttbbs-3b77b08312028151e22bbecb8cfda713de3b13ac.tar
pttbbs-3b77b08312028151e22bbecb8cfda713de3b13ac.tar.gz
pttbbs-3b77b08312028151e22bbecb8cfda713de3b13ac.tar.bz2
pttbbs-3b77b08312028151e22bbecb8cfda713de3b13ac.tar.lz
pttbbs-3b77b08312028151e22bbecb8cfda713de3b13ac.tar.xz
pttbbs-3b77b08312028151e22bbecb8cfda713de3b13ac.tar.zst
pttbbs-3b77b08312028151e22bbecb8cfda713de3b13ac.zip
only PERM_ACCOUNTS could SetUser
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3236 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/admin.c')
-rw-r--r--mbbsd/admin.c14
1 files changed, 10 insertions, 4 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;