summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-29 22:31:57 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-29 22:31:57 +0800
commit6b2f2f3e275322f0cfeccf57d35350edae0de6a0 (patch)
treeb430757aeebfdbf35b532349ca46ca7bbd144685 /mbbsd
parent3a5906defc274d40f0e58eec77048cdeb8ad64fa (diff)
downloadpttbbs-6b2f2f3e275322f0cfeccf57d35350edae0de6a0.tar
pttbbs-6b2f2f3e275322f0cfeccf57d35350edae0de6a0.tar.gz
pttbbs-6b2f2f3e275322f0cfeccf57d35350edae0de6a0.tar.bz2
pttbbs-6b2f2f3e275322f0cfeccf57d35350edae0de6a0.tar.lz
pttbbs-6b2f2f3e275322f0cfeccf57d35350edae0de6a0.tar.xz
pttbbs-6b2f2f3e275322f0cfeccf57d35350edae0de6a0.tar.zst
pttbbs-6b2f2f3e275322f0cfeccf57d35350edae0de6a0.zip
* (pwcu branch) remove the 'goodpost' ~ I love this commit.
git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4791 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/assess.c213
-rw-r--r--mbbsd/bbs.c39
-rw-r--r--mbbsd/menu.c2
-rw-r--r--mbbsd/passwd.c11
-rw-r--r--mbbsd/talk.c2
-rw-r--r--mbbsd/user.c7
6 files changed, 3 insertions, 271 deletions
diff --git a/mbbsd/assess.c b/mbbsd/assess.c
index e11ac70f..aa9abe71 100644
--- a/mbbsd/assess.c
+++ b/mbbsd/assess.c
@@ -26,217 +26,6 @@ int inc_##_attr(const char *userid, int num) \
return 0;\
}
-modify_column(goodpost); /* inc_goodpost */
modify_column(badpost); /* inc_badpost */
-// how long is AID? see read.c...
-#ifndef AIDC_LEN
-#define AIDC_LEN (20)
-#endif // AIDC_LEN
-
-// #define MAXGP (100)
-#define MAXGP (UCHAR_MAX)
-
-int
-u_fixgoodpost(void)
-{
- char endinput = 0;
- unsigned int newgp = 0;
- int bid;
- char bname[IDLEN+1];
- char xaidc[AIDC_LEN+1];
-
- aidu_t gpaids[MAXGP+1];
- int gpbids[MAXGP+1];
- int cgps = 0;
-
- clear();
- vs_hdr("�۰��u��ץ��{��");
-
- outs("�}�l�ץ��u�大�e�A���ǥ\\�ҭn�·бz���d�n�G\n\n"
- "�Х����A�Ҧ����u��峹���ݪO�P" AID_DISPLAYNAME "\n"
- AID_DISPLAYNAME "���d�ߤ�k�O�b�ӽg�峹�e�����U�j�g Q �C\n"
- "�d�n��Ч�o�Ǹ�Ʃ�b����A���U�|�бz��J�C\n"
- "�t�~�A�Y���h���n�J�Х������䥦�s�u�C\n"
- "\n");
- outs("�p�G�@�����dzƦn�F�A�Ы��U y �}�l�A�Ψ䥦���N����X�C\n\n");
- if (vans("�u�媺��Ƴ��d�n�F�ܡH") != 'y')
- {
- vmsg("���X�ץ��{���C");
- return 0;
- }
- while (!endinput && newgp < MAXGP)
- {
- int y;
- boardheader_t *bh = NULL;
-
- move(1, 0); clrtobot();
- outs("�Ш̧ǿ�J�u���T�A����������� ENTER �Y�i����C\n");
-
- move(b_lines-2, 0); clrtobot();
- prints("�ثe�w�T�{�u��ƥ�: %d" ANSI_RESET "\n\n", newgp);
-
- if (!getdata(5, 0, "�п�J�u��峹�Ҧb�ݪO�W��: ",
- bname, sizeof(bname), DOECHO))
- {
- move(5, 0);
- if (vans(ANSI_COLOR(1;33)"�T�w������J�����F�ܡH "
- ANSI_RESET "[y/N]: ") != 'y')
- continue;
- endinput = 1; break;
- }
- move (6, 0);
- outs("�T�{�ݪO... ");
- if (bname[0] == '\0' || !(bid = getbnum(bname)))
- {
- outs(ANSI_COLOR(1;31) "�ݪO���s�b�I");
- vmsg("���s��J�C");
- continue;
- }
- assert(0<=bid-1 && bid-1<MAX_BOARD);
- bh = getbcache(bid);
- strlcpy(bname, bh->brdname, sizeof(bname));
- prints("�w���ݪO --> %s\n", bname);
- y = vgety();
-
- // loop AID query
- while (newgp < MAXGP)
- {
- int n;
- int fd;
- char dirfile[PATHLEN];
- char *sp;
- aidu_t aidu = 0;
- fileheader_t fh;
-
- move(y, 0); clrtobot();
- move(b_lines-2, 0); clrtobot();
- prints("�ثe�w�T�{�u��ƥ�: %d" ANSI_RESET "\n\n", newgp);
-
- if (getdata(y, 0, "�п�J" AID_DISPLAYNAME ": #",
- xaidc, AIDC_LEN, DOECHO) == 0)
- break;
-
- sp = xaidc;
- while(*sp == ' ') sp ++;
- if(*sp == '#') sp ++;
-
- if((aidu = aidc2aidu(sp)) <= 0)
- {
- outs(ANSI_COLOR(1;31) AID_DISPLAYNAME "�榡�����T�I");
- vmsg("���s��J�C");
- continue;
- }
-
- // check repeated input of same board+AID.
- for (n = 0; n < cgps; n++)
- {
- if (gpaids[n] == aidu && gpbids[n] == bid)
- {
- vmsg("�z�w��J�L���u��F�A���s��J�C");
- aidu = 0;
- break;
- }
- }
-
- if (aidu <= 0)
- continue;
-
- // find aidu in board
- n = -1;
- // see read.c, search .bottom first.
- if (n < 0)
- {
- outs("�j�M�m���峹...");
- setbfile(dirfile, bname, FN_DIR ".bottom");
- n = search_aidu(dirfile, aidu);
- }
- if (n < 0) {
- // search board
- outs("�����C\n�j�M�ݪO�峹..");
- setbfile(dirfile, bname, FN_DIR);
- n = search_aidu(dirfile, aidu);
- }
- if (n < 0)
- {
- // search digest
- outs("�����C\n�j�M��K..");
- setbfile(dirfile, currboard, fn_mandex);
- n = search_aidu(dirfile, aidu);
- }
- if (n < 0)
- {
- // search failed...
- outs("�����\n" ANSI_COLOR(1;31) "�䤣��峹�I");
- vmsg("�нT�{�᭫�s��J�C");
- continue;
- }
-
- // found something
- fd = open(dirfile, O_RDONLY);
- if (fd < 0)
- {
- outs(ANSI_COLOR(1;31) "�t�ο��~�C �еy�ԦA���աC\n");
- vmsg("�Y����o�ͽЦ�" BN_BUGREPORT "���i�C");
- continue;
- }
-
- lseek(fd, n*sizeof(fileheader_t), SEEK_SET);
- memset(&fh, 0, sizeof(fh));
- read(fd, &fh, sizeof(fh));
- outs("\n�}�l�ֹ���...\n");
- n = 1;
- // XXX �n�����j�p�g���P�ܡH (�� id)
- // �`�� id ���O�n�ơA�n��N�n�Ө��L�k�^�_�����I�A���C
- if (strcmp(fh.owner, cuser.userid) != 0)
- n = 0;
- prints("�@��: %s (%s)\n", fh.owner, n ? "���T" :
- ANSI_COLOR(1;31) "���~" ANSI_RESET);
- if (!(fh.filemode & FILE_MARKED))
- n = 0;
- prints("�ۤ�: %s\n", (fh.filemode & FILE_MARKED) ? "���T" :
- ANSI_COLOR(1;31) "���~" ANSI_RESET);
- prints("����: %d\n", fh.recommend);
- close(fd);
- if (!n)
- {
- vmsg("��J���峹�ëD�u��A�Э��s��J�C");
- continue;
- }
- n = fh.recommend / 10;
- prints("�p���u��ƭ�: %+d\n", n);
-
- if (n > 0)
- {
- // log new data
- newgp += n;
- gpaids[cgps] = aidu;
- gpbids[cgps] = bid;
- cgps ++;
- }
-
- clrtobot();
-
-
- vmsg("�u��w�T�{�C�Y�n��J�䥦�ݪO�峹�ЦbAID��ťի� ENTER");
- }
- vmsgf("%s �ݪO��J�����C", bname);
- }
- if (newgp > MAXGP)
- newgp = MAXGP;
- if (newgp <= cuser.goodpost)
- {
- vmsg("�T�{�u��ƥإ�����w���u��ơA���վ�C");
- } else {
- log_filef("log/fixgoodpost.log", LOG_CREAT,
- "%s %s �۰ʭץ��u���: �� %d �ܬ� %d\n", Cdate(&now), cuser.userid,
- cuser.goodpost, newgp);
- // update passwd file here?
- pwcuSetGoodPost(newgp);
- vmsgf("��s�u��ƥج�%d�C", newgp);
- }
-
- return 0;
-}
-
-#endif
+#endif // ASSESS
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index d1f268e3..f0356a46 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -2342,14 +2342,6 @@ recommend_cancel(int ent, fileheader_t * fhdr, const char *direct)
getdata(b_lines - 1, 0, "�T�w�n�����k�s[y/N]? ", yn, 5, LCECHO);
if (yn[0] != 'y')
return FULLUPDATE;
-#ifdef ASSESS
- // to save resource
- if (fhdr->recommend > 9)
- {
- inc_goodpost(fhdr->owner, -1 * (fhdr->recommend / 10));
- sendalert(fhdr->owner, ALERT_PWD_GOODPOST);
- }
-#endif
fhdr->recommend = 0;
substitute_ref_record(direct, fhdr, ent);
@@ -2765,20 +2757,6 @@ recommend(int ent, fileheader_t * fhdr, const char *direct)
}
do_add_recommend(direct, fhdr, ent, buf, type);
-
-#ifdef ASSESS
- /* �C 10 ������ �[�@�� goodpost */
- // TODO ��Ӫ�����H
- // when recommend reaches MAX_RECOMMENDS...
- if (type == RECTYPE_GOOD && (fhdr->filemode & FILE_MARKED) &&
- (fhdr->recommend != oldrecom) &&
- fhdr->recommend % 10 == 0)
- {
- inc_goodpost(fhdr->owner, 1);
- sendalert(fhdr->owner, ALERT_PWD_GOODPOST);
- }
-#endif
-
lastrecommend = now;
lastrecommend_bid = currbid;
strlcpy(lastrecommend_fname, fhdr->filename, sizeof(lastrecommend_fname));
@@ -2801,23 +2779,6 @@ mark_post(int ent, fileheader_t * fhdr, const char *direct)
return DONOTHING;
fhdr->filemode ^= FILE_MARKED;
-
-#ifdef ASSESS
- if (fhdr->filemode & FILE_MARKED)
- {
- if (!(currbrdattr & BRD_BAD) && fhdr->recommend >= 10)
- {
- inc_goodpost(fhdr->owner, fhdr->recommend / 10);
- sendalert(fhdr->owner, ALERT_PWD_GOODPOST);
- }
- }
- else if (fhdr->recommend > 9)
- {
- inc_goodpost(fhdr->owner, -1 * (fhdr->recommend / 10));
- sendalert(fhdr->owner, ALERT_PWD_GOODPOST);
- }
-#endif
-
substitute_ref_record(direct, fhdr, ent);
check_locked(fhdr);
return PART_REDRAW;
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index bd598cea..fdba2381 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -585,7 +585,6 @@ u_myfiles()
}
-int u_fixgoodpost(void); // assess.c
void Customize(); // user.c
static int
@@ -611,7 +610,6 @@ static const commands_t userlist[] = {
{u_register, MENU_UNREGONLY, "RRegister ��g�m���U�ӽг�n"},
#ifdef ASSESS
{u_cancelbadpost,PERM_LOGINOK, "BBye BadPost �ӽЧR���H��"},
- {u_fixgoodpost, PERM_LOGINOK, "FFix GoodPost �״_�u��"},
#endif // ASSESS
{NULL, 0, NULL}
};
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c
index 5803b5b8..73f3f6fc 100644
--- a/mbbsd/passwd.c
+++ b/mbbsd/passwd.c
@@ -47,8 +47,6 @@ passwd_sync_update(int num, userec_t * buf)
if(alerts & ALERT_PWD_BADPOST)
cuser.badpost = buf->badpost = u.badpost;
- if(alerts & ALERT_PWD_GOODPOST)
- cuser.goodpost = buf->goodpost = u.goodpost;
if(alerts & ALERT_PWD_PERM)
cuser.userlevel = buf->userlevel = u.userlevel;
if(alerts & ALERT_PWD_JUSTIFY)
@@ -146,15 +144,6 @@ pwcuDecNumPost()
PWCU_END();
}
-int
-pwcuSetGoodPost(unsigned int newgp)
-{
- PWCU_START();
- cuser.goodpost = u.goodpost = newgp;
- // passwd_force_update(ALERT_PWD_GOODPOST);
- PWCU_END();
-}
-
int
pwcuViolateLaw ()
{
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 068cd567..14f55478 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -481,7 +481,7 @@ my_query(const char *uident)
#endif
move(2, 40);
#ifdef ASSESS
- prints("�m���Ĥ峹�g�ơn%d�g (�u:%d/�H:%d)\n", muser.numposts, muser.goodpost, muser.badpost);
+ prints("�m���Ĥ峹�g�ơn%d�g (�H:%d)\n", muser.numposts, muser.badpost);
#else
prints("�m���Ĥ峹�g�ơn%d�g\n", muser.numposts);
#endif
diff --git a/mbbsd/user.c b/mbbsd/user.c
index c14d5bf1..84a2d83e 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -197,8 +197,7 @@ user_display(const userec_t * u, int adminmode)
// conditional fields
#ifdef ASSESS
- prints("\t\t�u �H ��: �u:%d / �H:%d\n",
- u->goodpost, u->badpost);
+ prints("\t\t�H��ƥ�: %d\n", u->badpost);
#endif // ASSESS
#ifdef CHESSCOUNTRY
@@ -816,10 +815,6 @@ uinfo_query(userec_t *u, int adminmode, int unum)
if ((tmp = atoi(buf)) >= 0)
x.numposts = tmp;
#ifdef ASSESS
- snprintf(genbuf, sizeof(genbuf), "%d", u->goodpost);
- if (getdata_str(y++, 0, "�u�}�峹��:", buf, 10, DOECHO, genbuf))
- if ((tmp = atoi(buf)) >= 0)
- x.goodpost = tmp;
snprintf(genbuf, sizeof(genbuf), "%d", u->badpost);
if (getdata_str(y++, 0, "�c�H�峹��:", buf, 10, DOECHO, genbuf))
if ((tmp = atoi(buf)) >= 0)