home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
PACKET
/
RLI120.ARK
/
LOGIN.MAC
< prev
next >
Wrap
Text File
|
1987-05-11
|
4KB
|
183 lines
; LOGIN.MAC - 5/11/87 - Log user onto system.
.z80
maclib TNC.LIB
entry login,motd,mbbsq
entry bbsa,bbsb,bbsl,illdig,excill,ndigia,ndigib,gm15
external getusr,usopt,ushbbs,iscall,ynbq
external usobbs,usoexp,usoloc,usosys,usoexa,usoexb
external mode,cmd,cmdlen,@prtx
external $memry,exclud,parse,flds,f3st,f3l
external @cmp,@mcmd,scall,mcall,newmsg,tnca,tncb,movcal
external log,logo,logtxt,llogtxt,event
tncdefs
asciictl
dseg
motd: ds 2 ; Address of message of the day
mbbsq: ds 2 ; Msg to ask for his home BBS
ndigia: ds 1
ndigib: ds 1
bbsa: ds 1
bbsb: ds 1
bbsl: ds 1
excill: ds 1
illdig: ds 1
ndigi: ds 1
start: ds 2
len: ds 1
f3ptr: ds 2
f3left: ds 1
gm15: ds 2
cseg
; If this digi call is illegal, Sorry Charlie.
ckildi: cmpm illdig,true ; Allow illegal digi call?
ret z ; Yes
; *** Temp at K1BC
ld hl, (start) ; Point at call of digi
comp ,refdig,6 ; The one causing digipeater disaster?
jp z, exclud ; If so, refuse connection.
; *** Temp at K1BC
ld de,($memry)
ld hl,(start)
ld a,(len)
call movcal
ld hl,($memry)
call iscall
jp c,exclud
ret
; Following patch is for a local problem at K1BC. You can put
; a callsign in here to prevent connects which digipeat to you
; via a particular digipeater. I had to do it to reduce the
; level of Digipeater Disaster on my 2-meter port.
refdig: db 'BADDIG' ; *** Temp at K1BC
; Check that user not using too many digipeats.
; If illegal digi calls exclude, check them.
ckdigi: call parse
ld a,(flds)
dec a ; Is a "VIA"?
ret z ; No, no digi
ld hl,(f3st)
ld (f3ptr),hl
ld (start),hl
movb f3left,f3l
xor a
ld (len),a
inc a
ld (ndigi),a ; Count the initial digi
ckdiga: ld hl,(f3ptr)
ld a,(hl) ; Get char
inc hl
ld (f3ptr),hl
cp ',' ; Is a comma?
jr nz,ckdigb ; No
ld hl,ndigi
inc (hl) ; Count the comma
call ckildi ; Illegal digi call?
movw start,f3ptr
mvim len,0
jr ckdigc
ckdigb: ld hl,len
inc (hl) ; Count char in this call
ckdigc: ld hl,f3left
dec (hl) ; More chars to check?
jr nz,ckdiga ; Yes
call ckildi ; Illegal digi call?
ld hl,ndigia
ld a,(iobyte)
cp raiob
jr z,ckdigd
ld hl,ndigib
ckdigd: ld a,(ndigi)
ld c,a
ld a,(hl)
cp c
jp c,exclud ; Too many digi
ret
; Log the user in.
; Call with (B)=TNC ID, user call and connect path in cmd.
login: mvim event,'C'
ld hl,logtxt
ld (hl),b ; TNC ID (A, B, L)
inc hl
ld (hl),' '
inc hl
movcmd ,0,llogtxt-3
ld (hl),cr
zmov scall,mcall,6 ; Save call adjacent bbs
ld de,mcall
ld hl,cmd
ld a,(cmdlen)
call movcal ; Save call of station that connected
mvim mode,umode ; Set user mode
call log ; Log the connect
cmpm excill,true ; Exclude illegal calls?
jr nz,logina ; No, allow anything
ld hl,mcall ; Point to call
call iscall ; Is it legal?
jp c,exclud ; No, Sorry Charlie
logina: call getusr ; Get user record in
ld a,(usopt)
and usobbs ; Is bbs?
ret nz ; Yes, can do lotsa things
ld a,(usopt)
and usosys ; Is sysop?
jp nz, cknewm ; Yes, tell if new mail, bypass checks.
ld a,(logtxt) ; TNC ID (A,B,L)
cp 'L' ; Linked?
jr z,loginl ; See if allowed
ld b,usoexa
cp 'A' ; On port A?
jr z,xx ; Yes
ld b,usoexb
xx: ld a,(usopt)
and b
jp nz,exclud ; Sorry Charlie
call ckdigi ; Check if too many digi
ld a,(usopt)
and usoloc ; Local user?
jr nz,loginc ; Yes, can connect if only bbs set
ld hl,bbsa ; Point to COMM port flag
cmpm iobyte,raiob ; On COMM port?
jr z,loginb ; Yes
ld hl,bbsb ; Point to PRINTER port flag
loginb: ld a,(hl) ; Get flag
call ynbq ; Only bbs this port at this time?
jp nz,exclud ; Sorry Charlie
loginc: ld hl,(motd)
ld a,(usopt)
and usoexp ; Expert user?
call z,@prtx ; Show msg of day if not
cknewm: ld a, (ushbbs) ; Do we know his home BBS?
cp ' '
ld hl, (mbbsq) ; If not, print msg requesting it
call z, @prtx
jp newmsg ; Show any new mail
loginl: ld a, (bbsl) ; BBS only on Links now?
call ynbq ; ..
jr z, loginm ; If so, see if it's an excluded guy
prtx gm15 ; If not, tell him so
jp exclud ; And flush the connection
loginm: ld a, (usopt) ; See if a bad guy
and usoexa+usoexb ; excluded on both ports?
xor usoexa+usoexb
jp z, exclud ; If so, don't let him on in a link
jr loginc ; OK, let him in
end