home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / NWTP04 / XSERV / LOGLOCK.PAS < prev    next >
Pascal/Delphi Source File  |  1993-12-29  |  787b  |  32 lines

  1. {$X+,V-,B-}
  2. program loglock;
  3.  
  4. { Example for the nwServ unit / NwTP 0.4 API. (c) 1994, R.Spronk }
  5.  
  6. { This program toggles the login status..
  7.   If User Login was enabled, it will be diabled and v.v. }
  8.  
  9. uses nwMisc,nwServ;
  10.  
  11. Var allowed:boolean;
  12.  
  13. begin
  14. IF GetFileServerLoginStatus(allowed)
  15.  then begin
  16.       if allowed
  17.        then begin
  18.             DisableFileServerLogin;
  19.             writeln('Login Disabled.')
  20.             end
  21.        else begin
  22.             EnableFileserverLogin;
  23.             writeln('Login Enabled.')
  24.             end
  25.       end
  26.  else begin
  27.       if nwServ.result=$C6
  28.        then writeln('You need console operator rights to run this utility.')
  29.        else writeln('GetFileserverLoginStatus Error : $',HexStr(nwServ.result,2));
  30.       end;
  31. end.
  32.