home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
MODS412.ZIP
/
BDATE.MOD
< prev
next >
Wrap
Text File
|
1992-12-01
|
9KB
|
155 lines
Fletcher Christian #1 @7305
Mon Apr 09 22:41:21 1990
╒═══════════╤═════════════════════════════╤════════╤════╕
│ │ Birthdate & Phone Number │ │v1.0│
│ │ Validation Check │ ╘════╡
│ │ Modification for WWIV v4.12 │ │
│ │ by Fletcher Christian │ │
│ ╘═╕ 1 @ 7305 HMS Bounty ╒═╛ │
│INTRODUCTION ╘═════════════════════════╛ │
│ Someone requested this mod on the modnet, but I │
│ don't really remember who, and I'd been planning to │
│ to write it anyways, so... │
│ │
│ One of the first things you've got to realize about│
│ this mod is that it will destroy all currently exist- │
│ ing 'thisuser.note's. │
│ │
│ What it does is when you hit ":" from UEDIT, it │
│ simply copies that user's current birthdate & phone │
│ number into the 'thisuser.note' field. The next time │
│ the user logs on he/she/it is requested to reenter │
│ the birthdate & phone number and they are compared │
│ with the old ones. If they fail, you are notified in │
│ the sysop log. Simple huh? │
│ │
│ I know some of you might actually use 'thisuser. │
│ note' for something and might not want to mess this │
│ up, but if you think about it, you can simply do a │
│ ":" to every new user wait til they call back then │
│ fill in their note. Whatever...if you don't like it │
│ dont' use it. │
╘═══════════════════════════════════════════════════════╛
╒═══════════════════╕
│STEP 1 │
│in BBSUTL.C │
│in void logon() │
╘═══════════════════╛
char ....,*ss1,*ss2,... /* Change*/
:
:
pl("Please enter the following information:"); /* Exist */
do { /* " */
nl(); /* " */
input_age(&thisuser); /* " */
nl(); /* Add */
input_phone(&thisuser); /* Add */
sprintf(s,"Birthdate:%02d/%02d/%02d Phone:%s", /* Change*/
(int) thisuser.month, /* this */
(int) thisuser.day, /* stupid*/
(int) thisuser.year, /* thing */
(int) thisuser.phone); /*around!*/
pl(s); /* Add */
nl(); /* Add */
prt(1,"Is this information correct?"); /* Add */
if (yn()) { /* Add */
ss1=strchr(s,':'); /* Add */
ss2=strrchr(s1,':'); /* Add */
ss1[0]=0; /* Add */
ss2[0]=0; /* Add */
ss1=&(ss1[1]); /* Add */
ss2=&(ss2[2]); /* Add */
if (!(strnicmp(ss1,thisuser.note,8)==0)) /* Add */
sysoplog("FAILED Birthdate Check"); /* Add */
else /* Add */
sysoplog("PASSED Birthdate Check"); /* Add */
ss=strrchr(thisuser.note,' '); /* Add */
ss[0]=0; /* Add */
ss=&(ss[1]); /* Add */
if (!(strcmp(ss,thisuser.phone)==0)) /* Add */
sysoplog("FAILED Phone Check"); /* Add */
else /* Add */
sysoplog("PASSED Phone Check"); /* Add */
} else /* Add */
thisuser.year=0; /* Add */
} while ((!hangup) && (thisuser.year==0));
topscreen();
/* Hint: No kidding! OK OK OK, the above code isn't commented */
/* too well! Just block it in and go from there! */
╒═════════════════════╕
│STEP 2 │
│in NEWUSER.C │
│in void input_phone()│
╘═════════════════════╛
void input_phone(userrec *u) /* Change */
{ /* Exists */
int ok,i; /* Exists */
do { /* Exists */
nl(); /* " " */
pl(" ###-###-####"); /* " " */
outstr(":"); /* " " */
inputl(u->phone,12); /* Change */
ok=1; /* Exists */
if (strlen(u->phone)!=12) /* Change */
ok=0; /* Exists */
if ((u->phone[3]!='-') || (u->phone[7]!='-')) /* Change */
ok=0; /* Exists */
if ((u->phone[1]!='0') && (u->phone[1]!='1')) /* Change */
ok=0; /* Exists */
for (i=0; i<12; i++) /* " " */
if ((i!=3) && (i!=7)) /* " " */
if ((u->phone[i]<'0') || (u->phone[i]>'9')) /* Change */
ok=0; /* Exists */
/* " " */
if (!ok) { /* " " */
nl(); /* " " */
pl("Please enter a valid phone number"); /* " " */
pl("in the correct format."); /* " " */
} /* " " */
} while ((!ok) && (!hangup)); /* " " */
} /* " " */
/* Note there are about 1-3 places in your code where you'll */
/* have to change the input_phone() to input_phone(&thisuser) */
/* simply use grep, Norton's TS.EXE, or whatever else to find */
/* and change these on your own...or TC will show them to ya! */
╒════════════════════╕
│STEP 3 │
│in FCNS.H │
╘════════════════════╛
void input_realname(); /* Exists */
void input_phone(userrec *u); /* Change */
void input_sex(); /* Exists */
╒═══════════════════════════════════╕
│STEP 4 │
│in SYSOPF.C │
│in void uedit(int usern, int other)│
╘═══════════════════════════════════╛
case ':':
sprintf(s,"%02d/%02d/%02d %-12s",(int)u.month,(int)u.day,(int)u.year,u.phone);
strcpy(u.note,s);
u.year=0;
write_user(un,&u);
break;
╒═══════════════════════════════════════════════════════╕
│ HISTORY: It's 2:30am and time for bed. Started it │
│ at 11:30pm so it's a 3 hour mod, 2 hours of which was │
│ spent getting this thing to work on vanilla code... │
│ which I'm not sure that it does, but it really won't │
│ kill anyone to try :) │
│ COMMENTS: If you like it then send some money to │
│ Amnesty International or The Red Cross. If you don't │
│ like it, send some anyway. You'll feel better. │
╘═══════════════════════════════════════════════════════╛
Fletcher Chirstian: Host of both "WWIVNet OS/2 Forum"
& "WWIVLink OS/2 Forum"