; LOGON module››; Version 2.6 Apr 3/90››; Written by Weird Al›; The Stupid BBS››;-------------------------------------››Set 14 = $7000›Set $491 = $7000››Byte Array Header = [0 0 0 $26 04 03 90 $00 '@]››; Program definitions››Define Loop = "Do", Endloop = "Od"›Define EndIf = "Fi", Subroutine = "Proc"›››; Local variables››Byte x,y,z,Tries,Failed›Byte Array Width(2)›Byte Array UserID(21)›Byte Array Password(16)›Byte Array Syspw(16)›Byte Array Unumstr(5)›Byte Array Logfile = "Dx:>pro>log>call.log"›Byte Array Cfgfile = "Dx:>pro>data>logoncfg.dat"›Byte Array Cfgstring(13)›Byte Array Default_country(11)›Byte Sysnews_send›Byte Logstat_send›Byte Send_prompts›Byte Array Chain_to(10)›Byte Cfgerr›Byte Datadr››; Pro SYSDATA equates››Byte Array U_Handle(21) = $330D›Byte Array U_lstcall(14) = $33A7›Byte U_tlday = $33B6›Byte U_mintoday = $33B7›Card U_lastread = $33B8›Card U_totcalls = $33C3›Byte U_vw = $33C5›Byte Array U_flags(2) = $33C6›Byte Array U_seclvl(4) = $33C8›Byte U_pagesize = $33F3›Byte T_inuse = $340A›Byte Array T_handle(21) = $340D›Byte Array T_name(21) = $3422›Byte Array T_pword(16) = $3437›Byte Array T_seclvl(4) = $34C8›Byte V_tlcall = $35B5›Byte N_tlcall = $36B5›Card Lastread_work = $375C›Card S_totcalls = $376F›Card S_calltoday = $3771›Byte S_handles = $3789›Byte Array S_secpw(16) = $378D›Byte S_logdr = $37A1›Card S_node = $3C7C›Byte Array S_nodename(26) = $3C7E›Byte Array S_nodecity(26) = $3C98›Byte S_datadr = $3EED›Card Usernum = $3EF0›Byte BBS_active = $3EF3›Byte Compl_logon = $3EF4›Byte Invoker = $3EF5›Byte Trans = $3EF6›Card Free_time = $3F05›Byte N_feedback = $3F09›Byte N_uploads = $3F0A›Byte N_users = $3F0B›Byte Min_conn = $3F11›Byte Array Cur_date(15) = $3F17›Byte Array Cur_time(15) = $3F26›Byte Array Con_date(15) = $3F48›Byte Array Con_time(15) = $3F57›Byte Array Parm1(40) = $404F››; Runtime routines››PROC StrC=*(CARD c, s)›[$85$D4$86$D5$84$A2$20$AA$D9$20$E6$D8›$A0$00$B1$F3$30$06$C8$91$A2$38$B0$F6›$29$7F$C8$91$A2$98$A0$00$91$A2$60]››Card Func ValC(card c)›[$85$A2$86$A3$A9$00$85$A0$85$A1$85$A5›$A8$B1$A2$85$A4$C8$B1$A2$C9$20$F0$F9›$C9$2D$D0$0B$C6$A5$C8$C4$A4$F0$02$B0›$31$B1$A2$38$E9$30$90$2A$C9$0A$B0$26›$48$06$A0$26$A1$A5$A0$A6$A1$0A$26$A1›$0A$26$A1$18$65$A0$85$A0$8A$65$A1$85›$A1$18$68$65$A0$85$A0$90$CD$E6$A1$38›$B0$C8$A5$A5$F0$0D$38$A9$00$E5$A0$85›$A0$A9$00$E5$A1$85$A1$60]››PROC SCopyS=*(CARD d, s BYTE b, e)›[$85$A0$86$A1$84$A2$A0$00$84$A6$B1$A2›$C5$A5$B0$02$85$A5$A5$A4$F0$15$C5$A5›$F0$02$B0$0F$A4$A4$E6$A4$B1$A2$E6$A6›$A4$A6$91$A0$38$B0$E7$A5$A6$A0$00$91›$A0$60]›››PROC _ERROU=*()›;Error routine.›[$A9$70$AA$A9$0C$9D$42$03$20$56$E4$8A›$38$E9$10$D0$F1$6C$0A$00]››PROC _ERRVEC=*()›[_ERROU]››MODULE›CARD Error=_ERRVEC››PROC _GOCIO=*()›;JSR to CIO routine and check›;for errors.›[$20$56$E4$10$1A$C0$88$F0$06$68$68$98›$6C _ERRVEC $48$8A$48$4A$4A$4A$4A$AA›$A9$01$9D$C0$05$68$AA$68$60]››PROC _LODCHN=*()›;Check A reg for illegal IOCB #.›;If ok, X reg = A reg * 16.›[$C9$08$90$07$68$68$A9$86$6C _ERRVEC›$0A$0A$0A$0A$AA$60]››PROC _STONAM=*()›;I/O utility.›[$18$69$01$9D$44$03$98$69$00$9D$45$03›$60]››PROC _CLREOL=*()›;Clear EOL flag.›[$48$A9$00$85$A5$68$60]››PROC _SETEOL=*()›;Set EOL flag.›[$48$A9$01$85$A5$68$60]››PROC _DOPRNT=*()›;Print a string.›[$86$A3$84$A4$20 _LODCHN $A9$00$9D$49›$03$A8$B1$A3$F0$1A$9D$48$03$18$A5$A3›$69$01$9D$44$03$A5$A4$69$00$9D$45$03›$A9$0B$9D$42$03$20 _GOCIO $A5$A5$F0›$12$A9$00$9D$48$03$9D$49$03$A9$0B$9D›$42$03$A9$9B$20 _GOCIO $60]››PROC _DOINPT=*()›;Called by all input routines.›[$86$A4$84$A5$20 _LODCHN $18$A5$A4$69›$01$9D$44$03$A5$A5$69$00$9D$45$03$A5›$A3$F0$18$9D$48$03$A9$00$9D$49$03$A9›$05$9D$42$03$20 _GOCIO $BD$48$03$F0›$03$38$E9$01$A0$00$91$A4$A5$A6$F0$07›$A5$A4$A6$A5$4C ValC $60]››PROC PrintD=*(BYTE d CARD s)›[$20 _CLREOL $4C _DOPRNT]››PROC PrintDE=*(BYTE d CARD s)›[$20 _SETEOL $4C _DOPRNT]››PROC InputMD=*(BYTE d CARD s BYTE l)›[$48$A9$00$85$A6$68$4C _DOINPT]››PROC InputSD=*(BYTE d CARD s)›[$48$A9$FF$85$A3$68$4C InputMD]››PROC Open=*(BYTE d CARD s BYTE m, a)›[$86$A1$20 _LODCHN $A5$A1$20› _STONAM $A5$A3$9D$4A$03$A5$A4$9D$4B›$03$A9$03$9D$42$03$20 _GOCIO $8A$4A›$4A$4A$4A$AA$A9$00$9D$C0$05$60]››PROC Close=*(BYTE d)›[$20 _LODCHN $A9$0C$9D$42$03$20›_GOCIO $60]››MODULE››; Pro Proc and Func definitions››Proc Statbox = $30ED ()›Proc Echo = $3200 (Byte a)›Proc EchoS = $3203 (Byte Array s)›Proc PrintS = $3206 (Byte Array s)›Proc Cr_Lf = $3209 ()›Proc Get_String = $320C (Byte Array s Byte maxlen, mas, allowreturn)›Proc MIOsuspend = $3212 ()›Proc MIOresume = $3218 ()›Byte Func Open_Ulog = $321B ()›Byte Func Close_Ulog = $321E ()›Byte Func Read_User = $3221 (card Usernumber)›Byte Func Ck_Range = $3227 (card Usernumber)›Proc Chain = $322A (Byte Array filename)›Proc Reset_BBS = $322D ()›Byte Func Get_Key = $3230 ()›Byte Func Get_byte = $3233 ()›Proc Carrier = $323C ()›Proc Sys_Error = $323F (Byte errnum)›Byte Func UpCase = $3242 (char c)›Byte Func Cmp_Str = $3248 (Byte array str1, str2)›Proc Move_Str = $324B (Byte Array Str1,Str2)›Proc EchoC = $325A (Card c)›Proc Datestamp = $325D ()›Byte Func Sec_Lvl = $3266 (Byte Pointer sl Byte level)›Card Func First_free = $3269 ()›Card Func Find_Handle = $326F (Byte Array handle)›Card Func Find_Name = $3272 (Byte Array Name)›Byte Func Y_or_N = $3275 ()›Proc Helpfile = $3278 (Byte Array filename)›Proc Checktime = $3281 ()›Proc EchoSE = $3284 (Byte Array S)›Proc EchoBE = $3287 (Byte b)›Proc File_stat = $32A2 (Byte Array Fn)›Proc Clr_Lvl = $32B1 (Byte Pointer sl Byte level)›Proc Set_Lvl = $32B4 (Byte Pointer sl Byte level)›Proc xx_Overlay = $32DE (Byte Array Fn)›Proc SavePageZero = $32E1 (Byte Array Hold)›Proc RestorePageZero = $32E4 (Byte Array Hold)››Proc Overlay (Byte Array Fn)› Byte Array Zero_Page(128)› SavePageZero(Zero_Page)› xx_Overlay(Fn)› RestorePageZero(Zero_Page)›Return›››; The Program!››Proc DatDrive()› If Header(7) > 0 and Header(7) < 10 then› Datadr = Header(7) % $30› Else› Datadr = S_Datadr› EndIf›Return››Subroutine Cfgerror()› Sysnews_send = 'Y› Logstat_send = 'Y› Send_prompts = 'Y› Move_Str("LOGIN",Chain_to)› Move_str("U.S.A.",Default_country)› Cfgerr = 1›Return››Subroutine Read_Cfg()› Error = Cfgerror› Cfgerr = 0› File_Stat(Cfgfile)› Open(2,Cfgfile,4,0)› If Cfgerr = 0 then› InputSD(2,Cfgstring)› InputSD(2,Default_country)› EndIf› Close(2)› If Cfgerr = 0 then› Sysnews_send = UpCase(Cfgstring(1))› Logstat_send = UpCase(Cfgstring(2))› Send_Prompts = UpCase(Cfgstring(3))› ScopyS(Chain_to,Cfgstring,5,12)› EndIf›Return››Subroutine Waitcall()› Chain("Waitcall")›Return››Subroutine Ulogerror()› MIOresume()› Sys_Error(x)›Return››Subroutine Move_tmp_to_active()›[$A2$0A$BD$00$34$9D$00$33$E8$D0$F7$60]››Subroutine Get_user_by_number()› MIOsuspend()› x = Open_Ulog()› If x > 1 then› Ulogerror()› EndIf› x = Read_User(Usernum)› If x > 1 then› Ulogerror()› EndIf› x = Close_Ulog()› If x > 1 then› Ulogerror()› EndIf› MIOresume()›Return››Subroutine Prompt()› EchoS("-->>>")›Return››Subroutine Report_blacklist()› If S_logdr > '0 then› File_stat(Logfile)› Open(2,Logfile,9,0)› PrintDE(2," ")› PrintDE(2," ")› PrintD(2,"B/listed User ")› PrintD(2,Cur_date)› PrintD(2," ")› PrintDE(2,Cur_time)› PrintD(2," ")› PrintD(2,U_handle)› PrintD(2," (#")› StrC(Usernum,Unumstr)› PrintD(2,Unumstr)› PrintDE(2,")")› Close(2)› EndIf›Return››Subroutine Report_Failure()› PrintDE(2," ")› PrintDE(2," ")› PrintD(2,"Failed Logon ")› PrintD(2,Cur_date)› PrintD(2," ")› PrintDE(2,Cur_time)›Return››Subroutine Bad_logon()› Cr_Lf()› EchoSE("Invalid user or pass!")› Failed = 1› If S_logdr > '0 then› File_stat(Logfile)› Open(2,Logfile,9,0)› Report_Failure()› PrintD(2," Attempted Name/Num : ")› PrintDE(2,UserID)› PrintD(2," Attempted Password : ")› PrintDE(2,Password)› Close(2)› EndIf›Return››Subroutine Translation()› U_Flags(0) = 12› If Trans > 0 then› Echo(125)› EchoSE(" Set non-ATASCII translation:")› Cr_Lf()› EchoSE(" 1] Standard ASCII")› EchoSE(" 2] ANSI Colour (IBM)")› EchoSE(" 3] VT52 Monochrome")› EchoSE(" 4] VT52 Colour")› Loop› Cr_Lf()› EchoS(" Choice: ")› x = Get_key()› Echo(x)› Cr_Lf()› Until x > '0 and x < '5› EndLoop› Trans = x - $30› EndIf›Return››Subroutine Secret(Byte Array xxx)› Byte ch› x = 1› Loop› ch = Get_key()› If ch = 126 and x > 1 then› x = x - 1› Echo(ch)› ElseIf ch = 155 and x > 1 then› x = x - 1› xxx(0) = x› Echo(ch)› ElseIf x < 16 and ch <> 155 and ch <> 126 then› xxx(x) = ch› Echo('%)› x = x + 1› EndIf› Until ch = 155› EndLoop›Return››Subroutine Logon()› Usernum = ValC(UserID)› Cr_Lf()› EchoS("Enter your password: ")› Secret(Password)› Cr_Lf()› EchoSE("Stand by - searching")› If (Usernum > 0 and Ck_Range(Usernum) = 0) or (Usernum > 0 and Usernum < 10) then› Failed = 1› Bad_Logon()› Else› If Usernum > 0 then› Get_user_by_number()› Else› Usernum = Find_Handle(UserID)› EndIf› Failed = 0› If Usernum = 0 or T_inuse = 0 then› Failed = 1› Bad_logon()› EndIf› If Failed = 0 then› If Cmp_Str(T_pword,Password) = 1 then› Failed = 1› Bad_logon()› EndIf› EndIf› If Failed = 0 then› If Sec_lvl(T_seclvl,32) then› Cr_Lf()› EchoS("Sysop Password: ")› Secret(Syspw)› If Cmp_Str(Syspw,S_secpw) = 1 then› If S_Logdr > '0 then› File_stat(Logfile)› Open(2,Logfile,9,0)› Report_Failure()› PrintD(2," ")› PrintD(2,T_handle)› PrintD(2," (#")› StrC(Usernum,Unumstr)› PrintD(2,Unumstr)› PrintDE(2,")")› PrintD(2," Sysop password attempted: ")› PrintDE(2,Syspw)› Close(2)› EndIf› Reset_BBS()› EndIf› EndIf› Move_tmp_to_active()› If U_tlday = 0 then› Report_blacklist()› Helpfile("Blaklist")› Reset_BBS()› EndIf› If Cmp_Str(Cur_date,U_lstcall) = 0 then› If U_mintoday > U_tlday then› EchoSE("You have already used up your time for\today. Call back tomorrow")› Reset_BBS()› EndIf› Else› U_mintoday = 0› EndIf› EndIf› EndIf›Return››Subroutine Normal_logon()› Translation()› Helpfile("Connect")› Cr_Lf()› Cr_Lf()› EchoS("ExpressNET (tm Orion Micro Systems)\Node X")› EchoC(S_node)› EchoSE(" on line")› EchoSE(S_nodename)› EchoSE(S_nodecity)› Cr_Lf()› Tries = 0› Loop› Failed = 0› Cr_Lf()› If N_tlcall = 0 then› EchoSE("New users are not being accepted on\this BBS at the moment.")› Else› EchoS("If you are a new user, enter ")› Echo(34)› EchoS("NEW")› Echo(34)› Cr_Lf()› EndIf› Cr_Lf()› EchoS("Enter your user number or your\alias : ")› Get_String(UserID,20,0,0)› If Cmp_str("OFF",UserID) = 0 then› Reset_BBS()› EndIf› If Cmp_str("NEW",UserID) = 0 then› If N_tlcall = 0 then› EchoSE("Sorry, but this bbs is not accepting\any new users at the moment.")› Reset_BBS()› Else› Move_Str(Default_country,Parm1)› Overlay("O_LOGON")› If Failed = 1 then› Reset_BBS()› EndIf› EndIf› Else› Logon()› Endif› Tries == +1› Until Failed = 0 or Tries = 3› EndLoop› If Failed = 1 then› Reset_BBS()› EndIf›Return››Proc Main()› DatDrive()› Logfile(2) = S_logdr› Cfgfile(2) = Datadr› BBS_active = $80› Datestamp()› u_vw = 40› min_conn = 0› Read_Cfg()› If Invoker = $F0 then› Usernum = 10› Get_user_by_number()› Move_tmp_to_active()› N_feedback = 0› N_uploads = 0› N_users = 0› ElseIf Invoker = $F1 then› Usernum = 11› Get_user_by_number()› Move_tmp_to_active()› ElseIf Invoker = $F2 then› Loop› Cr_Lf()› PrintS("Enter user alias: ")› Get_String(UserID,20,0,1)› If UserID(0) = 0 then› Waitcall()› EndIf› Usernum = Find_Handle(UserID)› If Usernum = 0 then› Cr_Lf()› EchoSE("Alias not found")› Else› Move_tmp_to_active()› EndIf› Until Usernum > 0› EndLoop› ElseIf Invoker = $F3 then› Loop› Cr_Lf()› PrintS("Enter user name: ")› Get_String(UserID,20,0,1)› If UserID(0) = 0 then› Waitcall()› EndIf› Usernum = Find_Name(UserID)› If Usernum = 0 then› Cr_Lf()› EchoSE("Name not found")› Else› Move_tmp_to_active()› EndIf› Until Usernum > 0› EndLoop› Else› Normal_logon()› EndIf› If Failed = 1 then› Reset_BBS()› EndIf› Checktime()› Statbox()› Compl_logon = $80› Free_time = 0› U_totcalls == +1› Lastread_work = U_lastread› Datestamp()› Move_str(Cur_date,Con_date)› Move_str(Cur_time,Con_time)› If Invoker < $F0 or Invoker > $F1 then› S_totcalls == +1› S_calltoday == +1› Helpfile("Welcome")› If Sysnews_send = 'Y then› Helpfile("Sysnews")› Cr_Lf()› If Send_prompts = 'Y then› EchoS("Hit a key -->")› x = Get_Key()› EndIf› EndIf› If Logstat_send = 'Y then› Helpfile("Logstat")› Cr_Lf()› If Send_prompts = 'Y then› EchoS("Hit a key -->")› x = Get_Key()› EndIf› EndIf› EndIf› Chain(Chain_to)›Return››