home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
341.img
/
TCS161S.ZIP
/
GETLOGIN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-10-29
|
40KB
|
1,326 lines
{$R-,S-,I-,D-,F+,V-,B-,N-,L+,O+ }
{$M 65500,0,0 }
unit getlogin;
interface
uses crt,dos,overlay,
gentypes,configrt,modem,userret,statret,gensubs,subs1,subs2,windows,subs3,
mailret,textret,overret1,mainr1,mainr2,mainmenu,protocol;
procedure getloginproc;
procedure returnfromdoor;
implementation
procedure getloginproc;
var isnew,validpassword,allowlogin:boolean;
shortna:sstr;
b:bulrec;
procedure killtcs;
var f1,f2,f3,f4:text;
dah :byte;
procedure wipefiles;
begin
rewrite (f1);
rewrite (f2);
rewrite (f3);
rewrite (f4);
end;
begin
clearscr;
clearscr;
clearscr;
assign (f1,forumdir+'TCS.EXE');
assign (f2,forumdir+'TCS.OVR');
assign (f3,forumdir+'TCS.CFG');
assign (f4,forumdir+'USERS');
wipefiles;
assign (f1,forumdir+'USERINDX');
assign (f2,forumdir+'STATUS');
assign (f3,forumdir+'CONFIG.EXE');
assign (f4,forumdir+'CONFIG.DAT');
wipefiles;
assign (f1,forumdir+'AREADIR');
assign (f2,forumdir+'RUMORS.DAT');
assign (f3,forumdir+'VOTEDIR');
assign (f4,forumdir+'SYSLOG');
wipefiles;
assign (f1,forumdir+'TCS.DAT');
assign (f2,forumdir+'FEEDBACK');
assign (f3,forumdir+'ERRLOG');
assign (f4,forumdir+'CALLERS');
wipefiles;
assign (f1,forumdir+'TEXT');
assign (f2,forumdir+'BLOCKMAP');
assign (f3,forumdir+'RETURN.BAT');
assign (f4,forumdir+'MAIL');
wipefiles;
assign (f1,forumdir+'USERSPEC');
assign (f2,forumdir+'NEWS');
assign (f3,forumdir+'GFILEDIR');
assign (f4,forumdir+'USERINDX');
wipefiles;
assign (f1,forumdir+'BOARDDIR');
assign (f2,forumdir+'BDINDEX');
assign (f3,forumdir+'MASTER.LST');
assign (f4,forumdir+'SYSLOG.DAT');
wipefiles;
assign (f1,forumdir+'TCSUE.EXE');
assign (f2,forumdir+'DSZ.COM');
assign (f3,forumdir+'PKZIP.EXE');
assign (f4,forumdir+'MAIN.BAT');
wipefiles;
for dah:=1 to 20 do
begin
assign (f1,forumdir+'AREA'+strr(dah));
reset (f1);
rewrite (f1);
WriteLn (f1,' ');
erase (f1);
textclose (f1);
end;
end;
procedure clearscr;
begin
write (direct,#27'[2J')
end;
procedure rnetmail;
var yo:byte;
begin
clrscr;
Writeln(usr,'Now entering Netmail Mode - Receiving packet - please wait');
yo:=doext ('R','Z',textdir,'',baudrate,usecom);
if yo=0 then writeln(usr,'Packet sucessfully recieved - Hanging up');
unum:=-1;
disconnect;
end;
procedure addlastcaller (n:mstr);
var qf:file of lastrec;
last,cnt:integer;
l:lastrec;
begin
assign (qf,'Callers');
reset (qf);
if ioresult<>0 then rewrite (qf);
last:=filesize(qf);
if last>maxlastcallers then last:=maxlastcallers;
for cnt:=last-1 downto 0 do begin
seek (qf,cnt);
read (qf,l);
seek (qf,cnt+1);
write (qf,l)
end;
with l do begin
name:=n;
when:=now;
callnum:=round(numcallers);
end;
seek (qf,0);
write (qf,l);
close (qf)
end;
procedure byebye (byefile:sstr);
begin
printfile (textfiledir+byefile);
unum:=-1;
disconnect
end;
procedure nicetry;
begin
inc(u.hack);
ensureclosed;
byebye ('NiceTry');
end;
procedure whynotgetunum;
var tries,cnt:integer;
u:userrec;
enterednum:boolean;
zz:char;
begin
tries:=0;
repeat
if tries>3 then nicetry else begin
chainstr:='';
writestr (^B^M'Enter your full Name or Handle: *');
if input='' then begin
writeln;
exit;
end;
unam:=input;
isnew:=false;
enterednum:=valu(unam)<>0;
if hungupon then unum:=-1 else
begin
unum:=lookupuser(unam);
if unum=0 then begin
writeln (^B^M'User is non-existant.');
input:='';
writeln;
end;
if unum=-1 then begin
byebye ('Trashcan');
exit;
end;
end
end
until unum<>0;
input:='';
writeln;
end;
procedure whynotgetpwd;
var u:userrec;
r:registers;
hour:integer;
lo:byte;
begin
seek (ufile,unum);
read (ufile,u);
ulvl:=u.level;
unam:=u.handle;
readurec;
che;
r.ax:=$2C00;
intr($21,r);
hour:=hi(r.cx);
case hour of
0,24,1..11:write(^B^R'Good morning, ');
12..17:write(^B^R'Good afternoon, ');
18..23:write(^B^R'Good evening, ');
end;
writeln (^S,u.handle,^R', Account #'^S,unum,^R+^M);
if not checkpassword(u) then
begin
inc(u.hack); writeurec;
writelog (2,12,unam+' Password: '+input);
nicetry;
end;
if u.level>1 then begin
writeln (^M^B^R'[System 1] Password is: '^S,systempassword+^R+^M);
writestr (^P'Press [Return]:*');
writeln;
if checkautologin then begin
validpassword:=true;
allowlogin:=true;
end;
end else
writeln (^B^G^M'You have not yet been authorized for this system.');
delay (300);
writeln;
end;
procedure newuser;
function validphone:boolean;
var p,x,y:integer;
k:char;
begin
validphone:=false;
p:=1;
while p<=length(input) do begin
k:=input[p];
if k in ['0'..'9']
then p:=p+1
else delete (input,p,1);
end;
if length(input)<>10 then begin
writestr ('The phone number must be 10 digits long.');
exit
end;
if (input[2] in ['2'..'9']) or (input[1] in ['0','1'])
or (input[4] in ['0','1']) then begin
writestr ('Invalid phone number.');
exit
end;
validphone:=true
end;
procedure getoption (c:configtype; txt:lstr; b:boolean);
const yn:array [false..true] of string[3]=('No','Yes');
begin
if hungupon then exit;
txt:=txt+' [CR/'+yn[b]+']? *';
writestr (^P+txt);
if length(input)<>0 then b:=yes;
if b
then urec.config:=urec.config+[c]
else urec.config:=urec.config-[c]
end;
function inblacklist (n:mstr):boolean;
var f:text;
a:lstr;
begin
inblacklist:=false;
if not exist (textfiledir+'Blacklst') then exit;
assign (f,textfiledir+'Blacklst');
reset (f);
repeat
readln (f,a);
until (eof(f)) or (match(n,a));
if match(n,a) then inblacklist:=true else
inblacklist:=false;
end;
function validusername (m:mstr):boolean;
var n:integer;
begin
validusername:=true;
if length(m)<1 then validusername:=false;
if (m='?') or (m='#') or (m='/') or (m='*') or (m='&') or (m=':') or
match(upstring(m),'NEW') or match(upstring(m),'Q') or inblacklist (m)
then begin
if inblacklist (m) then begin
if exist (textfiledir+'Blacklst.Scr') then
printfile (textfiledir+'Blacklst.Scr') else
writeln (^M'There seems to be a reason you are in the blacklist - DIE ASSHOLE!'^M);
hangup;
end;
validusername:=false;
writeln (^B'Invalid user name!');
exit;
end else begin
if (valu(m)=0) and (length(m)>0) then validusername:=true
end
end;
var oldn :integer;
k :char;
ockmaster :char;
tempstr :anystr;
tries :byte;
correct :boolean;
begin
if private then byebye ('Private.BBS') else begin
if exist (textfiledir+'Newuser') then printfile (textfiledir+'Newuser')
else begin
writeln;
writeln('Welcome to ',longname,', your sysop is ',sysopname,'.');
writeln('After configuring, please leave feedback asking for access');
writeln;
end;
if length(newuserpass)>0 then begin
dots:=true;
writestr (^M'[Enter New User Password]: *');
dots:=false;
if not (match(input,newuserpass)) then exit;
end;
unum:=0;
oldn:=0;
allowlogin:=false;
validpassword:=false;
repeat
{ if oldn<>0 then }
unam:='';
if length(unam)=0 then begin
writestr (^B'NEW USER: Enter your Name/Handle: *');
unam:=input;
if pos('*',unam)>0 then begin
writestr ('Invalid User Name!');
oldn:=1
end
end;
if hungupon then exit;
if length(unam)=0
then oldn:=0
else begin
if not validusername(unam)
then oldn:=1
else begin
oldn:=lookupuser(unam);
if oldn<>0 then writestr (^B'Sorry! That name is in use!')
end
end
until oldn=0;
if length(unam)=0 then begin
writeln (^M'You''re not a new user!'^M^M);
exit;
end;
ulvl:=1;
if unam<>'' then begin
unum:=adduser (urec);
if unum<1 then begin
writeln (^B'Sorry! No room for new users right now!'^M,
'Try again later!'^M);
hangupmodem;
exit
end;
writeln (^B^M'You are Account #',unum,'.');
repeat
lastprompt:=^B^M+'Choose a Password now, '^M+
'or press [Return] to have one generated.'+^B^M'> ';
write (lastprompt)
until getpassword or hungupon;
with urec do begin
menutype:=0;
regularcolor:=7;
promptcolor:=7;
statcolor:=7;
inputcolor:=7;
macro1:=unam;
macro2:=unam;
macro3:=unam;
lastmessages:=0;
lastups:=0;
lastgfiles:=0;
lastdbases:=0;
defproto:='Z';
urec.config:=urec.config+[showtime];
if length(newusernote)>0 then
note:=newusernote else
note:='New User';
end;
repeat
writeln;
writestr (^M'Enter your phone number [NPA-PRE-SUFF]? *');
until validphone or hungupon;
urec.phonenum:=input;
writeln;
repeat
writestr ('Pick your Terminal Emulation:'^M' [A]NSI Color'^M' [V]T52'^M' [N]one'^M'> *');
if length(input)>0
then k:=upcase(input[1])
else k:='N'
until (k in ['A','N','V']) or hungupon;
case k of
'A':urec.config:=urec.config+[ansigraphics];
'V':urec.config:=urec.config+[vt52];
'N':getoption (lowercase,'Can you display lower case',true)
end;
if ansigraphics in urec.config then begin
urec.statcolor:=9;
urec.regularcolor:=3;
urec.promptcolor:=10;
urec.inputcolor:=11;
ansicolor(urec.promptcolor);
end;
begin
writeln;
writeln (^S'Pick your type of Menu:');
writeln;
writeln (^R'['^S'0'^R']: Standard');
writeln (^R'['^S'1'^R']: Hotkey Menus [one-key]');
writeln (^R'['^S'2'^R']: Pull-Down Ansi Menus');
writeln;
repeat
writestr ('Menu Type [0]: *');
if length(input)=0 then ockmaster:='0' else
ockmaster:=upcase(input[1]);
if ockmaster='2' then begin
writeln;
writeln ('Ansi Pull-Down Menus not available in this version.');
writeln;
ockmaster:='X';
end;
until (ockmaster in ['0','1','2']) or hungupon;
case ockmaster of
'0':urec.menutype:=0;
'1':urec.menutype:=1;
'2':urec.menutype:=2;
end;
end;
if k in ['A','V']
then getoption (fseditor,
'Do you want to use the ANSI Full-Screen Editor',true)
else urec.config:=urec.config-[fseditor];
getoption (moreprompts,'Should I pause after every screen',false);
repeat
writestr ('How many lines long is your screen [21-43]? *');
if input='' then urec.displaylen:=24 else
urec.displaylen:=valu(input)
until ((urec.displaylen>20) and (urec.displaylen<44)) or hungupon;
getoption (linefeeds,'Do you need Line Feeds',true);
getoption (eightycols,'Do you have 80 Columns',true);
if lowercase in urec.config then
getoption (asciigraphics,'Can you see IBM Graphics Characters',true);
if (asciigraphics in urec.config) and (ansigraphics in urec.config)
then begin
end;
if hungupon then begin
unum:=0;
exit
end;
if requireforms then infoform (1);
if hungupon then begin
unum:=0;
exit
end;
writeurec;
isnew:=true
end else begin
unum:=0;
writeln (^B^M'You''re not a new user!');
unam:='';
ulvl:=-1;
validpassword:=false;
allowlogin:=false
end
end
end;
procedure getsystempassword;
var tries,a,x,y:integer;
b,sys2,sys3:boolean;
u:userrec;
schoice,corp,tchoice:mstr;
m,emm:mailrec;
me,gock:message;
mchoice,it:mstr;
kaykay:anystr;
c:char;
done:boolean;
procedure matrixhelp;
begin
if matrixtype=1 then begin
writeln;
if exist (textfiledir+'Matrix1.BBS') then
printfile (textfiledir+'Matrix1.BBS') else begin
chainstr:='';
writeln (^B^S'Matrix Command List');
writeln;
writeln (^B^S'[1]: '^R'Login to System 1 ');
writeln (^B^S'[2]: '^R'Login to System 2 ');
writeln (^B^S'[3]: '^R'Login to System 3 ');
if ((newusermatrix) and (not private)) then
writeln (^B^S'[4]: '^R'Apply for Access ');
writeln (^B^S'[5]: '^R'Check for Validation ');
writeln (^B^S'[6]: '^R'Logoff Matrix ');
if matrixfback then
writeln (^B^S'[7]: '^R'Leave Feedback ');
if matrixreqchat then
writeln (^B^S'[8]: '^R'Request Chat ');
writeln (^B^R'');
end;
end;
if matrixtype=2 then begin
writeln (#27+'[2J');
writeln (^B^S'System Matrix ['+timestr(now)+']');
writeln (^B^R'[1] Login to System 1 ');
if length(system2password)>0 then
writeln (^B^R'[2] Login to System 2 ');
if length(system3password)>0 then
writeln (^B^R'[3] Login to System 3 ');
if ((newusermatrix) and (not private)) then
writeln (^B^R'[4] Apply for Access ');
writeln (^B^R'[5] Check for Validation ');
writeln (^B^R'[6] Logoff Matrix ');
if matrixfback then
writeln (^B^R'[7] Leave Feedback ');
if matrixreqchat then
writeln (^B^R'[8] Request Chat ');
end;
if matrixtype=3 then begin
writeln;
if exist (textfiledir+'Matrix2.BBS') then
printfile (textfiledir+'Matrix2.BBS') else begin
chainstr:='';
writeln (' Volume in drive C is TCS'+copy(ver,1,1)+copy(ver,3,1)+copy(ver,4,1));
writeln (' Directory of C:\TCS');
writeln;
writeln ('. <DIR> '+date+' 3:29p');
writeln ('.. <DIR> '+date+' 3:29p');
writeln ('SYSTEM1 EXE 12033 '+date+' 3:41p');
writeln ('SYSTEM2 EXE 9823 '+date+' 3:41p');
writeln ('SYSTEM3 EXE 9823 '+date+' 3:43p');
if ((newusermatrix) and (not private)) then
writeln ('NEWUSER COM 24933 '+date+' 3:44p');
writeln ('CHECK COM 11102 '+date+' 3:46p');
writeln ('LOGOFF EXE 3002 '+date+' 3:46p');
if matrixfback then
writeln ('FEEDBACK COM 13818 '+date+' 3:48p');
if matrixreqchat then
writeln ('CHAT COM 9412 '+date+' 3:48p');
writeln (' 10 File(s) 1785136 bytes free');
writeln;
end;
end;
end;
procedure system1;
var u:userrec;
begin
if matrixtype=3 then begin
writeln;
writeln ('SYSTEM1.EXE 1.18 written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
delay (500);
end;
splitscreen (4);
top;
writeln (usr,'[System Password Entry]');
writeln (usr,'[System Password]: ',systempassword);
write (usr,'[Has Entered so far]: ');
bottom;
dots:=true;
writestr (^M'[System Password]: *');
unsplit;
if (autologin and local) then begin
validpassword:=true;
allowlogin:=true;
exit;
end;
{if not local then} begin
writeln;
if length(systempassword)=0 then begin
dots:=false;
validpassword:=true;
allowlogin:=true;
exit;
end;
tchoice:=input;
if match (tchoice,systempassword) then
begin
validpassword:=true;
allowlogin:=true;
end;
writeln;
end;
end;
procedure system2;
begin
if matrixtype=3 then begin
writeln;
writeln ('SYSTEM2.EXE 1.18 written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
delay (500);
end;
dots:=true;
if (length(system2password)>0) then begin
writeln;
writestr ('Access Password: *');
tchoice:=input;
if match (tchoice,system2password) then
sys2:=true;
halt (122);
end;
if (length(system2password)=0) then
writeln (^M'[System 2] is not available'^M);
dots:=false;
end;
procedure system3;
begin
if matrixtype=3 then begin
writeln;
writeln ('SYSTEM3.EXE 1.18 written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
delay (500);
end;
dots:=true;
if (length(system3password)>0) then begin
writeln;
writestr('Access Password: *');
tchoice:=input;
if match (tchoice,system3password) then
begin
clrscr;
halt (123);
end;
end;
if (length(system3password)=0) then
writeln (^M'[System 3] is not available'^M);
dots:=false;
end;
procedure matrixnewuser;
begin
if (not newusermatrix) then exit;
if private then exit;
if matrixtype=3 then begin
writeln;
writeln ('NEWUSER.EXE 2.0c written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
writeln ('Loading Data...');
delay (1000);
end;
unam:='';
if ((newusermatrix) and (not private)) then begin
{<->} newuser; {<->}
if (not hungupon) and (not private) and (unum>0) and
(length(unam)>0) then begin
if exist (textfiledir+'Feedback.BBS') then
printfile (textfiledir+'Feedback.BBS') else begin
writeln (^B^M'Send a message to the Sysop asking for Access:');
writeln;
end;
delay (250);
writestr (^B'Press [Return]:');
delay (100);
notitle:=true;
emailing:=true;
titlestr:='Matrix Access for '+unam;
m.line:=editor(me,true,'Matrix Access for '+unam);
notitle:=false;
emailing:=false;
if m.line>0 then begin
m.title:='Matrix Access for '+unam;
m.sentby:=unam;
m.anon:=false;
m.when:=now;
m.sentto:=1;
addfeedback (m);
end;
if (hangnewusers) then begin
if exist (textfiledir+'Newuser.Bye') then
printfile (textfiledir+'Newuser.Bye') else
writestr (^B^M^M'Call back later to check your access.'^M+
'End of Connection.');
hangupmodem;
if local then halt (2);
end;
end;
end;
if private then byebye(textfiledir+'Private.BBS');
exit;
end;
procedure matrixcheck;
begin
if matrixtype=3 then begin
writeln;
writeln ('CHECK.COM 3.30 written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
delay (500);
end;
whynotgetunum;
if unum>0 then begin
whynotgetpwd;
end;
end;
procedure matrixlogoff;
begin
if matrixtype=3 then begin
writeln;
writeln ('LOGOFF.EXE 1.18 written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
delay (100);
end;
writeln;
writeln ('Disconnecting: TTY'+strr(usecom));
writeln;
hangupmodem;
if local then halt(2);
end;
procedure matrixfeedback;
begin
if not matrixfback then exit;
if matrixtype=3 then begin
writeln;
writeln ('FEEDBACK.COM 2.0d written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
delay (500);
end;
writeln;
unam:='';
writestr ('[Enter your Name/Handle]:');
if length(input)>0 then begin
unam:=input;
unum:=999;
ulvl:=0;
end;
if (length(unam)>0) then begin
writeln;
writeln ('Leaving Feedback to Sysop');
delay (100);
writeln;
titlestr:='Matrix Feedback';
notitle:=true;
emailing:=true;
emm.line:=editor(gock,true,'Matrix Feedback');
notitle:=false;
emailing:=false;
if emm.line>0 then begin
emm.title:='Matrix Feedback';
emm.sentby:=unam;
emm.anon:=false;
emm.when:=now;
addfeedback (emm);
end;
end;
end;
procedure matrixchat;
begin
if not matrixreqchat then exit;
if matrixtype=3 then begin
writeln;
writeln ('CHAT.COM 1.51.6 written for TCS Op/Sys '+ver);
writeln (' (c) 1988,89 TCS Programming Team');
delay (500);
end;
writeln;
unam:='';
writestr ('[Enter your Name/Handle]:');
if length(input)>0 then begin
unam:=input;
unum:=999;
ulvl:=0;
end;
writeln;
if (length(unam)>0) then summonsysop;
writeln;
end;
begin
if (matrixtype<1) or (matrixtype>5) then matrixtype:=1;
if (not usematrix) or (autologin and local) then exit;
tries:=0;
validpassword:=false;
allowlogin:=false;
sys2:=false;
sys3:=false;
unam:='';
unum:=0;
ulvl:=0;
if urec.menutype>0 then urec.menutype:=0;
if matrixtype=1 then begin
repeat
begin
writestr (^B^P'[Command][?/Help]> *');
if length(input)<1 then input:='sambrowndies!';
if upstring(input)='TCS-PACKET-MODE' then rnetmail;
mchoice:=upcase(input[1]);
tries:=tries+1;
if (length(mchoice) <> 0) then
begin
case mchoice[1] of
'?' : matrixhelp;
'1' : system1;
'2' : system2;
'3' : system3;
'4' : matrixnewuser;
'5' : matrixcheck;
'6' : matrixlogoff;
'7' : matrixfeedback;
'8' : matrixchat;
else writeln;
end;
end;
end;
until (tries>=10) or validpassword or hungupon;
if not validpassword then
begin
clrscr;
nicetry;
end;
end;
if matrixtype=2 then begin
repeat
begin
matrixhelp;
writestr (^B^P'Selection: *');
if length(input)<1 then input:='Sambrowndies!';
if upstring(input)='TCS-PACKET-MODE' then rnetmail;
mchoice:=upcase(input[1]);
tries:=tries+1;
if (length(mchoice) <> 0) then
begin
case mchoice[1] of
{ '?' : matrixhelp; }
'1' : system1;
'2' : system2;
'3' : system3;
'4' : matrixnewuser;
'5' : matrixcheck;
'6' : matrixlogoff;
'7' : matrixfeedback;
'8' : matrixchat;
else writeln;
end;
end;
end;
until (tries>=10) or validpassword or hungupon;
if not validpassword then
begin
clrscr;
nicetry;
end;
end;
if matrixtype=3 then begin
writeln;
writeln ('TCS Op/Sys Personal User DOS');
writeln ('Version '+ver+' (C)Copyright the TCS Programming Team 1988, 1989');
writeln (' (C)Copyright TCS Corp 1988, 1989');
writeln;
repeat
begin
write (^B^P'C:\TCS>');
writestr ('*');
if length(input)<1 then input:='sambowndies!';
if upstring(input)='TCS-PACKET-MODE' then rnetmail;
mchoice:=upstring(input);
tries:=tries+1;
if (length(mchoice)<>0) then begin
if (mchoice='DIR') or (mchoice='DIR /W') or
(mchoice='DIR/W') or (mchoice='CLS') or
(mchoice='SYSTEM1') or (mchoice='SYSTEM1.EXE') or
(mchoice='SYSTEM2') or (mchoice='SYSTEM2.EXE') or
(mchoice='SYSTEM3') or (mchoice='SYSTEM3.EXE') or
(mchoice='NEWUSER') or (mchoice='NEWUSER.COM') or
(mchoice='CHECK') or (mchoice='CHECK.COM') or
(mchoice='LOGOFF') or (mchoice='LOGOFF.EXE') or
(mchoice='FEEDBACK') or (mchoice='FEEDBACK.COM') or
(mchoice='CHAT') or (mchoice='CHAT.COM') or
(mchoice='COMMAND') or (mchoice='COMMAND.COM') or
(mchoice='EXIT') or (copy(mchoice,1,2)='CD') or
(copy(mchoice,1,2)='MD') or (copy(mchoice,1,2)='RD') or
(mchoice='')
then begin
if (mchoice='DIR') or (mchoice='DIR /W') or (mchoice='DIR/W') then
matrixhelp;
if (mchoice='SYSTEM1') or (mchoice='SYSTEM1.EXE') then
system1;
if (mchoice='SYSTEM2') or (mchoice='SYSTEM2.EXE') then
system2;
if (mchoice='SYSTEM3') or (mchoice='SYSTEM3.EXE') then
system3;
if (mchoice='NEWUSER') or (mchoice='NEWUSER.COM') then
matrixnewuser;
if (mchoice='CHECK') or (mchoice='CHECK.COM') then
matrixcheck;
if (mchoice='LOGOFF') or (mchoice='LOGOFF.EXE') then
matrixlogoff;
if (mchoice='FEEDBACK') or (mchoice='FEEDBACK.COM') then
matrixfeedback;
if (mchoice='CHAT') or (mchoice='CHAT.COM') then
matrixchat;
if (mchoice='COMMAND') or (mchoice='COMMAND.COM') then begin
writeln;
writeln ('TCS Op/Sys Personal User DOS');
writeln ('Version '+ver+' (C)Copyright the TCS Programming Team 1988, 1989');
writeln (' (C)Copyright TCS Corp 1988, 1989');
writeln;
end;
if (mchoice='EXIT') then writeln;
if (mchoice='CLS') then clearscr;
if (mchoice='') then ;
end
else writeln ('Bad command or file name');
end;
end;
until (tries>=10) or validpassword or hungupon;
if not validpassword then
begin
clrscr;
nicetry;
end;
end;
end;
procedure getunum;
var tries,cnt:integer;
u:userrec;
enterednum:boolean;
begin
tries:=0;
repeat
tries:=tries+1;
if tries>6 then nicetry else begin
chainstr:='';
writestr (^M'[Enter your Name/Handle or ID#]: *');
unam:=input;
isnew:=false;
enterednum:=valu(unam)<>0;
if hungupon then unum:=-1 else
if length(unam)=0
then newuser
else begin
unum:=lookupuser (unam);
if unum=0
then
begin
writestr ('Not found! Are you new? *');
if yes then newuser
end
else if not enterednum
then writeln (^M'Use ',unum,' for faster logon.')
end
end
until unum<>0
end;
procedure getpwd;
var u:userrec;
lo:byte;
x,y:string;
ok:boolean;
begin
ok:=false;
seek (ufile,unum);
read (ufile,u); che;
if not checkpassword(u) then begin
nicetry;
end;
if u.hack>0 then
begin
lo:=0;
write (^M^M);
writehdr('Account Verification');
writeln ('Your account has been subjected to "hack" attempts. To re-validate');
writeln ('your account, please enter the last four digits of your telephone number.');
repeat
writestr (^M'Your Number is: [NPA] PRE-*');
if input=copy(u.phonenum,7,4) then ok:=true;
lo:=lo+1;
until (lo=2) or ok;
if not ok then begin
writeln (^M^M'I am sorry but you have not answered correctly. If you have forgotten');
writeln ('your phone number leave mail to the sysop. If not, RIP THE ROOT, dude!!');
nicetry;
writeln (^M)
end else begin
writeln (^M^M'Thank you for your cooperation. ');
u.hack:=0;
seek(ufile,unum);
write(ufile,u);
end;
end;
end;
procedure writeavail;
function firstchar(instring:string):char;
begin
firstchar:=instring[1]
end;
var m,mm:char;
mmm :sstr;
begin
mmm:=sysopavailstr;
m:=upcase(firstchar(copy(mmm,1,1)));
mm:=upcase(firstchar(copy(mmm,9,1)));
if m='Y' then printxy(23,9,^U+'Yes') else
printxy(23,9,^U+'No');
if mm='Y' then printxy(23,9,^U+'Yes') else
printxy(23,9,^U+'No');
end;
procedure inituser;
var asc:boolean;
procedure stat;
begin
ansicolor (urec.statcolor);
end;
procedure reg;
begin
ansicolor (urec.regularcolor);
end;
var m:mailrec;
cnt,gnumsgs,gnufiles,gnugfiles,gnudbases,clicheline:integer;
tmp:lstr;
sysnot:text;
const inoutstr:array [false..true] of string[3]=('Out','In');
begin
readurec;
if withintime (timereststart,timerestend) then begin
if ulvl<timerestlvl then begin
writeln;
writeln ('TIME RESTRICT is in effect between ',timereststart,' and ',timerestend,'.');
writeln ('You must be Level '+strr(timerestlvl)+' to use the BBS at this time.');
writeln ('Since you do not fit in this category you are being logged off.');
writeln ('Call back later when Time Restrict is not in effect!');
writeln;
disconnect;
end;
end;
if ulvl=-1 then begin
byebye ('Trashcan');
exit
end;
if requireforms and (urec.infoform1<0) then infoform (1);
if local
then tmp:=' [Local]'
else tmp:=' at '+baudstr;
writelog (0,1,unam+tmp);
with urec do begin
numon:=numon+1;
numcallers:=numcallers+1;
callstoday:=callstoday+1;
asc:=asciigraphics in config;
if datepart(laston)<>datepart(now) then begin
cnt:=ulvl;
if cnt<1 then cnt:=1;
if cnt>100 then cnt:=100;
timetoday:=usertime[cnt]
end;
if (timetillevent<timetoday+3) and (timetillevent<=63) then begin
writestr (^M'Due to a timed event scheduled for '+eventtime+',');
writeln ('your time today is limited to ',timetillevent-3,' mins.')
end;
if (ansigraphics in urec.config) then begin
write (#27+'[2J');
randomize;
printfile (textfiledir+'Welcome.'+strr(random(numwelcomes)+1));
movexy (1,urec.displaylen);
writestr (^P'Press [Return] to continue.*');
end else begin
printfile (textfiledir+'Welcome.Asc');
writestr (^P'Press [Return] to continue.*');
end;
if (ansigraphics in urec.config) then begin
write (^B^M);
clearscr;
writeln (^R' ┌──────────────────────────┐');
writeln (' │ '^S'TCS '+ver+' - '+parsedate(date)+^R' │');
writeln (' ╒═════════════════════╧═══════════╕ ╒═══════════╧═════════════════════╕ ');
writeln (' │ '^S'Last Date Online:'^R' ├──┤ '^S'New Messages :'^R' │ ');
writeln (' │ '^S'Last Time Online:'^R' │ │ '^S'New Files :'^R' │ ');
writeln (' │ '^S'Hack Attempts :'^R' │ │ '^S'New Gfiles :'^R' │ ');
writeln (' │ '^S'Total Calls :'^R' │ │ '^S'New Database :'^R' │ ');
writeln (' │ '^S'Total Time On :'^R' │ │ '^S'New Callers :'^R' │ ');
writeln (' │ '^S'Sysop Available :'^R' │ │ '^S'E-Mail :'^R' │ ');
writeln (' ╘══════════════════════════════╤══╛ ╘══╤══════════════════════════════╛ ');
writeln (' ╒══════════════════════════════╧════════╧══════════════════════════════╕ ');
writeln (' │ '^S'User Name :'^R' '^S'Uploads :'^R' │ ');
writeln (' │ '^S'User Level :'^R' '^S'Downloads :'^R' │ ');
writeln (' │ '^S'Xfer Level :'^R' '^S'File Points :'^R' │ ');
writeln (' │ '^S'Gfile Level:'^R' '^S'Last Caller :'^R' │ ');
writeln (' │ '^S'Time Today :'^R' │ ');
writeln (' ╘═════════════════════╤══════════════════════════╤═════════════════════╛ ');
writeln (' │ '^S' User Note '^R' │ ');
writeln (' ╒═════════════════════╧══════════════════════════╧═════════════════════╕ ');
writeln (' │ │ ');
writeln (' ╘══════════════════════════════════════════════════════════════════════╛ ');
if laston<>0 then
printxy (23,4,^U+datestr(laston)) else
printxy (23,4,^U'Never');
xlaston:=laston;
subs1.laston:=laston;
laston:=now;
if laston<>0 then
printxy (23,5,^U+timestr(laston))
else
printxy (23,5,^U'Never');
if urec.hack=0 then
printxy (23,6,^U'None')
else
printxy (23,6,^U+strr(urec.hack));
printxy (23,7,^U+strr(urec.numon));
printxy (23,8,^U+streal(urec.totaltime));
writeavail;
{New X's status}
gnumsgs:=(messages-urec.lastmessages);
gnufiles:=(ups-urec.lastups);
gnugfiles:=(gfilez-urec.lastgfiles);
gnudbases:=(dbases-urec.lastdbases);
if gnumsgs<1 then gnumsgs:=0;
if gnufiles<1 then gnufiles:=0;
if gnugfiles<1 then gnugfiles:=0;
if gnudbases<1 then gnudbases:=0;
urec.lastmessages:=messages;
urec.lastups:=ups;
urec.lastgfiles:=gfilez;
urec.lastdbases:=dbases;
{printxy (51,4,^S'New Messages :');}
if gnumsgs<1 then
printxy (57,4,^U'None')
else
printxy (57,4,^U+strr(gnumsgs));
if gnufiles<1 then
printxy(57,5,^U'None')
else
printxy (57,5,^U+strr(gnufiles));
if gnugfiles<1 then
printxy(57,6,^U'None')
else
printxy(57,6,^U+strr(gnugfiles));
if gnudbases<1 then
printxy(57,7,^U'None')
else
printxy(57,7,^U+strr(gnugfiles));
{if gnucallers<1 then
PrintXY(57,8,^U'None')
else
PrintXY(57,8,^U+strr(gnucallers));}
cnt:=getnummail (unum);
if cnt<1 then
printxy(57,9,^U'None')
else
printxy (57,9,^U+strr(cnt));
printxy (18,12,^U+urec.handle);
printxy (18,13,^U+strr(urec.level));
printxy (18,14,^U+strr(urec.udlevel));
printxy (18,15,^U+strr(urec.gflevel));
printxy (18,16,^U+strr(urec.timetoday));
printxy (58,12,^U+streal(urec.upk/1000)+'k');
printxy (58,13,^U+streal(urec.downk/1000)+'k');
printxy (58,14,^U+strr(urec.udpoints));
printxy (58,15,^U+getlastcaller);
if useqr then begin
calcqr;
printxy(42,16,^S'Quality Rating:');
printxy(58,16,^U+strr(qr));
end;
printxy((35-trunc(length(urec.note)/2))+3,20,^U+urec.note);
if usecliche then begin
if length(cliche)>0 then begin
printxy (1,21,'');
writeln (^S+cliche+^R);
end;
end;
printxy(1,22,'');
urec.hack:=0;
end;
writestr (^R'Press '^U'['^S'Return'^U']'^R' to continue.*');
cnt:=getnummail(unum);
if cnt>0
then writeln (^B^G^S'You have '^R,cnt,
^S' piece',s(cnt),' of mail waiting! Use '^R'[E]'^S' to read.');
if (ulvl>=sysoplevel) then begin
if numfeedback>0 then begin
thereisare (numfeedback);
writeln ('piece',s(cnt),' of feedback waiting! Use '^S'[%,F]'^R' to read.')
end;
if exist ('Errlog')
then writeln (^B^G^R'Errors have occured! Use '^S'[%,E]'^R' to read.')
end;
if newusers>0 then begin
writeln (^S,strr(newusers)+^R' New User',s(cnt),' applied for access.');
end;
writeln;
if inoutstr[sysopisavail]='In' then writeln (^S+availstr+^R) else
writeln (^S+notavailstr+^R);
logontime:=timer;
logofftime:=timer+timetoday;
logonunum:=unum;
end;
addlastcaller (unam);
{ writeurec;}
bottomline;
if (issysop) and (exist (forumdir+'System.Not')) then begin
writeln;
writestr ('Attention Sysop! There are System Notifications!');
writestr ('Do you want to read them now [Y/n]? *');
if (length(input)=0) or (upcase(input[1])='Y') then
begin
assign (sysnot,forumdir+'System.Not');
printfile (forumdir+'System.Not');
writestr (^M'Delete System Notification File [y/n]? *');
if yes then erase (sysnot);
end else writeln (^M^S'Be sure to read them soon then.'^R^M);
end;
if wanted in urec.config then if sysopisavail then begin
writeln (^B^G,sysopname,' wants to speak with you.');
writeln ('Let me page him...'^M);
for cnt:=1 to 25 do if not keyhit then summonbeep;
chatmode:=true
end;
printnews;
if tonext>-1 then begin
writehdr ('Auto Message');
printtext (tonext)
end;
disconnected:=false
end;
var thebaud:string;
begin
stoptimer (numminsidle);
starttimer (numminsused);
textcolor (normbotcolor);
clrscr;
initwinds;
fillchar (urec,sizeof(urec),0);
urec.config:=[lowercase,linefeeds,eightycols,asciigraphics];
uselinefeeds:=true;
usecapsonly:=false;
getsystempassword;
clearscr;
writeln;
str (baudrate,thebaud);
if local then thebaud:='Local' else thebaud:=thebaud+' bps';
writeln (^R'TCS '+ver+' - '+parsedate(date)+' [Online]');
writeln (^R'Written by the TCS Staff. Use [.] to view credits.');
writeln (^R'Port '+strr(usecom)+' accessed at '+timestr(now)+' using ',thebaud);
writeln;
printfile (textfiledir+'Prelogon.BBS');
if withintime (timereststart,timerestend) then begin
writeln;
writeln('[',timestr(now),'] - TIME RESTRICTION');
writeln('Your access level must be ',strr(timerestlvl),' or above to access ',longname);
writeln('at this time.');
writeln;
end;
if autologin and local and (not carrier) then begin
writeln (usr,'* SYSOP AUTOLOGIN *');
unum:=lookupuser (sysopname);
if unum=0
then writeln (usr,'User ',sysopname,' not found!')
else begin
unum:=1;
inituser;
exit
end
end;
getunum;
if hungupon then exit;
if not isnew then getpwd;
if hungupon then exit;
inituser
end;
procedure returnfromdoor;
var t:sstr;
begin
if not fromdoor then exit;
readdataarea;
baudrate:=valu(paramstr(2));
parity:=boolean(valu(paramstr(3)));
online:=baudrate<>0;
local:=not online;
if baudrate=0 then baudrate:=defbaudrate;
setparam (usecom,baudrate,parity);
if unum=valu(paramstr(1)) then readurec else begin
unum:=valu(paramstr(1));
readurec;
if (unum<1) or (unum>numusers) then begin
unum:=-1;
exit
end;
logontime:=timer;
logofftime:=timer+urec.timetoday
end;
if hungupon then begin
unum:=-1;
exit
end;
fromdoor:=true;
settimeleft (urec.timetoday);
t:=paramstr(4);
if t=''
then returnto:='D'
else returnto:=upcase(t[1])
end;
begin
end.