diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-03-12 13:09:08 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-03-12 13:09:08 +0800 |
commit | 8d8887e355480b30629b8576aa5998b7eb3d9288 (patch) | |
tree | 2836f86b977a933dcaa750da6a339058319442f7 | |
parent | a6b3fe4ff21bf66ac268bc7487cb41dc74526d67 (diff) | |
download | pttbbs-8d8887e355480b30629b8576aa5998b7eb3d9288.tar pttbbs-8d8887e355480b30629b8576aa5998b7eb3d9288.tar.gz pttbbs-8d8887e355480b30629b8576aa5998b7eb3d9288.tar.bz2 pttbbs-8d8887e355480b30629b8576aa5998b7eb3d9288.tar.lz pttbbs-8d8887e355480b30629b8576aa5998b7eb3d9288.tar.xz pttbbs-8d8887e355480b30629b8576aa5998b7eb3d9288.tar.zst pttbbs-8d8887e355480b30629b8576aa5998b7eb3d9288.zip |
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1586 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/proto.h | 2 | ||||
-rw-r--r-- | mbbsd/admin.c | 28 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 8 | ||||
-rw-r--r-- | mbbsd/menu.c | 1 | ||||
-rw-r--r-- | mbbsd/record.c | 46 | ||||
-rw-r--r-- | mbbsd/talk.c | 13 |
6 files changed, 52 insertions, 46 deletions
diff --git a/include/proto.h b/include/proto.h index 59c7428c..aac257e6 100644 --- a/include/proto.h +++ b/include/proto.h @@ -9,6 +9,7 @@ #endif /* admin */ +int m_loginmsg(); int m_mod_board(char *bname); int m_newbrd(int recover); int scan_register_form(char *regfile, int automode, int neednum); @@ -538,6 +539,7 @@ int iswritable_stat(userinfo_t *uentp, int fri_stat); int isvisible_stat(userinfo_t * me, userinfo_t * uentp, int fri_stat); int cmpwatermtime(const void *a, const void *b); //void water_scr(water_t *tw, int which, char type); +void getmessage(msgque_t msg); void my_write2(void); int t_idle(); char *modestring(userinfo_t * uentp, int simple); diff --git a/mbbsd/admin.c b/mbbsd/admin.c index b476d787..45f478d0 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1,6 +1,34 @@ /* $Id$ */ #include "bbs.h" +/* 進站水球宣傳 */ + +int +m_loginmsg() +{ + char msg[100]; + move(21,0); + clrtobot(); + if(SHM->loginmsg.pid && SHM->loginmsg.pid != currutmp->pid) + { + prints("目前已經有以下的 進站水球設定請先協調好再設定.."); + getmessage(SHM->loginmsg); + } + getdata(22, 0, + "進站水球:本站活動,不干擾使用者為限,設定者離站自動取消,確定要設?(y/N)", + msg, 3, LCECHO); + + if(msg[0]=='y' && + + getdata_str(23, 0, "設定進站水球:", msg, 56, DOECHO, SHM->loginmsg.last_call_in)) + { + SHM->loginmsg.pid=currutmp->pid; /*站長不多 就不管race condition */ + strcmp(SHM->loginmsg.last_call_in, msg); + strcmp(SHM->loginmsg.userid, cuser.userid); + } + return 0; +} + /* 使用者管理 */ int m_user() diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 2c182a87..9481b898 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -898,6 +898,7 @@ inline static void foreign_warning(void){ } #endif + static void user_login() { @@ -966,6 +967,13 @@ user_login() !currutmp->invisible) do_aloha("<<上站通知>> -- 我來啦!"); + if(SHM->loginmsg.pid) + { + if(search_ulist_pid(SHM->loginmsg.pid)) + getmessage(SHM->loginmsg); + else + SHM->loginmsg.pid=0; + } if (cuser.userlevel) { /* not guest */ move(t_lines - 4, 0); welcome_msg(); diff --git a/mbbsd/menu.c b/mbbsd/menu.c index d3fd1484..870b9572 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -328,6 +328,7 @@ static commands_t adminlist[] = { {cat_register, PERM_SYSOP, "CCatregister 無法審核時用的"}, {x_file, PERM_SYSOP|PERM_VIEWSYSOP, "XXfile 編輯系統檔案"}, {give_money, PERM_SYSOP|PERM_VIEWSYSOP, "GGivemoney 紅包雞"}, + {m_loginmsg, PERM_SYSOP, "MMessage Login 進站水球"}, #ifdef HAVE_MAILCLEAN {m_mclean, PERM_SYSOP, "MMail Clean 清理使用者個人信箱"}, #endif diff --git a/mbbsd/record.c b/mbbsd/record.c index ec3be179..924f1449 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -353,52 +353,6 @@ search_rec(char *dirname, int (*filecheck) ()) return 0; } -int delete_files(char *dirname, int (*filecheck) (), int record){ - fileheader_t fhdr; - FILE *fp, *fptmp; - int ans = 0; - char tmpfname[128]; - char genbuf[256]; - char deleted[256]; - fileheader_t delfh; - char deletedDIR[] = "boards/d/deleted/.DIR"; - - strlcpy(deleted, "boards/d/deleted", sizeof(deleted)); - - if (!(fp = fopen(dirname, "r"))) - return ans; - - strlcpy(tmpfname, dirname, sizeof(tmpfname)); - strcat(tmpfname, "_tmp"); - - if (!(fptmp = fopen(tmpfname, "w"))) { - fclose(fp); - return ans; - } - while (fread(&fhdr, sizeof(fhdr), 1, fp)) { - if ((*filecheck) (&fhdr)) { - ans++; - setdirpath(genbuf, dirname, fhdr.filename); - if (record) { - deleted[14] = '\0'; - stampfile(deleted, &delfh); - strlcpy(delfh.owner, fhdr.owner, sizeof(delfh.owner)); - strlcpy(delfh.title, fhdr.title, sizeof(delfh.title)); - Link(genbuf, deleted); - append_record(deletedDIR, &delfh, sizeof(delfh)); - } - unlink(genbuf); - } else - fwrite(&fhdr, sizeof(fhdr), 1, fptmp); - } - - fclose(fp); - fclose(fptmp); - unlink(dirname); - Rename(tmpfname, dirname); - - return ans; -} #ifdef SAFE_ARTICLE_DELETE int diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 761b4c4d..7822e665 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -702,6 +702,19 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) } void +getmessage(msgque_t msg) +{ + int write_pos = currutmp->msgcount; + if ( write_pos < (MAX_MSGS - 1) ) { + unsigned char pager0 = currutmp->pager; + currutmp->msgcount = write_pos+1; + memcpy(&currutmp->msgs[write_pos], &msg, sizeof(msgque_t)); + currutmp->pager = pager0; + write_request(SIGUSR1); + } +} + +void t_display_new(void) { static int t_display_new_flag = 0; |