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 >
Text File  |  1992-12-01  |  9KB  |  155 lines

  1. Fletcher Christian #1 @7305
  2. Mon Apr 09 22:41:21 1990
  3.             ╒═══════════╤═════════════════════════════╤════════╤════╕
  4.             │           │   Birthdate & Phone Number  │        │v1.0│
  5.             │           │       Validation Check      │        ╘════╡
  6.             │           │ Modification for WWIV v4.12 │             │
  7.             │           │   by  Fletcher Christian    │             │
  8.             │           ╘═╕ 1 @ 7305    HMS Bounty  ╒═╛             │
  9.             │INTRODUCTION ╘═════════════════════════╛               │
  10.             │    Someone requested this mod on the modnet, but I    │
  11.             │ don't really remember who, and I'd been planning to   │
  12.             │ to write it anyways, so...                            │
  13.             │                                                       │
  14.             │    One of the first things you've got to realize about│
  15.             │ this mod is that it will destroy all currently exist- │
  16.             │ ing 'thisuser.note's.                                 │
  17.             │                                                       │
  18.             │    What it does is when you hit ":" from UEDIT, it    │
  19.             │ simply copies that user's current birthdate & phone   │
  20.             │ number into the 'thisuser.note' field.  The next time │
  21.             │ the user logs on he/she/it is requested to reenter    │
  22.             │ the birthdate & phone number and they are compared    │
  23.             │ with the old ones.  If they fail, you are notified in │
  24.             │ the sysop log.  Simple huh?                           │
  25.             │                                                       │
  26.             │    I know some of you might actually use 'thisuser.   │
  27.             │ note' for something and might not want to mess this   │
  28.             │ up, but if you think about it, you can simply do a    │
  29.             │ ":" to every new user wait til they call back then    │
  30.             │ fill in their note.  Whatever...if you don't like it  │
  31.             │ dont' use it.                                         │
  32.             ╘═══════════════════════════════════════════════════════╛
  33.  ╒═══════════════════╕
  34.  │STEP 1             │
  35.  │in BBSUTL.C        │
  36.  │in void logon()    │
  37.  ╘═══════════════════╛
  38.       char ....,*ss1,*ss2,...                                 /* Change*/
  39.       :
  40.       :
  41.       pl("Please enter the following information:");          /* Exist */
  42.       do {                                                    /*   "   */
  43.         nl();                                                 /*   "   */
  44.         input_age(&thisuser);                                 /*   "   */
  45.         nl();                                                 /*  Add  */
  46.         input_phone(&thisuser);                               /*  Add  */
  47.         sprintf(s,"Birthdate:%02d/%02d/%02d  Phone:%s",       /* Change*/
  48.                                 (int) thisuser.month,         /*  this */
  49.                                 (int) thisuser.day,           /* stupid*/
  50.                                 (int) thisuser.year,          /* thing */
  51.                                 (int) thisuser.phone);        /*around!*/
  52.         pl(s);                                                /*  Add  */
  53.         nl();                                                 /*  Add  */
  54.         prt(1,"Is this information correct?");                /*  Add  */
  55.         if (yn()) {                                           /*  Add  */
  56.           ss1=strchr(s,':');                                  /*  Add  */
  57.           ss2=strrchr(s1,':');                                /*  Add  */
  58.           ss1[0]=0;                                           /*  Add  */
  59.           ss2[0]=0;                                           /*  Add  */
  60.           ss1=&(ss1[1]);                                      /*  Add  */
  61.           ss2=&(ss2[2]);                                      /*  Add  */
  62.           if (!(strnicmp(ss1,thisuser.note,8)==0))            /*  Add  */
  63.             sysoplog("FAILED Birthdate Check");               /*  Add  */
  64.           else                                                /*  Add  */
  65.             sysoplog("PASSED Birthdate Check");               /*  Add  */
  66.           ss=strrchr(thisuser.note,' ');                      /*  Add  */
  67.           ss[0]=0;                                            /*  Add  */
  68.           ss=&(ss[1]);                                        /*  Add  */
  69.           if (!(strcmp(ss,thisuser.phone)==0))                /*  Add  */
  70.             sysoplog("FAILED Phone Check");                   /*  Add  */
  71.           else                                                /*  Add  */
  72.             sysoplog("PASSED Phone Check");                   /*  Add  */
  73.         } else                                                /*  Add  */
  74.           thisuser.year=0;                                    /*  Add  */
  75.       } while ((!hangup) && (thisuser.year==0));
  76.       topscreen();
  77.       /* Hint: No kidding! OK OK OK, the above code isn't commented */
  78.       /* too well!  Just block it in and go from there!             */
  79.  
  80.  ╒═════════════════════╕
  81.  │STEP 2               │
  82.  │in NEWUSER.C         │
  83.  │in void input_phone()│
  84.  ╘═════════════════════╛
  85.  
  86. void input_phone(userrec *u)                        /* Change */
  87. {                                                   /* Exists */
  88.   int ok,i;                                         /* Exists */
  89.  
  90.   do {                                              /* Exists */
  91.     nl();                                           /*  "  "  */
  92.     pl(" ###-###-####");                            /*  "  "  */
  93.     outstr(":");                                    /*  "  "  */
  94.     inputl(u->phone,12);                            /* Change */
  95.  
  96.     ok=1;                                           /* Exists */
  97.     if (strlen(u->phone)!=12)                       /* Change */
  98.       ok=0;                                         /* Exists */
  99.     if ((u->phone[3]!='-') || (u->phone[7]!='-'))   /* Change */
  100.       ok=0;                                         /* Exists */
  101.     if ((u->phone[1]!='0') && (u->phone[1]!='1'))   /* Change */
  102.       ok=0;                                         /* Exists */
  103.     for (i=0; i<12; i++)                            /*  "  "  */
  104.       if ((i!=3) && (i!=7))                         /*  "  "  */
  105.         if ((u->phone[i]<'0') || (u->phone[i]>'9')) /* Change */
  106.           ok=0;                                     /* Exists */
  107.                                                     /*  "  "  */
  108.     if (!ok) {                                      /*  "  "  */
  109.       nl();                                         /*  "  "  */
  110.       pl("Please enter a valid phone number");      /*  "  "  */
  111.       pl("in the correct format.");                 /*  "  "  */
  112.     }                                               /*  "  "  */
  113.   } while ((!ok) && (!hangup));                     /*  "  "  */
  114. }                                                   /*  "  "  */
  115. /* Note there are about 1-3 places in your code where you'll */
  116. /* have to change the input_phone() to input_phone(&thisuser) */
  117. /* simply use grep, Norton's TS.EXE, or whatever else to find */
  118. /* and change these on your own...or TC will show them to ya! */
  119.  
  120.  ╒════════════════════╕
  121.  │STEP 3              │
  122.  │in FCNS.H           │
  123.  ╘════════════════════╛
  124.  
  125. void input_realname();                              /* Exists */
  126. void input_phone(userrec *u);                       /* Change */
  127. void input_sex();                                   /* Exists */
  128.  
  129.  ╒═══════════════════════════════════╕
  130.  │STEP 4                             │
  131.  │in SYSOPF.C                        │
  132.  │in void uedit(int usern, int other)│
  133.  ╘═══════════════════════════════════╛
  134.  
  135.     case ':':
  136.       sprintf(s,"%02d/%02d/%02d %-12s",(int)u.month,(int)u.day,(int)u.year,u.phone);
  137.       strcpy(u.note,s);
  138.       u.year=0;
  139.       write_user(un,&u);
  140.       break;
  141.  
  142.             ╒═══════════════════════════════════════════════════════╕
  143.             │ HISTORY:  It's 2:30am and time for bed.  Started it   │
  144.             │ at 11:30pm so it's a 3 hour mod, 2 hours of which was │
  145.             │ spent getting this thing to work on vanilla code...   │
  146.             │ which I'm not sure that it does, but it really won't  │
  147.             │ kill anyone to try :)                                 │
  148.             │ COMMENTS:  If you like it then send some money to     │
  149.             │ Amnesty International or The Red Cross.  If you don't │
  150.             │ like it, send some anyway.  You'll feel better.       │
  151.             ╘═══════════════════════════════════════════════════════╛
  152.  
  153. Fletcher Chirstian:  Host of both "WWIVNet OS/2 Forum"
  154.                                 & "WWIVLink OS/2 Forum"
  155.