diff options
author | bbs <bbs@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-11 00:52:01 +0800 |
---|---|---|
committer | bbs <bbs@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-11 00:52:01 +0800 |
commit | fc1df3375ea5d4bada5db4802f563f575bebf362 (patch) | |
tree | 592c2f8ab356afea43a2ca31d7cdb55a3f9563d0 | |
parent | 9d6249db1b56e16d40bc6fad16576878816f8d2b (diff) | |
download | pttbbs-fc1df3375ea5d4bada5db4802f563f575bebf362.tar pttbbs-fc1df3375ea5d4bada5db4802f563f575bebf362.tar.gz pttbbs-fc1df3375ea5d4bada5db4802f563f575bebf362.tar.bz2 pttbbs-fc1df3375ea5d4bada5db4802f563f575bebf362.tar.lz pttbbs-fc1df3375ea5d4bada5db4802f563f575bebf362.tar.xz pttbbs-fc1df3375ea5d4bada5db4802f563f575bebf362.tar.zst pttbbs-fc1df3375ea5d4bada5db4802f563f575bebf362.zip |
ifdef-else-endif :Q
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@834 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/config.h | 6 | ||||
-rw-r--r-- | mbbsd/admin.c | 6 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 4 | ||||
-rw-r--r-- | mbbsd/user.c | 27 |
4 files changed, 37 insertions, 6 deletions
diff --git a/include/config.h b/include/config.h index d5d80cdc..23bca878 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,4 @@ -/* $Id: config.h,v 1.9 2003/03/10 03:13:02 in2 Exp $ */ +/* $Id: config.h,v 1.10 2003/05/10 16:52:01 bbs Exp $ */ #ifndef INCLUDE_CONFIG_H #define INCLUDE_CONFIG_H @@ -49,6 +49,10 @@ #define HAVE_JCEE 1 #endif +#ifndef FOREIGN_REG_DAY /* �~�y�ϥΪ̸եΤ���W�� */ +#define FOREIGN_REG_DAY 30 +#endif + #ifndef HAVE_FREECLOAK #define HAVE_FREECLOAK 0 #endif diff --git a/mbbsd/admin.c b/mbbsd/admin.c index d021c2f0..309f0f8d 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1,4 +1,4 @@ -/* $Id: admin.c,v 1.34 2003/05/09 13:30:32 victor Exp $ */ +/* $Id: admin.c,v 1.35 2003/05/10 16:52:01 bbs Exp $ */ #include "bbs.h" /* �ϥΪ̺z */ @@ -823,7 +823,11 @@ scan_register_form(char *regfile, int automode, int neednum) prints("\033[1;32m------------- �Я����Y��f�֨ϥΪ̸�ơA�z�٦� %d ��---------------\033[m\n", neednum); prints(" %-12s�G%s\n", finfo[0], fdata[0]); prints(" %-12s�G%s\n", finfo[1], fdata[1]); +#ifdef FOREIGN_REG_DAY prints("1.%-12s�G%s%s\n", finfo[n], fdata[n], muser.uflag2 & FOREIGN ? "�~�y" : ""); +#else + prints("1.%-12s�G%s\n", finfo[n], fdata[n]); +#endif for (n = 3; field[n]; n++) { prints("%d.%-12s�G%s\n", n - 2, finfo[n], fdata[n]); } diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 7fc41c85..33f45264 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1,4 +1,4 @@ -/* $Id: mbbsd.c,v 1.74 2003/05/09 13:30:32 victor Exp $ */ +/* $Id: mbbsd.c,v 1.75 2003/05/10 16:52:01 bbs Exp $ */ #include "bbs.h" #define SOCKET_QLEN 4 @@ -884,6 +884,7 @@ user_login() if (!PERM_HIDE(currutmp)) cuser.lastlogin = login_start_time; +#ifdef FOREIGN_REG_DAY if (cuser.uflag2 & (FOREIGN | LIVERIGHT)){ if (login_start_time - cuser.firstlogin > (FOREIGN_REG_DAY - 5) * 24 * 3600){ mail_muser(cuser, "[�X�J�Һz��]", "etc/foreign_expired_warn"); @@ -893,6 +894,7 @@ user_login() mail_muser(cuser, "[�X�J�Һz��]", "etc/foreign_expired"); } } +#endif passwd_update(usernum, &cuser); for (i = 0; i < NUMVIEWFILE; i++) diff --git a/mbbsd/user.c b/mbbsd/user.c index 99a830b0..0ff9a7f0 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1,4 +1,4 @@ -/* $Id: user.c,v 1.55 2003/05/09 16:27:29 victor Exp $ */ +/* $Id: user.c,v 1.56 2003/05/10 16:52:01 bbs Exp $ */ #include "bbs.h" static char *sex[8] = { @@ -51,16 +51,22 @@ user_display(userec_t * u, int real) " �� �� " " \033[m \033[30;41m�r�s�r�s�r�s\033[m\n"); prints(" �N���ʺ�: %s(%s)\n" - " �u��m�W: %s %s%s\n" + " �u��m�W: %s" +#ifdef FOREIGN_REG_DAY + " %s%s" +#endif + "\n" " �~�����}: %s\n" " �q�l�H�c: %s\n" " �� �O: %s\n" " �Ȧ�b��: %d �Ȩ�\n", u->userid, u->username, u->realname, +#ifdef FOREIGN_REG_DAY u->uflag2 & FOREIGN ? "(�~�y: " : "", u->uflag2 & FOREIGN ? (u->uflag2 & LIVERIGHT) ? "�ä[�~�d)" : "�����o�~�d�v)" : "", +#endif u->address, u->email, sex[u->sex % 8], u->money); @@ -314,7 +320,11 @@ uinfo_query(userec_t * u, int real, int unum) if (real) { getdata_buf(i++, 0, "�u��m�W�G", x.realname, sizeof(x.realname), DOECHO); +#ifdef FOREIGN_REG_DAY getdata_buf(i++, 0, cuser.uflag2 & FOREIGN ? "�@�Ӹ��X" : "�����Ҹ��G", +#else + getdata_buf(i++, 0, "�����Ҹ��G", +#endif x.ident, sizeof(x.ident), DOECHO); getdata_buf(i++, 0, "�~���a�}�G", x.address, sizeof(x.address), DOECHO); @@ -438,6 +448,7 @@ uinfo_query(userec_t * u, int real, int unum) x.chc_tie = atoi(p); break; } +#ifdef FOREIGN_REG_DAY if (getdata_str(i++, 0, "���y 1)���� 2)�~��G", buf, 2, DOECHO, x.uflag2 & FOREIGN ? "2" : "1")) if ((fail = atoi(buf)) > 0){ if (fail == 2){ @@ -459,6 +470,7 @@ uinfo_query(userec_t * u, int real, int unum) } } } +#endif fail = 0; } break; @@ -927,7 +939,10 @@ toregister(char *email, char *genbuf, char *phone, char *career, char fore, fn = fopen(buf, "w"); assert(fn); fprintf(fn, "%s%s\n%s\n%s\n%s\n%s\n%s\n", - fore & FOREIGN ? "#foreign\n" : "", +#ifdef FOREIGN_REG_DAY + fore & FOREIGN ? "#foreign\n" : +#endif + "", phone, career, ident, rname, addr, mobile); fclose(fn); } @@ -1220,6 +1235,7 @@ u_register(void) move(1, 0); prints("%s(%s) �z�n�A�оڹ��g�H�U�����:", cuser.userid, cuser.username); +#ifdef FOREIGN_REG_DAY while (1) { getfield(2, "Y/n", "�O�_�������y�H", fore, 2); fore[0] = tolower(fore[0]); @@ -1236,6 +1252,7 @@ u_register(void) } } if (!fore[0]){ +#endif while( 1 ){ getfield(5, "D123456789", "�����Ҹ�", ident, 11); if ('a' <= ident[0] && ident[0] <= 'z') @@ -1244,6 +1261,7 @@ u_register(void) break; vmsg("�z����J�����T(�Y�����D�·Ц�SYSOP�O)"); } +#ifdef FOREIGN_REG_DAY } else{ while( 1 ){ @@ -1254,6 +1272,7 @@ u_register(void) vmsg("�Э��s��J(�Y�����D�·Ц�SYSOP�O)"); } } +#endif while (1) { getfield(8, "�ХΤ���", "�u��m�W", rname, 20); if( (errcode = isvaildname(rname)) == NULL ) @@ -1334,10 +1353,12 @@ u_register(void) cuser.month = mon; cuser.day = day; cuser.year = year; +#ifdef FOREIGN_REG_DAY if (fore[0]) cuser.uflag2 |= FOREIGN; else cuser.uflag2 &= ~FOREIGN; +#endif trim(career); trim(addr); trim(phone); |