home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 270.img / FORUM25C.ZIP / PASSWORD.SUB < prev    next >
Text File  |  1988-12-27  |  1KB  |  50 lines

  1.  
  2. Function getpassword:boolean;
  3. VAR t:sstr;
  4. begin
  5.   getpassword:=false;
  6.   dots:=true;
  7.   buflen:=15;
  8.   getstr;
  9.   if input=''
  10.     then exit
  11.     else begin
  12.       t:=input;
  13.       dots:=true;
  14.       writestr ('Re-enter for verification:');
  15.       if not match(t,input) then begin
  16.         writeln ('They don''t match!');
  17.         getpassword:=hungupon;
  18.         exit
  19.       end;
  20.       urec.password:=t;
  21.       getpassword:=true
  22.     end
  23. end;
  24.  
  25. Function checkpassword (VAR u:userrec):boolean;
  26. VAR tries:integer;
  27. begin
  28.   tries:=0;
  29.   checkpassword:=true;
  30.   repeat
  31.     splitscreen (5);
  32.     top;
  33.     writeln (usr,'Password Entry');
  34.     writeln (usr,'User name: ',u.handle);
  35.     writeln (usr,'Password: ',u.password);
  36.     write (usr,'Has entered so far: ');
  37.     bottom;
  38.     dots:=true;
  39.     writestr (^M'Password please:');
  40.     unsplit;
  41.     if hungupon then begin
  42.       checkpassword:=false;
  43.       exit
  44.     end;
  45.     if match(input,u.password)
  46.       then exit
  47.       else tries:=tries+1
  48.   until tries>3;
  49.   checkpassword:=false
  50. end;