home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / WCVFY.ZIP / WCVFY.WCC < prev    next >
Text File  |  1994-10-11  |  9KB  |  298 lines

  1. CarrierCheck On
  2.  
  3. Type TempRecord
  4.    Name As String*25
  5.    Phone As String*15
  6.    Data As String*15
  7.    Fax As String*15
  8.    SecLevel As String*10
  9. End Type
  10.  
  11. Dim wcVfyV As String
  12. Dim Ctr As Integer
  13. Dim pWrd As String*15, pWrdTest As String*15
  14. Dim pWrd2 As String*15, pWrd3 As String*15, pWrd4 As String*15
  15. Dim Go As String*1
  16. Dim TodayNow As Datetime
  17. Dim ExpireDate As Date
  18. Dim Msg As MessageHeader
  19. Dim MessageUser As String
  20. Dim MessageSysOp As String
  21. Dim BadUserMsg As String
  22. Dim BadSysOpMsg As String
  23. Dim Tries As Integer
  24. Dim BadNumber As Integer
  25. Dim tRec As TempRecord
  26. Static Phone As String*8
  27. CurrentDate(ExpireDate)
  28. CurrentDateTime(TodayNow)
  29. wcVfyV = "1.01"
  30.  
  31. Open "wcvfy.log" For Append As #1
  32. Open "wcvfy.err" For Append As #2
  33. Open "modem.dmp" For Append As #3
  34.  
  35. Function SendUser(MsgHd As MessageHeader) As Integer
  36.    Dim Ok As Integer
  37.    SendUser = False
  38.    Do
  39.      MsgHd.From = MakeWild.SysopName
  40.      MsgHd.To = User.Name
  41.      MsgHd.Flags = 1
  42.      MsgHd.Subject = "You've Been Validated!"
  43.      Ok = Trim(MsgHd.From + MsgHd.To + MsgHd.Subject) > ""
  44.      If Not(OK) Then
  45.          Print #2, "There was an Error creating the Message to the User!"
  46.      End If
  47.    Loop Until Ok
  48.    SendUser = True
  49. End Function
  50.  
  51. Function SendSysOp(MsgHd As MessageHeader) As Integer
  52.    Dim Ok As Integer
  53.    SendSysOp = False
  54.    Do
  55.      MsgHd.From = User.Name
  56.      MsgHd.To = MakeWild.SysopName
  57.      MsgHd.Flags = 1
  58.      MsgHd.Subject = "I've been Validated!"
  59.      Ok = Trim(MsgHd.From + MsgHd.To + MsgHd.Subject) > ""
  60.      If Not(OK) Then
  61.          Print #2, "There was an Error creating the Message to the SysOp!"
  62.      End If
  63.    Loop Until Ok
  64.    SendSysOp = True
  65. End Function
  66.  
  67. Function BadUser(MsgHd As MessageHeader) As Integer
  68.    Dim Ok As Integer
  69.    BadUser = False
  70.    Do
  71.      MsgHd.From = MakeWild.SysopName
  72.      MsgHd.To = User.Name
  73.      MsgHd.Flags = 1
  74.      MsgHd.Subject = "Duplicate Number?"
  75.      Ok = Trim(MsgHd.From + MsgHd.To + MsgHd.Subject) > ""
  76.      If Not(OK) Then
  77.          Print #2, "There was an Error creating the Message to the User!"
  78.      End If
  79.    Loop Until Ok
  80.    BadUser = True
  81. End Function
  82.  
  83. Function BadSysOp(MsgHd As MessageHeader) As Integer
  84.    Dim Ok As Integer
  85.    BadSysOp = False
  86.    Do
  87.      MsgHd.From = User.Name
  88.      MsgHd.To = MakeWild.SysopName
  89.      MsgHd.Flags = 1
  90.      MsgHd.Subject = "Duplicate Nubmer?"
  91.      Ok = Trim(MsgHd.From + MsgHd.To + MsgHd.Subject) > ""
  92.      If Not(OK) Then
  93.          Print #2, "There was an Error creating the Message to the SysOp!"
  94.      End If
  95.    Loop Until Ok
  96.    BadSysOp = True
  97. End Function
  98.  
  99. Function CallBack
  100.   Tries=0
  101.   Do
  102.     Tries = Tries + 1
  103.     Delay 5
  104.     Print #1, "          # Now Calling : " ; Phone
  105.     Print #1, "          # Dialing, attempt number : " ; Tries
  106.     Send "ATDT" + Phone + Chr(13)
  107.     Dim StartTime As Real
  108.     StartTime = Timer
  109.     Do
  110.       Print #3, INCOMM ;
  111.       If Timer - StartTime > 60 Then
  112.         Send Chr(13)
  113.         Exit Do
  114.       End If
  115.     Loop Until Carrier
  116.     If Tries >= 3 Then
  117.       Print #1, "          # Too many Rings, aborting."
  118.       CarrierCheck On
  119.       End
  120.     End If
  121.   Loop Until Carrier
  122. Delay 1
  123. Do
  124. Loop Until INCOMM = ""
  125. Close #3
  126. Del "modem.dmp"
  127. End Function
  128.  
  129. Function StartLog
  130.   Print #1, "-------------------------------------------------------------------------------"
  131.   Print #1, FormatDate(TodayNow.d,"mm/dd/yy  ") ;
  132.   Print #1, FormatTime(TodayNow.t,"hh:mm:ss  ") ;
  133.   Print #1, "User Name: "  User.Name ;
  134.   Print #1, "  Calling From: " User.From
  135. End Function
  136.  
  137. Function ChkNumber
  138.    Dim TestPhone As String*8
  139.    Dim t As Integer
  140.    TestPhone = Phone
  141.    BadNumber = False
  142.    Locate 22,5
  143.    Open "wcvfy.dat" For Random As #4 Len = Len(TempRecord)
  144.    t = 1
  145.    Do While Not EOF(4)
  146.      t = t + 1
  147.      Get #4,t, tRec
  148.      If Right(TRec.Phone,8) = TestPhone Then
  149.         BadNumber = True
  150.      ElseIf Right(TRec.Data,8) = TestPhone Then
  151.         BadNumber = True
  152.      ElseIf Right(TRec.Fax,8) = TestPhone Then
  153.         BadNumber = True
  154.      End If
  155.    Loop
  156.    Close #4
  157. End Function
  158.  
  159. Function AddCaller
  160.    Open "wcvfy.dat" For Random As #4 Len = Len(TempRecord)
  161.    tRec.Name = User.Name
  162.    tRec.Phone = User.PhoneNumber
  163.    tRec.Data = User.DataNumber
  164.    tRec.Fax = User.FaxNumber
  165.    tRec.SecLevel = User.SecLevel
  166.    If tRec.Name <> "" Then
  167.       Put #4, Lof(4) + 1, tRec
  168.       Print #1, "          * " ; User.Name ; "'s data added for Duplicate Checking"
  169.    End If
  170.    Close #4
  171. End Function
  172.  
  173. StartLog
  174. Go = InputMask("Would you like to use wcVFY v" + wcVfyV + ", the Call-Back Verifier?","Y")
  175.    If Go = "N" then end
  176.      DisplayFile "wcvfy1.bbs"
  177.           DO
  178.             GetPword:
  179.             Locate 19,5
  180.             pwrd = InputMask("          What is your password? ","XXXXXXXXXXXXXXX")
  181.             pwrdtest = InputMask("              Check your password? ","XXXXXXXXXXXXXXX")
  182.               If pWrd <> pWrdTest Then Goto GetPword
  183.                    If Len(pwrd) < 5 Then
  184.                      Print"         Your password must be at least 5 characters long."
  185.                    End if
  186.           Loop Until Len(pwrd) >= 5
  187.  
  188.           Print #1, "          * User Password: " pwrd
  189.           GetNum:
  190.           ctr = 0
  191.           Locate 21,5
  192.           Phone = InputMask("          What phone number should I call you at? ","999-9999")
  193.           If left(phone,1) = "9" Then
  194.               Print"            This system does not return calls to 9xx-xxxx numbers."
  195.               Print"                       please try your number again."
  196.               Goto GetNum
  197.           End if
  198.           If Len(Phone) < 7 Then
  199.               Print"                 You must enter a full 7-digit phone number."
  200.               Goto Getnum
  201.           End if
  202.           ChkNumber
  203.           If BadNumber = True Then
  204.               Print ""
  205.               Print "        @0E@  The Phone Number you have entered is already in use."
  206.               Print "          You'll either have to select another or leave the SysOp"
  207.               Print "          a Comment explaining the reason for the duplicate number."
  208.               Print ""
  209.               Print "                      @09@Now Returning you to @0F@@BBS@@0E@."
  210.               WaitEnter
  211.               Print #1, "          ! =-=-=-=  Duplicate Number Found =-=-=-="
  212.               Print #1, "          # The Number was : " ; phone ; "."
  213.               If BadUser(Msg) Then
  214.                  BadUserMsg = "wc_badus.msg"
  215.                  AddMessage Msg, BadUserMsg
  216.                  Print #1, "          @ BadUser Message Sent successfully"
  217.               End If
  218.               If BadSysOp(Msg) Then
  219.                  BadSysOpMsg = "wc_badsy.msg"
  220.                  AddMessage Msg, BadSysOpMsg
  221.                  Print #1, "          @ BadSysOp Message Sent successfully"
  222.               End If
  223.               End
  224.           End If
  225.  
  226. CLS
  227. Locate 2,1
  228. Print "@09@          I will now hangup, when I call back be ready to answer"
  229. Print "                 by typing 'ATA' from your terminal window."
  230. Print "                    Hit the enter key when you're ready!"
  231. Locate 6,1
  232. Waitenter
  233. If Not(Local) Then
  234.   CarrierCheck Off
  235.   Hangup
  236.   CallBack
  237.   CarrierCheck On
  238. End If
  239. CLS
  240. Locate 5,1
  241. Print "@0E@     This is @BBS@'s callback verifier calling to verify you."
  242. Print ""
  243. WaitEnter
  244. Print #1, "          $ Caller Connected!" ;
  245. Print #1, " at " ;
  246. Print #1, FormatTime(TodayNow.t, "hh:mm:ss")
  247. CLS
  248. DisplayFile "wcvfy2.bbs"
  249. Locate 7,1
  250. pWrd2 = InputMask("      Please enter your callback password now : ","XXXXXXXXXXXXXXX")
  251. If pWrd = pWrd2 Then
  252.    Print "     You have now been upgraded to Trial User status!"
  253.    Print ""
  254.    Print "  You now have a valid account for 30-Day's, after that"
  255.    Print "time period please concider donating to become a member."
  256.    WaitEnter
  257. Else
  258.    pWrd3 = InputMask("      Please try your password again : ","XXXXXXXXXXXXXXX")
  259.        If pwrd = pwrd3 Then
  260.            Print "     You have now been upgraded to Trial User status!"
  261.            Print ""
  262.            Print "  You now have a valid account for 30-Day's, after that"
  263.            Print "time period please concider donating to become a member."
  264.            WaitEnter
  265.        Else
  266.            Print "THIS IS YOUR LAST CHANCE!"
  267.            pWrd4 = InputMask("       Enter you password now : ","XXXXXXXXXXXXXXX")
  268.              If pwrd = pWrd4 Then
  269.                   Print "You finally made it!  You are now a Trial User!"
  270.                   Print ""
  271.                   Print "  You now have a valid account for 30-Day's, after that"
  272.                   Print "time period please concider donating to become a member."
  273.                   WaitEnter
  274.                Else Hangup
  275.                   Stop
  276.              End If
  277.        End If
  278. End if
  279. User.SecLevel = "TRIAL"
  280. User.Comment(5) = "Verified # " + Phone
  281. User.ExpireDate.Number = ExpireDate.Number + 30
  282. If User.SecLevel = "TRIAL" Then
  283.    AddCaller
  284.    Print #1, "          * User Upgraded to Trial Successfully!"
  285. End If
  286. If SendUser(Msg) Then
  287.    MessageUser = "wc_user.msg"
  288.    AddMessage Msg, MessageUser
  289.    Print #1, "          @ User Message Sent successfully"
  290. End If
  291. If SendSysOp(Msg) Then
  292.    MessageSysOp = "wc_sysop.msg"
  293.    AddMessage Msg, MessageSysOp
  294.    Print #1, "          @ SysOp Message Sent successfully"
  295. End If
  296. Close
  297. End
  298.