summaryrefslogtreecommitdiffstats
path: root/mbbsd/admin.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-16 16:25:29 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-16 16:25:29 +0800
commitcf62c6d70dcbe8cc6bb6cbf72377a60c2363e212 (patch)
tree9dfeccf0ebff5a565992d9b3ca4b40ffac86910a /mbbsd/admin.c
parent968a86a3b520514f2957e0cec6be6ea1c34487ea (diff)
downloadpttbbs-cf62c6d70dcbe8cc6bb6cbf72377a60c2363e212.tar
pttbbs-cf62c6d70dcbe8cc6bb6cbf72377a60c2363e212.tar.gz
pttbbs-cf62c6d70dcbe8cc6bb6cbf72377a60c2363e212.tar.bz2
pttbbs-cf62c6d70dcbe8cc6bb6cbf72377a60c2363e212.tar.lz
pttbbs-cf62c6d70dcbe8cc6bb6cbf72377a60c2363e212.tar.xz
pttbbs-cf62c6d70dcbe8cc6bb6cbf72377a60c2363e212.tar.zst
pttbbs-cf62c6d70dcbe8cc6bb6cbf72377a60c2363e212.zip
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@857 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/admin.c')
-rw-r--r--mbbsd/admin.c48
1 files changed, 38 insertions, 10 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index 15659d31..9ffe5a08 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -1,4 +1,4 @@
-/* $Id: admin.c,v 1.40 2003/05/12 12:47:18 victor Exp $ */
+/* $Id: admin.c,v 1.41 2003/05/16 08:25:10 ptt Exp $ */
#include "bbs.h"
/* 使用者管理 */
@@ -32,8 +32,10 @@ search_key_user(char *passwdfile, int mode)
userec_t user;
int ch;
int coun = 0;
- FILE *fp1 = fopen(passwdfile, "r");
- char buf[128], key[22], genbuf[8];
+ FILE *fp1 = fopen(passwdfile, "r");
+ char friendfile[128]="",buf[128], key[22], genbuf[8],
+ *keymatch;
+
assert(fp1);
clear();
@@ -46,12 +48,28 @@ search_key_user(char *passwdfile, int mode)
outs(buf);
refresh();
}
- if (!strcasecmp(user.userid, key) ||
- (mode && (
- strstr(user.realname, key) || strstr(user.username, key) ||
- strstr(user.lasthost, key) || strstr(user.email, key) ||
- strstr(user.address, key) || strstr(user.justify, key) ||
- strstr(user.mychicken.name, key)))) {
+ keymatch=NULL;
+ if (!strcasecmp(user.userid, key))
+ sprintf(keymatch,"id:%s",user.userid);
+ else if(mode)
+ {
+ if(strstr(user.realname, key))
+ keymatch=user.realname;
+ else if(strstr(user.username, key))
+ keymatch=user.username;
+ else if(strstr(user.lasthost, key))
+ keymatch=user.lasthost;
+ else if(strstr(user.email, key))
+ keymatch=user.email;
+ else if(strstr(user.address, key))
+ keymatch=user.address;
+ else if(strstr(user.justify, key))
+ keymatch=user.justify;
+ else if(strstr(user.mychicken.name, key))
+ keymatch=user.mychicken.name;
+ }
+ if(keymatch)
+ {
move(1, 0);
snprintf(buf, sizeof(buf), "第 [%d] 筆資料\n", coun);
outs(buf);
@@ -61,10 +79,20 @@ search_key_user(char *passwdfile, int mode)
uinfo_query(&user, 1, coun);
outs("\033[44m 空白鍵\033[37m:搜尋下一個"
" \033[33m Q\033[37m: 離開");
- outs(mode ? " \033[m " :
+ outs(mode ?
+ " A: add to namelist \033[m " :
" S: 取用備份資料 \033[m ");
while (1) {
while ((ch = igetch()) == 0);
+ if (ch == 'a' || ch=='A' )
+ {
+ if(!friendfile[0])
+ {
+ friend_special();
+ setfriendfile(friendfile, FRIEND_SPECIAL);
+ }
+ friend_add(user.userid, FRIEND_SPECIAL, keymatch);
+ }
if (ch == ' ')
break;
if (ch == 'q' || ch == 'Q') {