From 7204388338e4e7445afd399a2e1c4947f86fbce3 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 4 Jul 2005 06:52:14 +0000 Subject: apply rafan's (rafan.bbs@ptt2.cc) big patch to s/username/nickname/g turn off FOREIGN_REG by default in sample/pttbbs.conf git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2887 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/admin.c | 4 ++-- mbbsd/bbs.c | 8 ++++---- mbbsd/chat.c | 2 +- mbbsd/edit.c | 8 ++++---- mbbsd/gomo.c | 4 ++-- mbbsd/kaede.c | 2 +- mbbsd/mail.c | 6 +++--- mbbsd/mbbsd.c | 14 +++++++------- mbbsd/register.c | 8 ++++---- mbbsd/talk.c | 20 ++++++++++---------- mbbsd/user.c | 14 +++++++------- mbbsd/xyz.c | 10 +++++----- 12 files changed, 50 insertions(+), 50 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 14a4fd25..65199e00 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -83,8 +83,8 @@ search_key_user(const char *passwdfile, int mode) else if(mode) { if(strstr(user.realname, key)) keymatch = user.realname; - else if(strstr(user.username, key)) - keymatch = user.username; + else if(strstr(user.nickname, key)) + keymatch = user.nickname; else if(strstr(user.lasthost, key)) keymatch = user.lasthost; else if(strcasestr(user.email, key)) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index b02181e8..344c3c1c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -331,13 +331,13 @@ do_select(int ent, const fileheader_t * fhdr, const char *direct) /* §ï¨} innbbsd Âà¥X«H¥ó¡B³s½u¬å«H¤§³B²zµ{§Ç */ /* ----------------------------------------------------- */ void -outgo_post(const fileheader_t *fh, const char *board, const char *userid, const char *username) +outgo_post(const fileheader_t *fh, const char *board, const char *userid, const char *nickname) { FILE *foo; if ((foo = fopen("innd/out.bntp", "a"))) { fprintf(foo, "%s\t%s\t%s\t%s\t%s\n", - board, fh->filename, userid, username, fh->title); + board, fh->filename, userid, nickname, fh->title); fclose(foo); } } @@ -702,7 +702,7 @@ do_general(int isbid) outgo_post(&postfile, currboard, owner, "Anonymous."); else #endif - outgo_post(&postfile, currboard, cuser.userid, cuser.username); + outgo_post(&postfile, currboard, cuser.userid, cuser.nickname); } brc_addlist(postfile.filename); @@ -1131,7 +1131,7 @@ cross_post(int ent, const fileheader_t * fhdr, const char *direct) append_record(fname, &xfile, sizeof(xfile)); bp = getbcache(getbnum(xboard)); if (!xfile.filemode && !(bp->brdattr & BRD_NOTRAN)) - outgo_post(&xfile, xboard, cuser.userid, cuser.username); + outgo_post(&xfile, xboard, cuser.userid, cuser.nickname); #ifdef USE_COOLDOWN if(bp->nuser>30) { diff --git a/mbbsd/chat.c b/mbbsd/chat.c index d679c18e..3872bc77 100644 --- a/mbbsd/chat.c +++ b/mbbsd/chat.c @@ -218,7 +218,7 @@ chat_query(char *arg) FILE *fp; snprintf(buf, sizeof(buf), "%s(%s) ¦@¤W¯¸ %d ¦¸¡Aµoªí¹L %d ½g¤å³¹", - xuser.userid, xuser.username, + xuser.userid, xuser.nickname, xuser.numlogins, xuser.numposts); printchatline(buf); diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 8a7dcf49..36b7837b 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1378,7 +1378,7 @@ write_header(FILE * fp, int ifuseanony) // FIXME unused if (curredit & EDIT_MAIL || curredit & EDIT_LIST) { fprintf(fp, "%s %s (%s)\n", str_author1, cuser.userid, - cuser.username + cuser.nickname ); } else { char *ptr; @@ -1434,17 +1434,17 @@ write_header(FILE * fp, int ifuseanony) // FIXME unused fprintf(fp, "%s %s (%s) %s %s\n", str_author1, postlog.author, (((!strcmp(real_name, "r") && defanony) || - (!real_name[0] && (!defanony))) ? cuser.username : + (!real_name[0] && (!defanony))) ? cuser.nickname : "²q²q§Ú¬O½Ö ? ^o^"), local_article ? str_post2 : str_post1, currboard); } else { fprintf(fp, "%s %s (%s) %s %s\n", str_author1, cuser.userid, - cuser.username, + cuser.nickname, local_article ? str_post2 : str_post1, currboard); } #else /* HAVE_ANONYMOUS */ fprintf(fp, "%s %s (%s) %s %s\n", str_author1, cuser.userid, - cuser.username, + cuser.nickname, local_article ? str_post2 : str_post1, currboard); #endif /* HAVE_ANONYMOUS */ diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index 52d7bbf3..af7fb3c8 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -446,7 +446,7 @@ gomoku(int fd) switch (line - 2) { case 0: prints("<¥N¸¹> %s", cuser.userid); break; - case 1: prints("<¼ÊºÙ> %.16s", cuser.username); break; + case 1: prints("<¼ÊºÙ> %.16s", cuser.nickname); break; case 2: prints("<¤W¯¸> %d", cuser.numlogins); break; case 3: prints("<¤å³¹> %d", cuser.numposts); break; case 4: prints("<¾¦ì> %-4s %s", country, level); break; @@ -493,7 +493,7 @@ gomoku(int fd) move(line, 37); switch (line - 11) { case 0: prints("<¥N¸¹> %-16.16s ", xuser.userid); break; - case 1: prints("<¼ÊºÙ> %-16.16s ", xuser.username); break; + case 1: prints("<¼ÊºÙ> %-16.16s ", xuser.nickname); break; case 2: prints("<¤W¯¸> %-16d ", xuser.numlogins); break; case 3: prints("<¤å³¹> %-16d ", xuser.numposts); break; case 4: prints("<¾¦ì> %-4s %-10s ", country, level); break; diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c index b8fad1fc..33b5e826 100644 --- a/mbbsd/kaede.c +++ b/mbbsd/kaede.c @@ -58,7 +58,7 @@ Ptt_prints(char *str, int mode) "%d", cuser.numposts); break; case 'n': - strlcpy(strbuf+w, cuser.username, sizeof(strbuf)-w); + strlcpy(strbuf+w, cuser.nickname, sizeof(strbuf)-w); w += strlen(strbuf+w); break; /* It's saver not to send these undefined escape string. diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 300f2e96..5e9be2fe 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1173,7 +1173,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct) append_record(fname, &xfile, sizeof(xfile)); setbtotal(getbnum(xboard)); if (!xfile.filemode) - outgo_post(&xfile, xboard, cuser.userid, cuser.username); + outgo_post(&xfile, xboard, cuser.userid, cuser.nickname); #ifdef USE_COOLDOWN if (bcache[getbnum(xboard) - 1].brdattr & BRD_COOLDOWN) add_cooldowntime(usernum, 5); @@ -1529,7 +1529,7 @@ bbs_sendmail(const char *fpath, const char *title, char *receiver) if (fpath) fprintf(fout, "Reply-To: %s%s\nFrom: %s <%s%s>\n", cuser.userid, str_mail_address, - cuser.username, + cuser.nickname, cuser.userid, str_mail_address); fprintf(fout,"To: %s\nSubject: %s\n" "Mime-Version: 1.0\r\n" @@ -1592,7 +1592,7 @@ bsmtp(const char *fpath, const char *title, const char *rcpt, int method) mqueue.mailtime = chrono; mqueue.method = method; strlcpy(mqueue.sender, cuser.userid, sizeof(mqueue.sender)); - strlcpy(mqueue.username, cuser.username, sizeof(mqueue.username)); + strlcpy(mqueue.username, cuser.nickname, sizeof(mqueue.username)); strlcpy(mqueue.rcpt, rcpt, sizeof(mqueue.rcpt)); if (append_record("out/.DIR", (fileheader_t *) & mqueue, sizeof(mqueue)) < 0) return 0; diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 6f4faecc..d7876382 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -123,7 +123,7 @@ log_usies(const char *mode, const char *mesg) log_file(FN_USIES, LOG_CREAT | LOG_VF, "%s %s %-12s Stay:%d (%s)\n", Cdate(&now), mode, cuser.userid , - (int)(now - login_start_time) / 60, cuser.username); + (int)(now - login_start_time) / 60, cuser.nickname); else log_file(FN_USIES, LOG_CREAT | LOG_VF, "%s %s %-12s %s\n", @@ -497,7 +497,7 @@ multi_user_check(void) if (genbuf[0] != 'n') { if (pid > 0) kill(pid, SIGHUP); - log_usies("KICK ", cuser.username); + log_usies("KICK ", cuser.nickname); } else { if (search_ulistn(usernum, 3) != NULL) abort_bbs(0); /* Goodbye(); */ @@ -777,8 +777,8 @@ setup_utmp(int mode) uinfo.lastact = time(NULL); strlcpy(uinfo.userid, cuser.userid, sizeof(uinfo.userid)); //strlcpy(uinfo.realname, cuser.realname, sizeof(uinfo.realname)); - strlcpy(uinfo.username, cuser.username, sizeof(uinfo.username)); - strip_nonebig5(uinfo.username, sizeof(uinfo.username)); + strlcpy(uinfo.nickname, cuser.nickname, sizeof(uinfo.nickname)); + strip_nonebig5(uinfo.nickname, sizeof(uinfo.nickname)); strlcpy(uinfo.from, fromhost, sizeof(uinfo.from)); uinfo.five_win = cuser.five_win; uinfo.five_lose = cuser.five_lose; @@ -892,10 +892,10 @@ static void init_guest_info(void) "·R¤§¨ý", "¤Ñ¤W", "ÂŦâ¬À·äÁG" }; i = login_start_time % 13; - snprintf(cuser.username, sizeof(cuser.username), + snprintf(cuser.nickname, sizeof(cuser.nickname), "®üÃäº}¨Óªº%s", nick[(int)i]); - strlcpy(currutmp->username, cuser.username, - sizeof(currutmp->username)); + strlcpy(currutmp->nickname, cuser.nickname, + sizeof(currutmp->nickname)); strlcpy(cuser.realname, name[(int)i], sizeof(cuser.realname)); strlcpy(cuser.address, addr[(int)i], sizeof(cuser.address)); cuser.sex = i % 8; diff --git a/mbbsd/register.c b/mbbsd/register.c index 3679792a..65133010 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -307,11 +307,11 @@ check_register(void) stand_title("½Ð¸Ô²Ó¶ñ¼g­Ó¤H¸ê®Æ"); - while (strlen(cuser.username) < 2) - getdata(2, 0, "ºï¸¹¼ÊºÙ¡G", cuser.username, - sizeof(cuser.username), DOECHO); + while (strlen(cuser.nickname) < 2) + getdata(2, 0, "ºï¸¹¼ÊºÙ¡G", cuser.nickname, + sizeof(cuser.nickname), DOECHO); - for (ptr = cuser.username; *ptr; ptr++) { + for (ptr = cuser.nickname; *ptr; ptr++) { if (*ptr == 9) /* TAB convert */ *ptr = ' '; } diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 58d3331e..200ba21c 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -343,7 +343,7 @@ my_kick(userinfo_t * uentp) clrtoeol(); if (genbuf[0] == 'y') { snprintf(genbuf, sizeof(genbuf), - "%s (%s)", uentp->userid, uentp->username); + "%s (%s)", uentp->userid, uentp->nickname); log_usies("KICK ", genbuf); if ((uentp->pid <= 0 || kill(uentp->pid, SIGHUP) == -1) && (errno == ESRCH)) purge_utmp(uentp); @@ -397,8 +397,8 @@ my_query(const char *uident) prints("¡m¢×¢Ò¼ÊºÙ¡n%s(%s)%*s¡m¸gÀÙª¬ªp¡n%s", muser.userid, - muser.username, - (int)(26 - strlen(muser.userid) - strlen(muser.username)), "", + muser.nickname, + (int)(26 - strlen(muser.userid) - strlen(muser.nickname)), "", money_level(muser.money)); if (uentp && ((fri_stat & HFM && !uentp->invisible) || strcmp(muser.userid,cuser.userid) == 0)) prints(" ($%d)", muser.money); @@ -1139,7 +1139,7 @@ do_talk(int fd) setutmpmode(TALK); ch = 58 - strlen(save_page_requestor); - snprintf(genbuf, sizeof(genbuf), "%s¡i%s", cuser.userid, cuser.username); + snprintf(genbuf, sizeof(genbuf), "%s¡i%s", cuser.userid, cuser.nickname); i = ch - strlen(genbuf); if (i >= 0) i = (i >> 1) + 1; @@ -1489,7 +1489,7 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) if (c == 'y') { snprintf(save_page_requestor, sizeof(save_page_requestor), - "%s (%s)", uin->userid, uin->username); + "%s (%s)", uin->userid, uin->nickname); /* gomo */ switch (uin->sig) { case SIG_DARK: @@ -2010,7 +2010,7 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, fcolor[state], uentp->userid, /* nickname */ - uentp->username, + uentp->nickname, /* from */ descript(show_mode, uentp, @@ -2521,7 +2521,7 @@ userlist(void) case 'a': if (HasUserPerm(PERM_LOGINOK) && !(fri_stat & IFH)) { if (getans("½T©w­n¥[¤J¦n¤Í¶Ü [N/y]") == 'y') { - friend_add(uentp->userid, FRIEND_OVERRIDE,uentp->username); + friend_add(uentp->userid, FRIEND_OVERRIDE,uentp->nickname); friend_load(FRIEND_OVERRIDE); } redrawall = redraw = 1; @@ -2667,8 +2667,8 @@ userlist(void) case 'N': if (HasUserPerm(PERM_LOGINOK)) { oldgetdata(1, 0, "·sªº¼ÊºÙ: ", - cuser.username, sizeof(cuser.username), DOECHO); - strcpy(currutmp->username, cuser.username); + cuser.nickname, sizeof(cuser.nickname), DOECHO); + strcpy(currutmp->nickname, cuser.nickname); redrawall = redraw = 1; } break; @@ -2884,7 +2884,7 @@ talkreply(void) uip = &SHM->uinfo[currutmp->destuip]; snprintf(page_requestor, sizeof(page_requestor), - "%s (%s)", uip->userid, uip->username); + "%s (%s)", uip->userid, uip->nickname); currutmp->destuid = uip->uid; currstat = REPLY; /* ÁקK¥X²{°Êµe */ diff --git a/mbbsd/user.c b/mbbsd/user.c index ac8af2da..81f9f53d 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -80,7 +80,7 @@ user_display(const userec_t * u, int adminmode) " ¹q¤l«H½c: %s\n" " ©Ê §O: %s\n" " »È¦æ±b¤á: %d »È¨â\n", - u->userid, u->username, u->realname, + u->userid, u->nickname, u->realname, #if FOREIGN_REG_DAY > 0 u->uflag2 & FOREIGN ? "(¥~Äy: " : "", u->uflag2 & FOREIGN ? @@ -532,8 +532,8 @@ uinfo_query(userec_t *u, int adminmode, int unum) move(0, 0); outs("½Ð³v¶µ­×§ï¡C"); - getdata_buf(i++, 0, " ¼Ê ºÙ ¡G", x.username, - sizeof(x.username), DOECHO); + getdata_buf(i++, 0, " ¼Ê ºÙ ¡G", x.nickname, + sizeof(x.nickname), DOECHO); if (adminmode) { getdata_buf(i++, 0, "¯u¹ê©m¦W¡G", x.realname, sizeof(x.realname), DOECHO); @@ -929,7 +929,7 @@ u_info(void) move(2, 0); user_display(&cuser, 0); uinfo_query(&cuser, 0, usernum); - strlcpy(currutmp->username, cuser.username, sizeof(currutmp->username)); + strlcpy(currutmp->nickname, cuser.nickname, sizeof(currutmp->nickname)); return 0; } @@ -1504,7 +1504,7 @@ u_register(void) move(2, 0); prints("%s(%s) ±z¦n¡A½Ð¿é¤J±zªº»{ÃÒ½X¡C\n" "©Î±z¥i¥H¿é¤J x ¨Ó­«·s¶ñ¼g E-Mail ©Î§ï¥Ñ¯¸ªø¤â°Ê»{ÃÒ\n", - cuser.userid, cuser.username); + cuser.userid, cuser.nickname); inregcode[0] = 0; do{ @@ -1570,7 +1570,7 @@ u_register(void) clear(); move(1, 0); prints("%s(%s) ±z¦n¡A½Ð¾Ú¹ê¶ñ¼g¥H¤Uªº¸ê®Æ:", - cuser.userid, cuser.username); + cuser.userid, cuser.nickname); #ifdef FOREIGN_REG fore[0] = 'y'; fore[1] = 0; @@ -1761,7 +1761,7 @@ u_list_CB(int num, userec_t * uentp) ptr[18] = '\0'; prints("%-14s %-27.27s%5d %5d %s %s\n", uentp->userid, - uentp->username, + uentp->nickname, uentp->numlogins, uentp->numposts, HasUserPerm(PERM_SEEULEVELS) ? permstr : "", ptr); usercounter++; diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c index af5aeb5b..abbad06a 100644 --- a/mbbsd/xyz.c +++ b/mbbsd/xyz.c @@ -174,7 +174,7 @@ note(void) typedef struct notedata_t { time4_t date; char userid[IDLEN + 1]; - char username[19]; + char nickname[19]; char buf[3][80]; } notedata_t; notedata_t myitem; @@ -200,8 +200,8 @@ note(void) } while (buf[0] == 'e'); demoney(-5); strcpy(myitem.userid, cuser.userid); - strncpy(myitem.username, cuser.username, 18); - myitem.username[18] = '\0'; + strncpy(myitem.nickname, cuser.nickname, 18); + myitem.nickname[18] = '\0'; myitem.date = now; /* begin load file */ @@ -233,7 +233,7 @@ note(void) while (total) { snprintf(buf, sizeof(buf), ANSI_COLOR(1;31) "ùÝ¢t" ANSI_COLOR(32) " %s " ANSI_COLOR(37) "(%s)", - myitem.userid, myitem.username); + myitem.userid, myitem.nickname); len = strlen(buf); for (i = len; i < 71; i++) @@ -364,7 +364,7 @@ Goodbye(void) #if 0 // def LOW_SECURITY prints(ANSI_COLOR(1;36) "¿Ë·Rªº " ANSI_COLOR(33) "%s(%s)" ANSI_COLOR(36) "¡A§O§Ñ¤F¦A«×¥úÁ{" ANSI_COLOR(45;33) "" " %s " ANSI_COLOR(40;36) "¡I\n¥H¤U¬O±z¦b¯¸¤ºªºµù¥U¸ê®Æ:" ANSI_COLOR(0) "\n", - cuser.userid, cuser.username, BBSName); + cuser.userid, cuser.nickname, BBSName); user_display(&cuser, 0); pressanykey(); #endif -- cgit v1.2.3