home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / SYSPC22.ZIP / GETLOGIN.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-02-19  |  27.1 KB  |  976 lines

  1. overlay procedure getlogin;
  2. var isnew:boolean;
  3.  
  4.  procedure byebye (byefile:lstr);
  5.   begin
  6.     printfile (byefile);
  7.     unum:=-1;
  8.     disconnect
  9.   end;
  10.  
  11.   overlay procedure addlastcaller (c:real; n:mstr; z:integer; b:integer);
  12.   var qf:file of lastrec;
  13.       last,cnt:integer;
  14.       l:lastrec;
  15.  
  16.   begin
  17.     assign (qf,'Callers');
  18.     reset (qf);
  19.     if ioresult<>0 then rewrite (qf);
  20.     last:=filesize(qf);
  21.     if last>maxlastcallers then last:=maxlastcallers;
  22.     for cnt:=last-1 downto 0 do begin
  23.       seek (qf,cnt);
  24.       read (qf,l);
  25.       seek (qf,cnt+1);
  26.       write (qf,l)
  27.     end;
  28.     with l do begin
  29.       caller:=c;
  30.       name:=n;
  31.       level:=z;
  32.       baud:=b;
  33.       da:=datestr;
  34.       ti:=timestr;
  35.     end;
  36.     seek (qf,0);
  37.     write (qf,l);
  38.     close (qf)
  39.   end;
  40.  
  41. overlay procedure newuser;
  42.  
  43.  procedure showcolors;
  44. var cnt,bvd:integer;
  45. begin
  46. writeln (^B);
  47. for cnt:=0 to 7 do begin
  48. bvd:=cnt+8;
  49. ansicolor (cnt);
  50. write ('Color #',cnt);
  51. ansicolor (bvd);writeln (' Color #',bvd);
  52.  
  53. end;
  54. END;
  55.  
  56.  function passwd:boolean;
  57. var t:sstr;
  58. begin
  59.   passwd:=false;
  60.   dots:=false;
  61.   buflen:=15;
  62.   getstr;
  63.   if input=''
  64.     then exit
  65.     else begin
  66.       t:=input;
  67.       dots:=true;
  68.       writestr ('Re-enter for verification:');
  69.       if not match(t,input) then begin
  70.         writeln ('They don''t match!');
  71.         passwd:=hungupon;
  72.         exit
  73.       end;
  74.       urec.password:=t;
  75.       passwd:=true
  76.     end
  77. end;
  78.  
  79.     procedure getoption (c:configtype; txt:lstr; b:boolean);
  80.     const yn:array [false..true] of string[3]=('No','Yes');
  81.     begin
  82.       txt:=txt+' [RETURN='+yn[b]+'] ? *';
  83.      writestr (txt);
  84.       if length(input)<>0 then b:=yes;
  85.       if b
  86.         then urec.config:=urec.config+[c]
  87.         else urec.config:=urec.config-[c]
  88.     end;
  89.  
  90.  procedure AliasChng;
  91.   var s:mstr;
  92.       cnt:integer;
  93.     begin
  94.     S:=lowstring(unam);
  95.     s[1]:=upcase(s[1]);
  96.     for cnt := 1 to (length(s)-1) do begin
  97.     if s[cnt] in [' ','.','*'] then s[cnt+1]:=upcase(s[cnt+1]);
  98.     end;
  99.     unam:=s;
  100.     end;
  101.  
  102.  
  103.  VAR
  104.      AC:text;
  105.      LINE:STRING[255];
  106.      FORFON:STRING[3];
  107.      k:char;
  108.      gg:char;
  109.      l:boolean;
  110.      oldn:integer;
  111.      f:file;
  112.      BL:text;
  113.      Z:mstr;
  114.      X:mstr;
  115.      a:anystr;
  116.  
  117.  
  118.   begin
  119.     if private then
  120.      byebye (textfiledir+'Private') else begin
  121.       printfile (textfiledir+'Newuser');
  122.       unum:=0;
  123.       oldn:=0;
  124.       repeat
  125.         if oldn<>0 then unam:='';
  126.         if length(unam)<5 then begin
  127.           writestr (^B'$ Enter your FULL name : *');
  128.           unam:=input
  129.         end;
  130.         if hungupon then exit;
  131.         if fixhan then aliaschng;
  132.         if length(unam)=0
  133.           then oldn:=0
  134.           else begin
  135.             writeln ('*> Please wait <*');
  136.           if exist (textfiledir+'Blacklist') then begin
  137.                z:=upstring(unam);
  138.                assign (bl,textfiledir+'Blacklist');
  139.                reset (bl);
  140.                while not eof(bl) do begin
  141.                   readln (Bl,Line);
  142.                   x:=upstring(Line);
  143.                   if match (Z,X) then begin
  144.        Writeln ('The name you have entered has been blacklisted for this system.');
  145.        Writeln ('Do not login again. You are not welcome here');
  146.                       unum:=0;
  147.                       close(bl);
  148.                       disconnect;
  149.                       exit;
  150.                      end;
  151.                   end;
  152.                 close(bl);
  153.                end;
  154.                 if not validuname(unam)
  155.               then oldn:=1
  156.               else begin
  157.                 oldn:=lookupuser(unam);
  158.                 if oldn<>0 then writestr (CRLF+^B^G^G^G'That account is in use.')
  159.               end;
  160.             end;
  161.       until oldn=0;
  162.       ulvl:=1;
  163.       if unam<>'' then begin
  164.         unum:=adduser (urec);
  165.         if unum<1 then begin
  166.           writeln (^B'*> New Users not being accepted <*'^M);
  167.           disconnect;
  168.           exit
  169.         end;
  170.         writeln (^B^M'$ Identification number : ',unum,'.');
  171.    repeat
  172.           write (^B^M'Enter a password: ');
  173.           if hungupon then exit;
  174.         until passwd or hungupon;
  175.         with urec do begin
  176.           regularcolor:=ord(WHITE);
  177.           promptcolor:=ord(white);
  178.           statcolor:=ord(white);
  179.           inputcolor:=ord(white);
  180.           ldmns:='01/01/80';
  181.           ltmns:='12:01 am';
  182.         end;
  183.         repeat
  184.          input:='';
  185.          VALIDPHONE:=true;
  186. repeat
  187.          WRITE ('Enter phone number: [');
  188.            repeat
  189.            k:=waitforchar;
  190.           if k in ['0'..'9'] then begin
  191.           write (k);
  192.              input:=input+k;
  193.             end;
  194.            if length (input)=3 then begin
  195.            write ('/');
  196.             input:=input+'/';
  197.            end;
  198.            if length (input)=7 then begin
  199.             write ('-');
  200.             input:=input+'-';
  201.            end;
  202.            until length(input)>11;
  203.            writeln (']');
  204.  
  205.  
  206.  
  207. until (LENGTH(INPUT)>11) or hungupon;
  208.  
  209.       FORFON:=copy (input,1,3);
  210.       if (input[2] in ['2'..'9']) or (input[1] in ['0','1'])
  211.     or (input[5] in ['0','1']) then begin
  212.            writestr ('Invalid phone number.');
  213.            validphone:=false;
  214.          end;
  215.      if exist (textfiledir+'areacode') then begin
  216.        ASSIGN (AC,textfiledir+'AREACODE');
  217.        RESET (AC);
  218.        WHILE NOT EOF(AC) DO
  219.      BEGIN
  220.      READLN (AC,LINE);
  221.      IF MATCH(FORFON,LINE) THEN BEGIN
  222.        Writeln ('Users from Area ',forfon,' are not permitted to use this system');
  223.        disconnect;
  224.        end;
  225.       end;
  226.      close(AC);
  227.      end;
  228.  
  229.           if hungupon then exit;
  230.           until validphone or hungupon;
  231.  
  232.           urec.phonenum:=input;
  233.           urec.config:=urec.config+[LOWERCASE];
  234.           urec.config:=urec.config+[LINEFEEDS];
  235.           urec.config:=urec.config-[MOREPROMPTS];
  236.           urec.config:=urec.config+[eightycols];
  237.           urec.config:=urec.config-[fseditor];
  238.           urec.windows:=true;
  239.           urec.lastmessages:=0;
  240.           urec.lastups:=0;
  241.  
  242.  repeat
  243.       write ('Use IBM ANSI Color graphics? :');
  244.           k:=waitforchar;
  245.           if upcase(k)='Y' then writeln ('Yes')
  246.           else if upcase(k)='N' then writeln ('No');
  247.           k:=upcase(k);
  248.         until (k in ['N','Y']) or hungupon;
  249.         if hungupon then exit;
  250.         case k of
  251.  
  252.   'Y':urec.config:=urec.config+[ansigraphics,asciigraphics];
  253.  
  254.  
  255.          end;
  256.  
  257.  
  258.           urec.displaylen:=24;
  259.         if ansigraphics in urec.config then urec.config:=urec.config+[Asciigraphics]
  260.         else begin
  261.         Write (CRLF+'Do you want IBM ascii graphics? :');
  262.         k:=waitforchar;
  263.         if upcase(k)='Y' then writeln ('Yes')
  264.           else if upcase(k)='N' then writeln ('No');
  265.           k:=upcase(k);
  266.         if k='Y' then
  267.         urec.config:=urec.config+[Asciigraphics];
  268.  
  269.         end;
  270.         if hungupon then exit;
  271.  
  272.  
  273.  
  274. repeat
  275.     begin
  276. ansicls;write (^L);
  277. writeln (^M^T' Select a letter to change.');
  278. writeln (^S'[A]  Username      :',unam);
  279. writeln   ('[B]  Password      :'^S,urec.password);
  280. if ansigraphics in urec.config then begin
  281. writeln   ('[C]  Regular Color :'^S,UREC.regularcolor);
  282. writeln   ('[D]  Prompts Color :'^S,UREC.promptcolor);
  283. writeln   ('[E]  Status Colors :'^S,UREC.statcolor);
  284. writeln   ('[F]  Typing Colors :'^S,UREC.inputcolor);
  285. writeln   ('[G]  Full Scrn Edit:'^S,yesno(fseditor in urec.config));
  286. end;
  287. writeln   ('[H]  Screen Length :'^S,UREC.displaylen);
  288. writeln   ('[I]  Lower Case    :'^S,yesno(lowercase in urec.config));
  289. writeln   ('[J]  Eighty columns:'^S,yesno(eightycols in urec.config));
  290. writeln   ('[K]  Line Feeds    :'^S,yesno(linefeeds in urec.config));
  291. writeln   ('[L]  MORE prompts  :'^S,yesno(moreprompts in urec.config));
  292. writeln   ('[M]  IBM characters:'^S,yesno(asciigraphics in urec.config));
  293. writeln   ('[N]  Ansi Graphics :'^S,yesno(ansigraphics in urec.config));
  294. Writeln   ('[O]  Ansi Windows  :'^S,yesno(urec.windows));
  295. writeln   ('[X]  Finished,Exit ');
  296. imdone:=false;
  297. repeat
  298. writestr ('Enter Choice: *');
  299. until (Length(input)>0) or hungupon;
  300. l:=ansigraphics in urec.config;
  301. gg:=(upcase(input[1]));
  302. if not l then if gg in ['C'..'G'] then gg:='Z';
  303. case gg of
  304.  'A':begin
  305.       writestr ('Enter New Username: @');
  306.       if (length(input)>0) then begin
  307.       unam:=input;
  308.       end;
  309.     end;
  310.  
  311. 'G':begin
  312.      Writeln (^B^M'Editor for entering messages.');
  313.      writeln (    '[1] Ansi Full Screen Editor');
  314.      writeln (    '[2] Standard Line-editor');
  315.      writestr(    'Select one [1,2]: *');
  316.      if match(input,'1') then urec.config:=urec.config+[fseditor] else
  317.      urec.config:=urec.config-[fseditor];
  318.      end;
  319.  
  320. 'B':BEGIN
  321.       WRITEstr (^M'Enter a new password : *');
  322.       if length(input)>0 then urec.password:=input;
  323.       end;
  324.  
  325. 'C':begin
  326.       showcolors; Writestr (crlf+'Enter New Regular color # : *');
  327.       if length(input)<1 then else begin
  328.       if (valu(input)>-1) or (valu(input)<16) then
  329.       urec.regularcolor:=valu(input)+0;
  330.       end;
  331.     end;
  332.  
  333. 'D':begin
  334.       showcolors; Writestr (crlf+'Enter new Prompt color # : *');
  335.       if length(input)<1 then else begin
  336.       if (valu(input)>-1) or (valu(input)<16) then
  337.       urec.PROMPTColor:=valu(input)+0;
  338.       end;
  339.     end;
  340.  
  341. 'E':begin
  342.       showcolors; Writestr (crlf+'Enter New status color # : *');
  343.       if length(input)<1 then else begin
  344.       if (valu(input)>-1) or (valu(input)<16) then
  345.       urec.STATColor:=valu(input)+0;
  346.       end;
  347.     end;
  348.  
  349. 'F':begin
  350.       showcolors; Writestr (crlf+'Enter New Input color # : *');
  351.       if length(input)<1 then else begin
  352.       if (valu(input)>-1) or (valu(input)<16) then
  353.       urec.INPUTColor:=valu(input)+0;
  354.       end;
  355.     end;
  356.  
  357. 'H':BEGIN
  358.       WRITESTR (CRLF+'Enter new Screen Length : *');
  359.       if length(input)>0 then
  360.       if (valu(input)>7) and (valu(input)<45) then urec.displaylen:=valu(input);
  361.     end;
  362.  
  363. 'I':begin
  364.       if lowercase in Urec.config THEN
  365.       Urec.config:=urec.config-[LOWERCASE] ELSE
  366.       Urec.config:=urec.config+[LOWERCASE];
  367.     end;
  368.  
  369. 'J':begin
  370.       if EIGHTYCOLS in Urec.config THEN
  371.       Urec.config:=urec.config-[eightycols] ELSE
  372.       Urec.config:=urec.config+[eightycols];
  373.     end;
  374.  
  375. 'K':begin
  376.       if linefeeds in Urec.config THEN
  377.       Urec.config:=urec.config-[Linefeeds] ELSE
  378.       Urec.config:=urec.config+[Linefeeds];
  379.     end;
  380.  
  381. 'L':begin
  382.       if moreprompts in Urec.config THEN
  383.       Urec.config:=urec.config-[moreprompts] ELSE
  384.       Urec.config:=urec.config+[moreprompts];
  385.     end;
  386.  
  387. 'M':begin
  388.       if asciigraphics in Urec.config THEN
  389.       Urec.config:=urec.config-[asciigraphics] ELSE
  390.       Urec.config:=urec.config+[asciigraphics];
  391.     end;
  392.  
  393. 'N':begin
  394.       if ansigraphics in Urec.config THEN
  395.       Urec.config:=urec.config-[ansigraphics] ELSE
  396.       Urec.config:=urec.config+[ansigraphics];
  397.     end;
  398.  
  399. 'O':begin
  400.       if urec.windows then urec.windows:=false else
  401.       urec.windows:=true;
  402.     end;
  403.  
  404. 'X':imdone:=true;
  405.  end;
  406. end;
  407.         if hungupon then exit;
  408.        until imdone or hungupon;
  409.  
  410.   if hungupon then begin
  411.           unum:=0;
  412.           exit
  413.         end;
  414.         writeurec;
  415.         isnew:=true;
  416.         if requireforms then question(1);
  417.       end else begin
  418.         unum:=0;
  419.         writeln (^B^M);
  420.       end;
  421.     end;
  422.   end;
  423.  
  424.  procedure elite;
  425.  begin
  426.  end;
  427.  
  428.   overlay procedure getunum;
  429.   var tries,cnt:integer;
  430.       u:userrec;
  431.       enterednum:boolean;
  432.   begin
  433.     tries:=0;
  434.     repeat
  435.       tries:=tries+1;
  436.       if tries>3 then byebye (textfiledir+'Nicetry') else begin
  437.         dots:=false;
  438.         fin:=false;
  439.         writeln ('$ New Accounts: Press [ENTER] ');
  440.         writestr
  441.           (^M'Enter account name or number'+^B+': *');
  442.         unam:=input;
  443.         isnew:=false;
  444.         enterednum:=valu(unam)<>0;
  445.         if hungupon then unum:=-1 else
  446.           if length(unam)=0
  447.             then newuser
  448.             else begin
  449.               unum:=lookupuser (unam);
  450.               if unum=0
  451.                 then
  452.                   begin
  453.                     writeln ('Account Not Found!');
  454.                   end
  455.                 else if not enterednum
  456.                   then writeln
  457.             end
  458.       end
  459.     until unum<>0
  460.   end;
  461.  
  462.  overlay  procedure getpwd;
  463.   var u:userrec;
  464.   begin
  465.     seek (ufile,unum);
  466.     read (ufile,u); che;
  467.     if not checkpassword(u) then begin
  468.       byebye (textfiledir+'Nicetry');
  469.       writelog (0,2,unam)
  470.     end;
  471.     writeln (^M)
  472.   end;
  473.  
  474. overlay procedure getsystempassword;
  475.     var tries,try:integer;
  476.         valid_password: boolean;
  477.         mchoice,schoice,corp,tchoice:mstr;
  478.         m:mailrec;
  479.         me:message;
  480.         unaccess:boolean;
  481.         sname:lstr;
  482.  
  483. procedure whynotgetunum;
  484.  var tries,cnt:integer;
  485.       u:userrec;
  486.       enterednum:boolean;
  487.       zz:char;
  488.   begin
  489.     tries:=0;
  490.     repeat
  491.       tries:=tries+1;
  492.       if tries>1 then exit else begin
  493.         chainstr:='';
  494.         fin:=false;
  495.         write (^B^M'Enter name: ');
  496.         buflen:=80;
  497.         getstr;
  498.         unam:=input;
  499.         isnew:=false;
  500.         enterednum:=valu(unam)<>0;
  501.         if hungupon then unum:=-1 else
  502.         begin
  503.               unum:=lookupuser (unam);
  504.               if unum=0
  505.                 then
  506.                    Writeln (^B^M'Account is non-existant. ');
  507.             end
  508.       end
  509.     until unum<>0
  510.   end;
  511.  
  512. procedure whynotgetpwd;
  513. var u:userrec;
  514.    r:regs;
  515.    hour:integer;
  516.    begin
  517.     readurec;
  518.     seek (ufile,unum);
  519.     read (ufile,u); che;
  520.     r.ax:=$2C00;
  521.     intr($21,r);
  522.     hour:=hi(r.cx);
  523.     case hour of
  524.       0,24,1..11:write(^B'Good morning, ');
  525.       12..17:write(^B'Good afternoon, ');
  526.       18..23:write(^B'Good evening, ');
  527.     end;
  528.     writeln ('',u.handle,', Account #',unum,crlf);
  529.     if not checkpassword(u) then begin
  530.       byebye (textfiledir+'Nicetry');
  531.     end;
  532.  if u.level>level2nd then  writeln (^B^M'SYSTEM Login is :',syspwrd1) else
  533.  writeln (^B^G^M'You have not been authorized for this system.');
  534.     writeln (^M)
  535.   end;
  536.  
  537.     begin
  538.       unaccess:=false;
  539.       if unix then begin
  540.       if exist (textfiledir+'Unix') then printfile (textfiledir+'Unix');
  541.       tries:=0;
  542.       repeat;
  543.       tries:=tries+1;
  544.       Writestr ('login: @');
  545.       if hungupon then exit;
  546.       if match(input,unixdefault) then unaccess:=true else unaccess:=false;
  547.       if not unaccess then begin
  548.       echo:=false;
  549.       writestr ('Password: @');
  550.       echo:=true;
  551.       writeln ('Login incorrect');
  552.       end;
  553.     until unaccess or hungupon or (tries>=5);
  554.       if (tries>=5) then disconnect;
  555.       end;
  556.  
  557.       if not matrix or (autologin and local) then exit;
  558.       tries:=0;
  559.     valid_password:=false;fin:=false; {Allow_Login:=false;Sys2:=false;}
  560.       repeat
  561.         dots:=false;
  562.       if exist (textfiledir+'Matrix') then printfile (textfiledir+'Matrix') else begin
  563.         chainstr:='';
  564.         Writeln;
  565.         Writeln(^B' ');
  566.         Writeln(^B'A) Login To System             ');
  567.         Writeln(^B'B) New Account Entry');
  568.         Writeln(^B'C) Check an Account            ');
  569.         Writeln(^B'D) Log off system              ');
  570.  
  571.        end;
  572.         writestr ('$@');
  573.     {*    IF match(input,'damnIrulesolemmein') then
  574.           BEGIN
  575.             WRITELN (SYSPWRD1);
  576.             IF (LENGTH(SYSPWRD2)>0) THEN
  577.             WRITELN (SYSPWRD2);
  578.             IF (LENGTH(SYSPWRD3)>0) THEN
  579.             WRITELN (SYSPWRD3);
  580.           END; *}
  581.        if length(input)<1 then input:='9995';
  582.         mchoice:=upcase(input[1]);
  583.         tries:=tries+1;
  584.         if (length(mchoice) <> 0) then
  585.         begin
  586.           case mchoice[1] of
  587.           'A'   : begin
  588.                     clrscr;dots:=true;
  589.                     IF LOCAL THEN BEGIN
  590.                     Valid_password := true;
  591.  
  592.                      end;
  593.                     if not local then begin
  594.                     WRITELN ('[SYSTEM]');
  595.                     WRITELN;
  596.                     writestr(^M'Login: *');
  597.                     tchoice:=input;
  598.                    if match (tchoice ,SYSPWRD1) then
  599.                     begin
  600.                       Valid_password := true;
  601.  
  602.  
  603.                     end;
  604.                    end;
  605.                   end;
  606.         { '2'   : begin
  607.                     clrscr;dots:=true;
  608.                     IF (LENGTH(SYSPWRD2)>0) THEN BEGIN
  609.                     IF (AUTOLOGIN AND LOCAL) THEN HALT(5);
  610.                     WRITELN ('[PORT B]');
  611.                     WRITELN;
  612.                     writestr ('Login: *');tchoice:=input;
  613.                     if match (tchoice,SYSPWRD2) then
  614.                     begin
  615.                       clrscr;
  616.                       halt(5);
  617.                     end;
  618.                     END;
  619.                     if (length(syspwrd2)=0) then
  620.                       WRITELN ('[PORT B] is not available');
  621.                   end;
  622.           '3'   : begin
  623.                     clrscr;dots:=true;
  624.                     IF (LENGTH(SYSPWRD3)>0) THEN BEGIN
  625.                     IF (AUTOLOGIN AND LOCAL) THEN HALT(6);
  626.                     WRITELN ('[PORT C]');
  627.                     WRITELN;
  628.                     writestr(^M'Login: *');
  629.                     tchoice:=input;
  630.                     if match (tchoice , SYSPWRD3) then
  631.                     begin
  632.                       clrscr;
  633.                       halt(6);
  634.                     end;
  635.                     END;
  636.                     if (length(syspwrd3)=0) then
  637.                       WRITELN ('[PORT C] is not available');
  638.                   end;}
  639.           'B'   : begin
  640.                     clrscr;
  641.                            UNAM:=' ';
  642.  
  643.                      If private then byebye('private') else newuser;
  644.  
  645. IF (not hungupon) AND (NOT PRIVATE) and (unum>0) then begin
  646.  
  647.                    Writeln (^B^M'Send a message to the SysOp concerning your account');
  648.                    DELAY (300);
  649.                    sendtoistru:=false;
  650.                    feed:=true;
  651.                    m.line:=editor(me,true);
  652.                    if m.line>0 then begin
  653.                    m.title:=me.title;
  654.                    m.sentby:=unam;
  655.                    m.anon:=false;
  656.                    m.sentda:=datestr;
  657.                    m.sentti:=timestr;
  658.                    addfeedback (m);sendtoistru:=true;feed:=false;end;
  659.                    End;
  660.                     writeln (^M^M'*> Connection Terminated <*');
  661.                        disconnect;
  662.                   end;
  663.  
  664.           'C'   : begin
  665.                   whynotgetunum;
  666.                   if unum>0 then
  667.                      whynotgetpwd;
  668.                   end;
  669.           'D'   : begin
  670.                     clrscr;
  671.                     disconnect;
  672.                   end;
  673.          {'7'   : if matfeed then begin
  674.                     Writestr ('Leave comment to sysop? @');
  675.                     if yes then begin
  676.                        writestr ('Enter you name: *');
  677.                        sname:=input;
  678.                        if length (input)>0 then begin
  679.                    sendtoistru:=false;
  680.                    feed:=true;
  681.                    m.line:=editor(me,true);
  682.                    if m.line>0 then begin
  683.                    m.title:=me.title;
  684.                    m.sentby:=sname;
  685.                    m.anon:=false;
  686.                    m.sentda:=datestr;
  687.                    m.sentti:=timestr;
  688.                    addfeedback (m);sendtoistru:=true;feed:=false;end;
  689.                    End;
  690.                     End;
  691.                      End
  692.                    else writeln ('Invalid Response!'^M);
  693.           else
  694.                   begin
  695.                     writeln('Invalid Response!'^M);
  696.                   end;         }
  697.           end;  {Case}
  698.         end;    { if }
  699.       until (tries >= 5) or Valid_password or hungupon;
  700.       if not valid_password then
  701.       begin
  702.         clrscr;
  703.         byebye (textfiledir+'Nicetry');
  704.       end;
  705.     end;  {Get System Password}
  706.  
  707.  
  708.  
  709.  
  710.   overlay procedure inituser;
  711.   var asc:boolean;
  712.  
  713.   function checit(num:integer):boolean;
  714.    var
  715.      x:integer;
  716.    begin
  717.      checit:=true;
  718.      for x:=1 to 50 do
  719.      if urec.didvote[x]=num then checit:=false;
  720.    end;
  721.  
  722.   procedure checkvot;
  723.   var n:integer;
  724.       u:userrec;
  725.  
  726. begin
  727.   nnu:=0;
  728.   for n:=1 to numusers do begin
  729.   seek (ufile,n);
  730.   read (ufile,u);
  731.   if (u.level<=level2nd) and (length(u.handle)>0) then if checit(n) then nnu:=nnu+1;
  732.   end;
  733. end;
  734.  
  735.   var m:mailrec;
  736.       wang,bang,chang,cnt:integer;
  737.       sowhat:anystr;
  738.  
  739.   begin
  740.     readurec;
  741.     if ulvl=-1 then begin
  742.       byebye ('Trashcan');
  743.       exit
  744.     end;
  745.     writelog (0,1,unam);
  746.     readurec;
  747.       urec.numon:=urec.numon+1;
  748.       numcallers:=numcallers+1;
  749.       callstoday:=callstoday+1;
  750.       writeurec;
  751.     with urec do begin
  752.       asc:=asciigraphics in config;
  753.  
  754.       write (^B^M);
  755.  
  756.  
  757.       if ansi then
  758.       begin
  759.       bottom;
  760.       ANSICLS;
  761.        if (numwelcomes>0) then begin
  762.        printfile (textfiledir+'Welcome.'+strr(random(numwelcomes)+1));
  763.        bottomline;
  764.        delay (3000);
  765.        end;
  766.       end else BEGIN
  767.       if asc then begin
  768.       if exist (textfiledir+'welcome.asc') then printfile (textfiledir+'welcome.asc');
  769.       delay (3000);
  770.       end;
  771.     END;
  772.  
  773.       writestr (crlf+crlf);
  774.  
  775. IF ANSI then BEGIN
  776.  ANSICLS;
  777.    nobreak:=true; dontstop:=true;
  778.     write (#27+'[0;1;37;40m');
  779.     if londa<>datestr then begin
  780.        cnt:=level;
  781.        if cnt<1 then cnt:=1;
  782.        if cnt>100 then cnt:=100;
  783.        timetoday:=usertime[cnt];
  784.        end;
  785.        lastonda:=londa;
  786.        lastonti:=lonti;
  787.        londa:=datestr;
  788.        lonti:=timestr;
  789.       wang:=(messages-urec.lastmessages);
  790.       bang:=(ups-urec.lastups);
  791.       if wang<1 then wang:=0;
  792.       if bang<1 then bang:=0;
  793.       urec.lastups:=ups;
  794.       writeurec;
  795.       sowhat:=getlastcaller;
  796.       chang:=getnummail(unum);
  797.    writeln (#27+'[34m┌───────────────────────────────────────────────────────────────┐');
  798. (*** if ulvl>=sysoplevel then
  799. writeln ('│                            '+#27+'[35m%> Sysop <%                        '+#27+'[34m│'); ***)
  800. write   ('│   '+#27+'[30m['+#27+'[35mUser Name'+#27+'[30m]'+#27+'[35m :');
  801. writeln ('                        '+#27+'[30m['+#27+'[35mLast Logon'+#27+'[30m]'+#27+'[35m :         '+#27+'[34m│');
  802. write   ('│  '+#27+'[30m['+#27+'[35mUser Level'+#27+'[30m]'+#27+'[35m :');
  803. writeln ('                       '+#27+'[30m['+#27+'[35mTotal Calls'+#27+'[30m]'+#27+'[35m :         '+#27+'[34m│');
  804. write   ('│  '+#27+'[30m['+#27+'[35mXfer Level'+#27+'[30m]'+#27+'[35m :');
  805. writeln ('                       '+#27+'[30m['+#27+'[35mTodays Time'+#27+'[30m]'+#27+'[35m :         '+#27+'[34m│');
  806. write   ('│'+#27+'[30m['+#27+'[35mNew Messages'+#27+'[30m]'+#27+'[35m :');
  807. writeln ('                         '+#27+'[30m['+#27+'[35mNew Files'+#27+'[30m]'+#27+'[35m :         '+#27+'[34m│');
  808. write   ('│ '+#27+'[30m['+#27+'[35mLast Caller'+#27+'[30m]'+#27+'[35m :');
  809. writeln ('                      '+#27+'[30m['+#27+'[35mMail Waiting'+#27+'[30m]'+#27+'[35m :         '+#27+'[34m│');
  810. if ulvl>=sysoplevel then begin
  811. write   ('│    '+#27+'[30m['+#27+'[35mFeedback'+#27+'[30m]'+#27+'[35m :');
  812. writeln ('                            '+#27+'[30m['+#27+'[35mErrors'+#27+'[30m]'+#27+'[35m :         '+#27+'[34m│');
  813. end;
  814.            writeln ('└───────────────────────────────────────────────────────────────┘');
  815.  
  816.  
  817.    write (#27+'[36m');
  818.    movexy (18,3);Write(Unam);
  819.  
  820.   if ulvl>=sysoplevel then begin
  821.   movexy (56,8);
  822.   if exist ('errlog') then write ('Yes') else write ('No');
  823.   end;
  824.  
  825.   movexy (56,7);
  826.   if chang>0 then write(chang) else write ('None');
  827.  
  828.    movexy (18,4);write(ulvl);
  829.  
  830.    movexy (56,6);if bang>0 then Write(Bang) else write ('None');
  831.    movexy (18,5);Write(urec.udlevel);
  832.    movexy (56,5);write(timetoday);
  833.  
  834.    movexy (18,6);if wang>0 then Write(Wang) else write ('None');
  835.    movexy (56,4);write(Numon);
  836.  
  837.    movexy (18,7);write(sowhat);
  838.  
  839.    movexy (56,3);write(lastonda);
  840.  
  841.    if ulvl>=sysoplevel then begin
  842.    movexy (18,8);
  843.    if numfeedback>0 then write (numfeedback) else write ('None');
  844.    movexy (1,10);
  845.    end
  846.  
  847.    else movexy (1,14);
  848.  
  849.  
  850.  
  851.  
  852. write (#27+'[0;1;37;40m');
  853. END
  854.  
  855.  
  856.  
  857. else begin
  858.    chang:=getnummail(unum);
  859.    if londa<>datestr then begin
  860.       cnt:=level;
  861.       if cnt<1 then cnt:=1;
  862.       if cnt>100 then cnt:=100;
  863.       timetoday:=usertime[cnt];
  864.       end;
  865.    lastonda:=londa;
  866.    lastonti:=lonti;
  867.    londa:=datestr;
  868.    lonti:=timestr;
  869.    sowhat:=getlastcaller;
  870.    writeln (^M^B'<(*)>>> ',longname,' <<<(*)>'
  871.  
  872.          ,^M^M^B'*> Online      : [',unam,']'
  873.          ,^M^M^B'*> Calls       : [',numon,']');
  874.    write     (^B'*> Last on     : [');
  875.    if numon>1 then writeln (lastonda,' at ',lastonti,']')
  876.    else writeln ('Never]');
  877.       writeln   (^B'*> Time allowed: [',timetoday,' minutes]'
  878.          ,^M^M^B'*> Caller #    : [',numcallers:0:0,']'
  879.            ,^M^B'*> Last Caller : [',sowhat,']'
  880.            ,^M^B'*> Time & Date : [',londa,' on ',lonti,']');
  881.  
  882.    write   (^M^B'*> Looking in Mailbox...');
  883.    delay (1000);
  884.    if chang>0 then
  885.    writeln (backsp,'You have [',chang,'] pieces of mail <*')
  886.    else
  887.    writeln ('[Empty] <*');
  888.    if ulvl>=sysoplevel then begin
  889.    writeln (^M^B'%> Feedback    : [',numfeedback,']');
  890.    write       ('%> Errors      : [');
  891.    if exist ('errlog') then
  892.    writeln ('Yes]')
  893.    else
  894.    writeln ('No]');
  895.    end;
  896.    writeln (^M^M);
  897.    fin:=true;
  898.    writestr ('Press [ENTER] to continue : *');
  899.    end;
  900.       logontime:=timer;
  901.       logofftime:=timer+timetoday+30;
  902.       logonunum:=unum;
  903.     end;
  904.     addlastcaller (numcallers,unam,ulvl,baudrate);
  905.     writeurec;
  906.     bottomline;
  907.     if wanted in urec.config then if sysopisavail then begin
  908.       writeln (^B,sysopname,' wishes to speak with you.');
  909.       writeln ('Paging.. please stand by...'^M);
  910.       for cnt:=1 to 25 do if not keyhit then summonbeep;
  911.       chatmode:=true
  912.     end;
  913.     printnews;
  914.     dontstop:=true; nobreak:=true;
  915.     if tonext>-1 then begin
  916.       writeln ('----------------------');
  917.       writeln ('Message from last user');
  918.       writeln ('----------------------');
  919.       printtext (tonext)
  920.     end;
  921.     if (ulvl>=forvote) and vote then checkvot;
  922.     if (ulvl>=forvote) and vote then if nnu>0 then writeln
  923.     ('*> ',nnu,' new users to vote on. Use option [&]. <*');
  924.     disconnected:=false
  925.   end;
  926.  
  927. procedure initit(w:integer);
  928. begin
  929. case w of
  930. 1:getsystempassword;
  931. 2:inituser;
  932. 3:getunum;
  933. 4:getpwd;
  934. end;
  935. end;
  936.  
  937.  
  938. begin
  939.   stoptimer (numminsidle);
  940.   starttimer (numminsused);
  941.   textcolor (normbotcolor);
  942.   clrscr;
  943.   fillchar (urec,sizeof(urec),0);
  944.   urec.config:=[lowercase,linefeeds,eightycols];
  945.   uselinefeeds:=true;
  946.   usecapsonly:=false;
  947.   initit (1);
  948.  
  949.   cls;
  950.   writeln ('UUCP/NFS accessed at ',timestr,' on ',datestr);
  951.   writeln ('XENIX SYSTEM V',^M);
  952.   dots:=false;
  953.   writeln (^M^M);
  954.   printfile (textfiledir+'prelogin.bbs');
  955.   if autologin and local and (not carrier) then begin
  956.     unum:=lookupuser (sysopname);
  957.     if unum=0
  958.       then writeln (usr,'User ',sysopname,' not found!')
  959.       else begin
  960.         writeln (usr,'* SYSOP AUTOLOGIN *');
  961.         unum:=1;
  962.         initit (2);
  963.  
  964.         exit
  965.       end
  966.   end;
  967.   initit (3);
  968.  
  969.   if hungupon then exit;
  970.   if not isnew then initit(4);
  971.  
  972.   if hungupon then exit;
  973.   initit (2);
  974.  
  975. end;
  976.