summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/smtest.c289
-rw-r--r--util/smtest.c.save172
-rw-r--r--util/smtest.result1191
-rw-r--r--util/smtest.result23
-rw-r--r--util/smtest.temp231
5 files changed, 0 insertions, 886 deletions
diff --git a/util/smtest.c b/util/smtest.c
deleted file mode 100644
index e46157f2..00000000
--- a/util/smtest.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/* $Id: smtest.c,v 1.5 2002/06/19 13:38:01 lwms Exp $ */
-#include "bbs.h"
-
-#define WARNFILE BBSHOME "/etc/DeleteBoard.warn"
-#define EXECFILE BBSHOME"/etc/DeleteBoard.exec"
-#define WARNLIST BBSHOME"/etc/DeleteBoardList.warn"
-#define EXECLIST BBSHOME"/etc/DeleteBoardList.exec"
-
-extern boardheader_t *bcache;
-extern int numboards;
-
-boardheader_t allbrd[MAX_BOARD];
-extern userec_t xuser;
-
-
-int LINK(char* src, char* dst){
- char cmd[200];
-
- if( link(src, dst) == 0){
- return 0;
- }
-
- sprintf(cmd, "/bin/cp -R %s %s", src, dst);
- return system(cmd);
-}
-
-int outofdate(char *hdrdate, char thedate[], int *zf)
-{
- int k = 0;
- char *dd;
- char latestdate[6];
- int date1[2], date2[2],datetemp;
- *zf = 0;
-
- strcpy(latestdate, thedate);
-
- dd = strtok(hdrdate,"/");
- if(dd == NULL) return 2;
- if(dd)
- k = 0;
- do{
- if (*dd == '[' ){dd[strlen(dd)-1]='\0'; dd++;}
- date1[k] = atoi(dd);
- k++;
- } while((dd=strtok(NULL,"/ "))!=NULL);
-
- dd = strtok(latestdate,"/");
- if(dd)
- k = 0;
- do{
- if (*dd == '[' ){dd[strlen(dd)-1]='\0'; dd++;}
- date2[k] = atoi(dd);
- k++;
- } while((dd=strtok(NULL,"/ "))!=NULL);
-
- if(date2[0] == date1[0] && date2[1] >= date1[1])
- return 0;
-
- datetemp = date2[0];
-
- for(k = 1;k <= 5;k++)
- {
- datetemp -= 1;
- if((datetemp) <= 0){
- datetemp = 12;
- }
- if(k < 3 && datetemp == date1[0]) return 0;
- if(k == 3 && datetemp == date1[0] && date2[1] <= date1[1]) return 0;
- if(k == 3 && datetemp == date1[0] && date2[1] > date1[1]) return 1;
- if(k == 4 && datetemp == date1[0] && date2[1] > date1[1]) return 1;
- }
- *zf = 1;
- return 1;
-}
-
-void mailtouser(char *bmname, char *bname, int zf)
-{
- fileheader_t mymail;
- char genbuf[200];
-
- sprintf(genbuf, BBSHOME "/home/%c/%s", bmname[0], bmname);
- stampfile(genbuf, &mymail);
- strcpy(mymail.owner, "[PTTĵ�]");
-
- if(zf == 0){
- sprintf(mymail.title,"\033[32m [�o�Oĵ�i�q��]"
- "\033[m %s�O(BM:%s)",bname, bmname);
- }else{
- sprintf(mymail.title,"\033[32m [�o�O�q��] "
- "\033[m %s�O(BM:%s)",bname, bmname);
- }
- unlink(genbuf);
- if(zf == 0){
- LINK(WARNFILE, genbuf);
- }else{
- LINK(EXECFILE, genbuf);
- }
-
- sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", bmname[0], bmname);
- append_record(genbuf, &mymail, sizeof(mymail));
-}
-
-int main()
-{
- int bmid, i, j, k, rd, ood, flag, zapflag = 0,warncount = 0,execcount = 0;
- char *p, *bmsname[3], fname[256], hdrdatetemp[6],thedate[6];
- char bname[32],genbuf[200];
- fileheader_t hdr;
- FILE *inf, *def;
-
- ///// set date //////
- time_t t = time(NULL);
- struct tm *tm = localtime(&t);
- sprintf(thedate, "%2d/%02d", tm->tm_mon + 1, tm->tm_mday);
-
- ////// board //////
-
- resolve_boards();
- if(passwd_mmap())
- exit(1);
- memcpy(allbrd,bcache,numboards*sizeof(boardheader_t));
-
- ////// write out the target file //////
- inf = fopen(WARNLIST, "w+");
- if(inf == NULL){
- printf("open file error : %s\n", WARNLIST);
- exit(1);
- }
-
- def = fopen(EXECLIST, "w+");
- if(def == NULL)
- {
- printf("open file error : %s\n", EXECLIST);
- exit(1);
- }
-
- ////// fprint table title /////
- fprintf(inf,"\n[�o�Oĵ�i]�Y��_�@�Ӥ뤺�Y�ݪO"
- "�ϥβv���M�L�C�A�h���H�o���C\n\n"
- "�^��O�W ���O ����O�W ��� "
- " �O�D�W��\n\n");
-
- fprintf(def,"\n[�o�O���i]�U�C�ݪO�]�ϥβv���M�L�C�A�G���H�o���C\n\n"
- "�^��O�W ���O ����O�W ��� "
- " �O�D�W��\n\n");
-
- ////// start process /////
- j = 0 ;
- for (i = 0; i < numboards; i++) {
- rd = 0;
- if(allbrd[i].brdname[0] == '\0') continue;
- if((allbrd[i].brdattr & BRD_NOZAP) ||
- (allbrd[i].brdattr & BRD_GROUPBOARD) ||
- (allbrd[i].brdattr & BRD_WARNDEL) ||
- (allbrd[i].brdattr & BRD_HIDE) ||
- (allbrd[i].brdattr & BRD_POSTMASK) ||
- (allbrd[i].brdattr & BRD_VOTEBOARD) ||
- (allbrd[i].brdattr & BRD_BAD) ||
- (allbrd[i].level != 0)) continue;
-
- sprintf(fname, BBSHOME "/boards/%c/%s/.DIR", allbrd[i].brdname[0], allbrd[i].brdname);
-
- /* get date to choose junk board */
- /* exception when ood == 2 */
- flag = 30;
- rd = get_num_records(fname, sizeof(fileheader_t));
- if(rd <= 30)
- {
- get_record(fname, &hdr, sizeof (hdr), 1);
- strcpy(hdrdatetemp, hdr.date);
- ood = outofdate(hdrdatetemp,thedate, &zapflag);
- }
- else
- {
- do{
- if(rd == 0)
- {
- ood = 0;
- break;
- }
- get_record(fname, &hdr, sizeof (hdr), rd - flag);
- strcpy(hdrdatetemp, hdr.date);
- ood = outofdate(hdrdatetemp,thedate, &zapflag);
- flag += 5;
- }while(ood == 2 && flag < 60);
- }
- if(ood == 0) continue;
-
- warncount++;
- /* print to file */
- fprintf(inf,"%-*.*s%-*.*s %-*.*s%-*.*s\n", IDLEN, IDLEN,
- allbrd[i].brdname, BTLEN-26, BTLEN-26, allbrd[i].title,
- IDLEN - 5, IDLEN-5,hdr.date, IDLEN * 3, IDLEN * 3, allbrd[i].BM);
-
- /* post warn file to each board */
- sprintf(genbuf,"~/bin/post %s [�o�Oĵ�i�q��]"
- " [PTTĵ�] %s",allbrd[i].brdname,WARNFILE);
- system(genbuf);
-
- /* user extract to mail */
- p=strtok(allbrd[i].BM,"/ ");
- if(p){
- k = 0;
- do
- {
- if (*p == '[' ){p[strlen(p)-1]='\0'; p++;}
- bmid=getuser(p);
- bmsname[k] = p;
- if(isalpha(allbrd[i].BM[0])&& !(xuser.userlevel &PERM_SYSOP))
- {
- mailtouser(bmsname[k],allbrd[i].title, zapflag);
- }
- k++;
- } while((p=strtok(NULL,"/ "))!=NULL);
- }
- /* set attribute of DeleteBoardWarn Flag */
- bcache[i].brdattr = allbrd[i].brdattr | BRD_WARNDEL;
-
- /* zap boards */
- if (zapflag == 1)
- {
- execcount++;
- /* print to file */
- fprintf(def,"%-*.*s%-*.*s %-*.*s%-*.*s\n", IDLEN, IDLEN,
- allbrd[i].brdname, BTLEN-26, BTLEN-26, allbrd[i].title,
- IDLEN - 5, IDLEN-5,hdr.date, IDLEN * 3, IDLEN * 3, allbrd[i].BM);
-
- /* if you want to unmark these code,
- make sure board, man path have changed to [man/]boards/<First char of brdname>/brdname
- */
-
-// strcpy(bname, allbrd[i].brdname);
-// sprintf(genbuf,
-// "/bin/tar zcvf ~/tmp/board_%s.tgz boards/%s man/%s>/dev/null 2>&1;"
-// "/bin/rm -fr ~/boards/%s man/%s",bname, bname, bname, bname,bname);
-// system(genbuf);
-
-// memset(&allbrd[i], 0, sizeof(allbrd[i]));
-// sprintf(allbrd[i].title, "[%s] deleted by System", bname);
-// substitute_record(fn_board, &bh, sizeof(allbrd[i]), bid);
-// reset_board(bid);
- }
-
- }
-
- /* post to Record, ViolateLaw */
- if(warncount > 0){
- sprintf(genbuf,"~/bin/post Record [�o�Oĵ�i�q��]"
- " [PTTĵ�] %s",WARNLIST);
- system(genbuf);
- sprintf(genbuf,"~/bin/post ViolateLaw [�o�Oĵ�i�q��]"
- " [PTTĵ�] %s",WARNLIST);
- system(genbuf);
- }
- if(execcount > 0){
- sprintf(genbuf,"~/bin/post Record [�o�O���i]"
- " [PTTĵ�] %s",EXECLIST);
- system(genbuf);
- sprintf(genbuf,"~/bin/post ViolateLaw [�o�O���i]"
- " [PTTĵ�] %s",EXECLIST);
- system(genbuf);
- }
-
-
-/* Below is for test only */
-/*
- mailtouser("Smile","test", 1);
- mailtouser("Smile","test", 0);
-
- strcpy(bname, "Test");
- sprintf(genbuf,"~/bin/post %s test Smile ~/etc/test.fileaaa",bname);
- system(genbuf);
-
-
- bid = getbnum(bname);
- strcpy(bname,"jourslamdunk");
- sprintf(genbuf,
- "/bin/tar zcvf ~/tmp/board_%s.tgz boards/%c/%s man/%c/%s>/dev/null 2>&1;"
- "/bin/rm -fr ~/boards/%c/%s man/%c/%s",
- bname, bname[0], bname, bname[0], bname, bname[0], bname, bname[0], bname);
- system(genbuf);
-
- memset(&bh, 0, sizeof(bh));
- sprintf(bh.title, "[%s] deleted by %s", bname,cuser.userid);
- substitute_record(fn_board, &bh, sizeof(bh), bid);
- reset_board(bid);
-*/
- return 0;
-}
diff --git a/util/smtest.c.save b/util/smtest.c.save
deleted file mode 100644
index 7e678881..00000000
--- a/util/smtest.c.save
+++ /dev/null
@@ -1,172 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include <ctype.h>
-#include "config.h"
-#include "pttstruct.h"
-#include "util.h"
-#include "perm.h"
-#include "common.h"
-#include "proto.h"
-
-#define OUTFILE BBSHOME "/pttbbs/util/smtest.result1"
-#define FIREFILE BBSHOME "/pttbbs/util/smtest.result2"
-
-extern boardheader_t *bcache;
-extern int numboards;
-
-boardheader_t allbrd[MAX_BOARD];
-struct userec_t xuser;
-
-int getuser(char *userid) {
- int uid;
- if((uid = searchuser(userid)))
- passwd_query(uid, &xuser);
- return uid;
-}
-
-int LINK(char* src, char* dst){
- char cmd[200];
-
- if( link(src, dst) == 0){
- return 0;
- }
-
- sprintf(cmd, "/bin/cp -R %s %s", src, dst);
- return system(cmd);
-}
-
-int main()
-{
- int bmid, i, j, k, rd;
- char *p, *bmsname[3], bmbuf[IDLEN * 3 + 3], fname[256];
- fileheader_t hdr;
- FILE *inf;
-
- resolve_boards();
- if(passwd_mmap())
- exit(1);
- memcpy(allbrd,bcache,numboards*sizeof(boardheader_t));
-
- /* write out the target file */
- inf = fopen(OUTFILE, "w+");
- if(inf == NULL){
- printf("open file error : %s\n", OUTFILE);
- exit(1);
- }
-
- /*the ouput table title*/
- fprintf(inf,"�^�媩�W ���O ���媩�W ���D�W��"
- " ��� �Ƶ� \n");
-
- j = 0 ;
- for (i = 0; i < 30; i++) {
- rd = 0;
- if(allbrd[i].brdname[0] == '\0') continue;
-
- sprintf(fname, BBSHOME "/boards/%s/.DIR",allbrd[i].brdname);
-
- rd = get_num_records(fname, sizeof(fileheader_t));
- get_record(fname, &hdr, sizeof (hdr), rd - 30);
-// printf(" %s %s\n",hdr.title,hdr.date);
-
- printf("%-*.*s%-*s%s", IDLEN, IDLEN, allbrd[i].brdname, BTLEN,
- allbrd[i].title,allbrd[i].BM);
-
- p=strtok(allbrd[i].BM,"/ ");
- if(p){
- int k = 0;
- do
- {
- if (*p == '[' ){p[strlen(p)-1]='\0'; p++;}
- bmid=getuser(p);
- bmsname[k] = p;
- if(isalpha(allbrd[i].BM[0])&& !(xuser.userlevel &PERM_SYSOP))
- {
- // printf("%s", bmsname[k]);
- }
- k++;
- } while((p=strtok(NULL,"/ "))!=NULL);
- }
-
- printf("\n");
-
-}
-
-
-/*
-
-
-
- if(flag == 1){
- bmbuf[0] = '\0';
- for(k = 0 , n = 0; k < index; k++){
- if(!bms[k].flag){
- if( n++ != 0) strcat(bmbuf, "/");
- strcat(bmbuf, bms[k].bmname);
- }
- }
- strcpy(bcache[i].BM, bmbuf);
- }
- }
- qsort(lostbms, j, sizeof(lostbm), bmlostdays_cmp);
-
- //write to the etc/toplazyBM
- for ( i=0; i<j; i++)
- {
- if( lostbms[i].lostdays > 60){
- fprintf(firef, "%-*.*s%-*.*s%-*.*s%3d�ѨS�W��\n", IDLEN, IDLEN,
- lostbms[i].title, BTLEN-10, BTLEN-10, lostbms[i].ctitle, IDLEN,IDLEN,
- lostbms[i].bmname,lostbms[i].lostdays);
- }else{
- fprintf(inf, "%-*.*s%-*.*s%-*.*s%3d�ѨS�W��\n", IDLEN, IDLEN, lostbms[i].title,
- BTLEN-10, BTLEN-10, lostbms[i].ctitle, IDLEN,IDLEN,
- lostbms[i].bmname,lostbms[i].lostdays);
- }
- }
- fclose(inf);
- fclose(firef);
-
- //printf("Total %d boards.\n", count);
-
- //mail to the users
- for( i=0; i<j; i++)
- {
- fileheader_t mymail;
- char genbuf[200];
- int lostdays;
-
- lostdays = lostbms[i].lostdays;
-
- if( (lostdays != 30) && (lostdays != 45) && (lostdays <= 60))
- continue;
-
- sprintf(genbuf, BBSHOME "/home/%c/%s", lostbms[i].bmname[0], lostbms[i].bmname);
- stampfile(genbuf, &mymail);
-
- strcpy(mymail.owner, "[PTTĵ�]");
-
- if(lostdays <= 60){
- sprintf(mymail.title,
- "\033[32m [���D�K¾ĵ�i�q��] \033[m %s BM %s", lostbms[i].title, lostbms[i].bmname);
- }else{
- sprintf(mymail.title,
- "\033[32m [���D�K¾�q��] \033[m %s BM %s", lostbms[i].title, lostbms[i].bmname);
- }
- mymail.savemode = 0 ;
- unlink(genbuf);
- if(lostdays <= 60){
- LINK(OUTFILE, genbuf);
- }else{
- LINK(FIREFILE, genbuf);
- }
-
- sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", lostbms[i].bmname[0], lostbms[i].bmname);
- append_record(genbuf, &mymail, sizeof(mymail));
- }
-*/
- return 0;
-}
diff --git a/util/smtest.result1 b/util/smtest.result1
deleted file mode 100644
index 6dee45ff..00000000
--- a/util/smtest.result1
+++ /dev/null
@@ -1,191 +0,0 @@
-�^�媩�W ���O ���媩�W ��� ���D�W��
-ck48th301 �ؤ� ���j�j�����ּ֤Ѱ 3/21 ching/carl/Prosecuted
-Bowling �B�� �����L2000,�ڦV30 7/18 Genson/chiche
-NTUCH-89 �ƾ� �����~�աI�I 7/10 badora/furtwangler
-SetupBBS BBS ��TEST://140.112. 8/08 Libra
-Fei-cat �Ϥ� ��23:56 �L�Ĩ� 8/07 tears
-CKAWE �ؤ� ���ؤ��դͺ޼ֹΪ 7/04 ckb/papl/trumpet
-jourslamdunk�ݼo ���F�j�s�D�t�x�y� 7/04 �x�D��
-ck48th308 �ؤ� ���S�n���~�F�I 7/15 honest
-CS84Her ���s ���U�b�F�� �]�n�M 7/20
-VM �P�� ���k���}�~�a���d� 7/20 zoo
-E-Diagrams �ն� ���@�_�K�����d�~. 6/29 Benjamin
-ck48th313 �ؤ� �����D���ޤF,���� 6/08 fantastic
-ck48th324 �ؤ� ��������... 7/10
-B853023XX �F�v ������s�@�� 8/15 FireKing
-ck48th303 �ؤ� ���L���@�� 6/05 Roses999/henrry/flyingdog
-CS85ee ���s ���j�a�q�_���� 8/08 admin/MVPgirl
-CS85simple ���s ��²�Z�H-��²�� 3/29 bbeellaa
-TFG95TRUE �_�@ ���u�Z�G��� 3/29 deceanna
-ck46th318 �ؤ� �� �� �� �j � 3/16 FengX/barkjor
-PTGS50th301 ���k ���ѤU�Ĥ@�Z--��� 8/09 cocoduck/youki
-CS85ming ���s ��"��"�ߤp�� 8/08 shan/lovehook/JWR
-ck47th333 �ؤ� ���o�˷|���|�o��? 7/17 diezoo/Express
-TFG97SHOT �_�@ ���̨���@���̰_� 8/07 chili/atlantis
-Taichung �A�� ���̳̲M�s�i�R��� 8/09 Jahon
-southdoor �n�� ���n�����Ҫ������ 8/09 happyjoy
-ck47th301 �ؤ� ���ٳѽְڡH�H 5/22 huskie/flutii
-hsntu ���� ���x�j���ͷ| �� 11/29 koku/Crony
-JH23th301 �ꤤ ���A�٬��۶�? 7/25 momi/mvpman
-money �dzN ��Show me the 5/02 kagh
-HSNU_807 ���� ���èչs�m�Z 7/16 yijean/joj
-ntubbsops �o�q ���x�j�s�u���ȪO 3/23 Ptt
-ntuACCT90 �|�p ���o�O�û����x�j� 7/19 blackman/aathena
-geography90 �a�z �� 5/23 cog/uray
-TFG97Juang �_�@ ���ڭ̷|���|���� 8/09 seabreeze/notorious/Ving
-JHArt10th �ꤤ ���¦⪺����x 8/14 sadness/noyes
-ChanAn26-303���w ���s�ڲĤ@�W 8/07 HunterX
-FashionClub �h�� ���W�l�z��--�x�j� 1/17 demure/Woodywang/wiki
-TFG97KIND �_�@ ���o�̥i�O�����Ѱ 1/17 Channy
-AADIA �x�W ���N�u�u���̨Ψk� 8/13 CATHYSHU/dyw
-Sunrise12 ���� ���¶��P�Ƿ|�Q�G� 8/14 waiting/doggy
-cksh75th09 ���\ ���ͽ˾�"�E"�@�˿ 8/08 chiahei/WeThree/berserk
-Evangelion �饻 ���ۼx���D:) 6/15 �x�D��
-NTUba87 �u�� ���u�ޤ@�X �ֻP 8/09 ukj/littlewin
-ck49th109 �ؤ� �����D�n�W�s���v� 3/24 edvi
-CS86Honest ���s ���o�̬O�ۯZ�I�ۯ 5/24 Nakai/vicke
-YP86-307 ���� ���Ȭw�Ĥ@��! 8/08 DRAGONS/longman
-jackstudio ���� ���N�J�n�u���־ǭ 8/13 gigimusic
-CS85MadWiser���s �����g���z�H 12/06 NED
-LiZin �ɲ� ���ߤH�ɲ߯Z 6/10 success/adket/foster
-HP_86_310 �M�� ���M�������Ĥ@�� 11/26 beautyegg/oops/kyte
-Terry �x�W ���L�Ӭ��u���n�ӹ 8/10 jane
-Julia �x�W �� �@�ͳ̷R���^�� 8/07 esa
-PTGS50th305 ���k �����ڦ��B��---�� 8/07 gm
-ck49th111 �ؤ� �������űC�S�� 3/15 ERWILSON/firebat
-ck49th131 �ؤ� ���ڭ̤S���~�F... 12/26 lanzi/Cliche
-Wallace ���� ���p�Ӷ���~�}--� 8/07 karencc
-KJ25MC ���� �������l�z���k�� 7/09 pm
-ADS ��L ���s�i�S�� 7/09 chwang/sourit/elixirs
-TFSHS57th310�@�� ���ڭ̤@�a���O�H 7/09 difficult/lpp/juwu
-B84305XXX ���| ��84�Ū��|�H 7/12 ridley
-Jeff �x�W ���Q�G���--���q� 7/24 MisaTanaca/gambol
-EricMoo �P�� ���űҽ媺�P�� 11/27 piercec
-NTUIB-PHD ��� ���x�j����ҳդh� 5/22 yi03
-cksh75th19 ���\ �����Ѫ��A,�L�o�n 8/17 shiii/eegg
-MINGDAO ���D ���ﱵ�s�@������ 3/10 apache/kaening
-NTUMBA-87 �Ӭ� �����~�a���� 8/13 jonah
-ck49th324 �ؤ� ���@�u�L�]���߰� 4/03 jase/uuuuuu/brita
-TFG96Chung �_�@ ���{�b���B�ܤ��E� 8/12 astroboy
-Kinmen �O�� ���x�j�O�ͷ| 4/26 spurs
-BANYAN �_�� ���_������46TH 30 7/09 lusa/wangstar
-BADTWINS ���� ���j�w�ꤤ 7/16 Chilong/ggn/xlight
-TFG96WILL �_�@ ���ݰꭷ�� 8/17 because/Galong
-HSNU_924 ���� ���ƨg�c�դO 7/16 Dukedream
-Cyndi �x�W ���S��"�ֵ�"�A�N� 1/11 Melinda
-test2
-CS86Smile ���s �����Ƥ��s 12/20 HsinYu/sunspring
-JI3thN3-3 ���q �����q�������T�T 7/13 screamer/stingypig
-CS87KUNG ���s ���������� 8/12 hayashi/yjiou
-NTUBA-837011���� �����ެO���j�i�� 3/10 eemil
-TW-explorer �v�� ���p�߳Q�Q���s�r� 8/06 honu
-NTUIMA �Z�N �����a���� ����� 8/16 shadowpen/fu6xjp6
-NthuPhi ���� �������P�H�C�C 8/07 cerberus
-FreeNight �x�W ��TROUBLE �i�_�� 5/24 gonna/holybell
-GlobalECON �ݼo ���F�g�K��(�]�g�� 12/12 ali8/martinboy
-cvslog �o�q ��cvs commit mess 4/16
-Momentum �ݼo ���ʶq�\���u�@�� 12/03 adnova/chestnut
-chess �T�� ���]�� ���O�s�N 2/01 miserable
-ChthoniC �x�W ���{�F�ֹΪ� 8/07 Iverigma
-shisong304 ��Q ����Q304 5/15 JawTing/JSmoltz
-NCCU97_MAT �|�� ���ӧa.....�P�Ƿ| 5/15 kemling/A1997
-ck49th331 �ؤ� ���g�F����C 7/12 MDP/den
-HCGH-306 �ˤk �����K���I�I�I 4/19 jennywen/molly
-Foolshome ���� ���C�C�C~~~�d�H�~ 1/06 truth/citizen/nathon
-MARIAH ���� �� ����DON'T STOP 8/11 woowa
-KHCHS-87-306�s�� �����]����̥h�F� 6/10
-Delphi �{�] ��Delphi�g�Q�� 2/13 cying
-ciacia_Her �x�W ��ciacia��r�D� 7/26 sherbet
-KS86-323 ���� ���ڭ̬O�û������ 7/05 fayemimi/hanawa
-test2
-KS86-322 ���� ���j�a�^������a� 8/10 Vygotsky/SpermTiger
-35WHOteam ���� �������~����T��� 5/12 winonamars
-test2
-ck49th306 �ؤ� ��ernesto�G 306� 7/18 pongo/dearyou
-WuLing40-301�ݼo �����ڦ��B�� 10/ 8/11 quert
-NTUACCT88 �|�p ���� �D �S �� 6/12 Abbado/yenjui
-NTUDRC ��s ���γ\�p�O�諸 8/10 Kymco/plockock/Jimmyplus
-NTUWRC ���W ���x�j�L����s�� 8/07 BigRed
-TFSHS59th318�@�� ���L�F�@�ѤS�@�� 8/07 prodigy/kinoo/frisk
-86literarts ��� ��86�v�j������ 8/07 stupidbear/bengthek
-NTPU-SOC87 ���| ���z��...�s������ 8/12 nettaigyo
-NTU94FLLD �~�� ��B83102's Wonder 3/27 poppet
-ToriAmos ���� ��SLG���椤 8/14 CornflakeBoy
-Bjork ���� ���峹�������F � 8/09 lunaticlace/sjon
-SCU-BM-87C �[�� �� �ͽ˾��[�@�˿@ 4/17 joeyoung/linging/YADY
-CC-304 ���� �������W�� 304 8/14 betty0804/daystar
-Robin-Willia�ݼo ���û����Ѫ�ù��� 8/09 �x�D��
-NTUEEice ���� ���� -- �� 8/10 hiei81/shouhou
-tu-tuoz ���� ���R�Ѱ���p�� 8/10 galilei/seethesky
-WesleyS3H-32�òz ���̫�@�Ӵ����ա 8/15 esm
-Romi �x�W ���Q�������K 8/16 flyawayhome/holina
-EEacademic �q�� ���n�������o�I�I 5/11 ccchen
-ck-newboard �ӽ� ���ؤ��ձM�γs�p� 2/09 Pets
-NTUspecial �Lê �����x�W�j�ǵL��� 4/28 t6768
-chienchen �@�a ����r���F�X�X²� 8/09 curioussoul/ECOSEED
-test2
-test2
-test2
-NTUmed-SC ��� �����ȶ����ַ|��� 8/13 Evan/boo24
-Visual_Basic�{�] ���z�z..�A����ۤ 8/14 glans
-test2
-test2
-AngelicaLee �P�� ���W�i�R���߼� *^ 8/11 CaptainL
-Jackie_Lui ���� ���L������--�f�|� 8/14 pipo/YCJ
-HSNU_888 ���� ��888���߲ĤG�] 8/10 Viggeran/cidi
-ClassicMusic���� ���ڭ̣x��� 8/13 kuger/mml
-CM34th03 ���� ��:) 8/13 Snorkel
-CS88Jang ���s ���ڭ̳��O���I��� 8/08 YANIYANI/cfchien
-TFG99JUANG �_�@ ���M��S�O��Ѱ�. 8/11 yumeko
-SrcDiscuss ���� ��PTT ���ӵ{���o� 5/13 CharlieL/DavidYu
-WL-AFFAIRS �ư� ���ЦU�O�D�`�N�s� 6/09 PaiBingTran
-SMGJS-80-302��� ���û�����T�A 8/09 chifang
-ck51st332 �ؤ� ���� ���ڭ̦ӥh�� 8/13 JeffreyS/jimmycat/Kampuchea/JIROO
-HORT-90 ���� �����~�F... 8/16 sorng
-NCHUPPSB �t�S ���s�s�s ���~�L�H 4/14 LCUTE/AMDKX
-TAE ���� ���A��,�[�{���y 4/14 TulipChiu
-LePoete �x�W ���ж�֤H������( 4/14 doomcat
-NTUPOD ��s �� 8/16 Galong
-ck53rd211 �ؤ� �����ӦW�r�a.. 8/07 shanvic/BBD
-NCHU-SES �g�� ���j�a�Ӫ�s��~~ 4/18 yenjan
-Tin-Tin �x�W ���@�@�R���ӧQ 8/09 shinoo
-PTGS48th318 ���k ����������� 8/15 yungfang
-KF302 ���_ ���먮�� 8/15 ingela/cadillac
-HuangLei �j�� �����U��ǭ��֤j� 8/09 ssr
-NCCU99_EDU �ݼo ��~�Ш|�_�_���_�� 8/14 �x�D��
-NCHU_zoo �ʪ� �����}���H����h 4/24 sengir/GENETICS/velella
-Bull ¾�� ���G�Q�@�@���̫i� 4/24 Nicky41/georgey
-KS88-309 ���� �����i�D�A...�ڧ@ 4/24 daviy
-cksh77th20 ���\ ���A�ڳ��O�Ϥ���� 8/06 bergee
-TFG99Dance �_�@ ���L����Jazz�a�x 8/07 Tinabear/hee
-TFG99Love �_�@ �� �� �� 8/07 kelala/SpiceB
-Nedio �C�� ���֤Whttp://nedi 8/08 SpiceB/Sophia33
-TYHS88-306 ���� ���T�ѤT�]��T�� 8/09 niniway/Jey
-BCT-88 ��� ���@�s�b�ͪ��޳N� 8/15 physik/avkao
-CARNEGIE0917���� ��***�ﱵ�{�G��21 8/07 blackmail/mistletoe/tsg
-NCCU_PT ���� ���S�����ʪ��̤ͷ 8/11 mib345/randying
-NCHU-SKATING�ȦB ���ӥh...�ӥh...� 3/18 kaoasaki/littlehome
-Tun-Hua-Elem���� ��TunHua_��32��_6 8/07 pup
-CS88jing ���s ���ֲ��~�F�C �Q 8/08 yianne
-LeneMarlin ���� �����ֺ��F--�Y��� 8/08 janetwang
-KS88-304 ���� ���j�a�������~ 8/12 ahwa/oldya/BabyHam
-Summer �x�W ����v�l�d�U�A�b� 8/08 powerpeople/FINNCHE
-Slayers �饻 ���q�r�]�ɤh ��� 8/07 Zelgandes/marcal/Naga
-NTU-SwimCamp���W ���x�j��a�� 6/22 sunnyl
-red-sun ���� �����ۨ��o 8/09 renaissance
-1995-JH-325 ���� �����ذꤤ�T�~�G� 8/13 ThisWayIn/Raistlin/ifq
-X-game �B�� �������B�� 8/08 rbaggio
-88leadercamp���� �� �ש�}����88�� 8/12 elbert/aaati
-Curse �x�W ���A�G�ֹ�(�Q�K�~ 8/07 anticrist
-Joi �P�� ���E�b�� 8/08 leon19/crazykiller
-SHENA-RINGO �饻 ���զW�L�� �ӶD�� 8/08 MayMV
-CCJH-FS-27th���� ���� �N�M�M..... 8/12 Ariyari/YehMay
-PH-Service ���� ������g�窺���ê 8/07 piayyc/yuskay
-1995-JH-309 �ݼo ������309�ꤤ�P�� 2/11 �x�D��
-Peter �x�W ���C���Q��"����F 3/05 Haas
-IPIS ��� ������-�ѤF�ڬO�� 5/30
-cksh76th22 ���\ ���a�y�ܦM�I��!�p 8/15 lunasoul
-Stella �P�� �����ֲ���-����� 7/12 gutai309/crazykiller
-Law-Skate �k�� ���k�b���ƽ��� �� 6/12 Rainsalt/gwenlin
-cksh78th08 ���\ �����r�Y 308 3/17 smilefacer
-ntucomga �޷| ���ް|��s�;ǥͷ 5/08 handsome
diff --git a/util/smtest.result2 b/util/smtest.result2
deleted file mode 100644
index b84133c2..00000000
--- a/util/smtest.result2
+++ /dev/null
@@ -1,3 +0,0 @@
-�K¾���D
-�ݪO�W�� �O�D �X�ѨS�Ӱ�
-----------------------------------------------------------------------
diff --git a/util/smtest.temp b/util/smtest.temp
deleted file mode 100644
index 7daa12ce..00000000
--- a/util/smtest.temp
+++ /dev/null
@@ -1,231 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include <ctype.h>
-#include "config.h"
-#include "pttstruct.h"
-#include "util.h"
-#include "perm.h"
-#include "common.h"
-#include "proto.h"
-
-#define OUTFILE BBSHOME "/pttbbs/util/smtest.result1"
-#define FIREFILE BBSHOME "/pttbbs/util/smtest.result2"
-
-extern boardheader_t *bcache;
-extern int numboards;
-
-boardheader_t allbrd[MAX_BOARD];
-struct userec_t xuser;
-
-int getuser(char *userid) {
- int uid;
- if((uid = searchuser(userid)))
- passwd_query(uid, &xuser);
- return uid;
-}
-
-int LINK(char* src, char* dst){
- char cmd[200];
-
- if( link(src, dst) == 0){
- return 0;
- }
-
- sprintf(cmd, "/bin/cp -R %s %s", src, dst);
- return system(cmd);
-}
-
-int outofdate(char *hdrdate, char latestdate[])
-{
- int k,rr;
- char *dd;
-
- dd = strtok(hdrdate,"/");
-
- if(dd){
- k = 0;
- do
- {
- if (*dd == '[' ){dd[strlen(dd)-1]='\0'; dd++;}
- rr = atoi(dd);
- printf("%d/", rr);
- } while((dd = strtok(NULL,"/")) != NULL);
- }
-
- printf("\n");
-
- if(1)
- return 1;
- else
- return 0;
-}
-
-int main()
-{
- int bmid, i, j, k, rd,rr;
- char *p, *bmsname[3], fname[256], *dd;
- fileheader_t hdr;
- FILE *inf;
-
- /* set date */
- char thedate[5];
- time_t t = time(NULL);
- struct tm *tm = localtime(&t);
-
- sprintf(thedate, "%2d/%02d", tm->tm_mon + 1, tm->tm_mday);
-
- resolve_boards();
- if(passwd_mmap())
- exit(1);
- memcpy(allbrd,bcache,numboards*sizeof(boardheader_t));
- /* write out the target file */
- inf = fopen(OUTFILE, "w+");
- if(inf == NULL){
- printf("open file error : %s\n", OUTFILE);
- exit(1);
- }
-
- /*the ouput table title*/
- fprintf(inf,"�^�媩�W ���O ���媩�W ���D�W��"
- " ��� �Ƶ� \n");
-
- j = 0 ;
- for (i = 0; i < 30; i++) {
- rd = 0;
- if(allbrd[i].brdname[0] == '\0') continue;
- if((allbrd[i].brdattr & BRD_NOZAP) == 1) continue;
-
- sprintf(fname, BBSHOME "/boards/%s/.DIR",allbrd[i].brdname);
-
- /* get date to choose junk board */
-
- rd = get_num_records(fname, sizeof(fileheader_t));
- get_record(fname, &hdr, sizeof (hdr), rd - 30);
-
-
- if(outofdate(hdr.date,thedate)) printf("yest\n");
-
-/*
- dd = strtok(hdr.date,"/");
-
- if(dd){
- k = 0;
- do
- {
- if (*dd == '[' ){dd[strlen(dd)-1]='\0'; dd++;}
- rr = atoi(dd);
- printf("%d/", rr);
-
- } while((dd = strtok(NULL,"/")) != NULL);
- }
- printf("\n");
-*/
- /* print to file */
- printf("%-*.*s%-*.*s%-*.*s%-*.*s", IDLEN, IDLEN, allbrd[i].brdname,
- BTLEN-24, BTLEN-26, allbrd[i].title, IDLEN - 5, IDLEN-5,hdr.date,
- IDLEN * 3, IDLEN * 3, allbrd[i].BM);
-
- /* post to board */
-
-
-
- /* user extract to mail */
-
- p=strtok(allbrd[i].BM,"/ ");
- if(p){
- k = 0;
- do
- {
- if (*p == '[' ){p[strlen(p)-1]='\0'; p++;}
- bmid=getuser(p);
- bmsname[k] = p;
- if(isalpha(allbrd[i].BM[0])&& !(xuser.userlevel &PERM_SYSOP))
- {
- // printf("%s", bmsname[k]);
- }
- k++;
- } while((p=strtok(NULL,"/ "))!=NULL);
- }
-
- printf("\n");
-
-}
-
-
-/*
-
-
-
- if(flag == 1){
- bmbuf[0] = '\0';
- for(k = 0 , n = 0; k < index; k++){
- if(!bms[k].flag){
- if( n++ != 0) strcat(bmbuf, "/");
- strcat(bmbuf, bms[k].bmname);
- }
- }
- strcpy(bcache[i].BM, bmbuf);
- }
- }
- qsort(lostbms, j, sizeof(lostbm), bmlostdays_cmp);
-
- //write to the etc/toplazyBM
- for ( i=0; i<j; i++)
- {
- if( lostbms[i].lostdays > 60){
- fprintf(firef, "%-*.*s%-*.*s%-*.*s%3d�ѨS�W��\n", IDLEN, IDLEN, lostbms[i].title,
- BTLEN-10, BTLEN-10, lostbms[i].ctitle, IDLEN,IDLEN,
- lostbms[i].bmname,lostbms[i].lostdays);
- }else{
- fprintf(inf, "%-*.*s%-*.*s%-*.*s%3d�ѨS�W��\n", IDLEN, IDLEN, lostbms[i].title,
- BTLEN-10, BTLEN-10, lostbms[i].ctitle, IDLEN,IDLEN,
- lostbms[i].bmname,lostbms[i].lostdays);
- }
- }
- fclose(inf);
- fclose(firef);
-
- //printf("Total %d boards.\n", count);
-
- //mail to the users
- for( i=0; i<j; i++)
- {
- fileheader_t mymail;
- char genbuf[200];
- int lostdays;
-
- lostdays = lostbms[i].lostdays;
-
- if( (lostdays != 30) && (lostdays != 45) && (lostdays <= 60))
- continue;
-
- sprintf(genbuf, BBSHOME "/home/%c/%s", lostbms[i].bmname[0], lostbms[i].bmname);
- stampfile(genbuf, &mymail);
-
- strcpy(mymail.owner, "[PTTĵ�]");
-
- if(lostdays <= 60){
- sprintf(mymail.title,
- "\033[32m [���D�K¾ĵ�i�q��] \033[m %s BM %s", lostbms[i].title, lostbms[i].bmname);
- }else{
- sprintf(mymail.title,
- "\033[32m [���D�K¾�q��] \033[m %s BM %s", lostbms[i].title, lostbms[i].bmname);
- }
- mymail.savemode = 0 ;
- unlink(genbuf);
- if(lostdays <= 60){
- LINK(OUTFILE, genbuf);
- }else{
- LINK(FIREFILE, genbuf);
- }
-
- sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", lostbms[i].bmname[0], lostbms[i].bmname);
- append_record(genbuf, &mymail, sizeof(mymail));
- }
-*/
- return 0;
-}