summaryrefslogtreecommitdiffstats
path: root/mbbsd/user.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-30 15:27:50 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-30 15:27:50 +0800
commitf7580a82e730f46435f9ed3b28ad3d64794123a2 (patch)
tree53d2b969285997ed8bf4b29fe4dded56037edc12 /mbbsd/user.c
parentd5b5abdff83a61cd1f824556e7cd7bfddde70956 (diff)
downloadpttbbs-f7580a82e730f46435f9ed3b28ad3d64794123a2.tar
pttbbs-f7580a82e730f46435f9ed3b28ad3d64794123a2.tar.gz
pttbbs-f7580a82e730f46435f9ed3b28ad3d64794123a2.tar.bz2
pttbbs-f7580a82e730f46435f9ed3b28ad3d64794123a2.tar.lz
pttbbs-f7580a82e730f46435f9ed3b28ad3d64794123a2.tar.xz
pttbbs-f7580a82e730f46435f9ed3b28ad3d64794123a2.tar.zst
pttbbs-f7580a82e730f46435f9ed3b28ad3d64794123a2.zip
passwd update debug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1636 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/user.c')
-rw-r--r--mbbsd/user.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c
index a0be22e3..c5a501eb 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -5,7 +5,15 @@ static char *sex[8] = {
MSG_BIG_BOY, MSG_BIG_GIRL, MSG_LITTLE_BOY, MSG_LITTLE_GIRL,
MSG_MAN, MSG_WOMAN, MSG_PLANT, MSG_MIME
};
-
+int
+kill_user(int num)
+{
+ userec_t u;
+ memset(&u, 0, sizeof(u));
+ setuserid(num, "");
+ passwd_index_update(num, &u);
+ return 0;
+}
int
u_loginview()
{
@@ -192,9 +200,8 @@ violate_law(userec_t * u, int unum)
Rename(src, dst);
log_usies("KILL", u->userid);
post_violatelaw(u->userid, cuser.userid, reason, "¬å°£ ID");
- u->userid[0] = '\0';
- setuserid(unum, u->userid);
- passwd_index_update(unum, u);
+ kill_user(unum);
+
} else {
u->userlevel |= PERM_VIOLATELAW;
u->vl_count++;
@@ -604,8 +611,7 @@ uinfo_query(userec_t * u, int real, int unum)
snprintf(dst, sizeof(dst), "tmp/%s", x.userid);
Rename(src, dst); /* do not remove user home */
log_usies("KILL", x.userid);
- x.userid[0] = '\0';
- setuserid(unum, x.userid);
+ kill_user(unum);
} else
log_usies("SetUser", x.userid);
if (money_change)