From 2846cb73dbb035197c88ec52d73e6267c2b6608a Mon Sep 17 00:00:00 2001 From: ptt Date: Thu, 1 Jul 2004 02:51:12 +0000 Subject: merge the branch from ptt.fpg git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2109 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/admin.c | 20 ++++++--- mbbsd/merge.c | 129 +++++++++++++++++++++++++++++++++++----------------------- 2 files changed, 93 insertions(+), 56 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/admin.c b/mbbsd/admin.c index d9211c74..43c48995 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -271,7 +271,7 @@ int dir_cmp(const void *a, const void *b) atoi( &((fileheader_t *)b)->filename[2] )); } -void merge_dir(char *dir1, char *dir2) +void merge_dir(char *dir1, char *dir2, int isoutter) { int i, pn, sn; fileheader_t *fh; @@ -293,19 +293,25 @@ void merge_dir(char *dir1, char *dir2) fh= (fileheader_t *)malloc( (pn+sn)*sizeof(fileheader_t)); get_records(dir1, fh, sizeof(fileheader_t), 1, pn); get_records(dir2, fh+pn, sizeof(fileheader_t), 1, sn); + if(isoutter) + { + for(i=0; i 1000) i = 1000; - sprintf(buf, "您的花園信箱有 %d : %d, 原有 %d 匯入後共有 %d\n", - man.mailk, man.keepmail, cuser.exmailbox, cuser.exmailbox ); - strcat(msg, buf); - cuser.exmailbox = i; - - if(cuser.firstlogin > man.firstlogin) d = man.firstlogin; - else d = cuser.firstlogin; - sprintf(buf, "花園註冊日期 %s ", Cdatedate(&(man.firstlogin))); - strcat(msg,buf); - sprintf(buf, "此帳號註冊日期 %s 將取 ",Cdatedate(&(cuser.firstlogin))); - strcat(msg,buf); - sprintf(buf, "將取 %s\n", Cdatedate(&d) ); - strcat(msg,buf); - cuser.firstlogin = d; - - if(cuser.numlogins < man.numlogins) i = man.numlogins; - else i = cuser.numlogins; - - sprintf(buf, "花園進站次數 %d 此帳號 %d 將取 %d \n", man.numlogins, + i = cuser.exmailbox + man.mailk + man.keepmail; + if (i > 1000) i = 1000; + sprintf(buf, "您的花園信箱有 %d (%dk), 原有 %d 匯入後共有 %d\n", + man.keepmail, man.mailk, cuser.exmailbox, i); + strcat(msg, buf); + cuser.exmailbox = i; + + if(man.userlevel & PERM_MAILLIMIT) + { + sprintf(buf, "開啟信箱無上限\n"); + strcat(msg, buf); + cuser.userlevel |= PERM_MAILLIMIT; + } + + if(cuser.firstlogin > man.firstlogin) d = man.firstlogin; + else d = cuser.firstlogin; + sprintf(buf, "花園註冊日期 %s ", Cdatedate(&(man.firstlogin))); + strcat(msg,buf); + sprintf(buf, "此帳號註冊日期 %s 將取 ",Cdatedate(&(cuser.firstlogin))); + strcat(msg,buf); + sprintf(buf, "將取 %s\n", Cdatedate(&d) ); + strcat(msg,buf); + cuser.firstlogin = d; + + if(cuser.numlogins < man.numlogins) i = man.numlogins; + else i = cuser.numlogins; + + sprintf(buf, "花園進站次數 %d 此帳號 %d 將取 %d \n", man.numlogins, cuser.numlogins, i); - strcat(msg,buf); - cuser.numlogins = i; + strcat(msg,buf); + cuser.numlogins = i; - if(cuser.numposts < man.numposts ) i = man.numposts; - else i = cuser.numposts; - sprintf(buf, "花園文章次數 %d 此帳號 %d 將取 %d\n", + if(cuser.numposts < man.numposts ) i = man.numposts; + else i = cuser.numposts; + sprintf(buf, "花園文章次數 %d 此帳號 %d 將取 %d\n", man.numposts,cuser.numposts,i); - strcat(msg,buf); - cuser.numposts = i; - outs(msg); - while(search_ulistn(usernum,2)) + strcat(msg,buf); + cuser.numposts = i; + outs(msg); + while(search_ulistn(usernum,2)) {vmsg("請將重覆上站其他線關閉! 再繼續");} - passwd_update(usernum, &cuser); + passwd_update(usernum, &cuser); + } sethomeman(genbuf, cuser.userid); mkdir(genbuf, 0600); sprintf(buf, "tar zxvf home/%c/%s.tgz>/dev/null", @@ -129,13 +157,14 @@ m_fpg() sethomedir(buf, cuser.userid); sprintf(genbuf, "fpg/home/bbs/home/%c/%s/.DIR", userid[0], userid); - merge_dir(buf, genbuf); + merge_dir(buf, genbuf, 1); strcat(msg, "匯入個人信箱\n"); } - if(getans("是否匯入個人信箱精華區? (Y/n)")!='n') + if(getans("是否匯入個人信箱精華區? (會覆蓋\現有設定) (y/N)")=='y') { sprintf(buf, - "mv fpg/home/bbs/home/%c/%s/man home/%c/%s/man", + "rm -rd home/%c/%s/man>/dev/null ; mv fpg/home/bbs/home/%c/%s/man home/%c/%s", + cuser.userid[0], cuser.userid, userid[0], userid, cuser.userid[0], cuser.userid); system(buf); -- cgit v1.2.3