home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / batch / mxmnu233.zip / LOGIN.MNU < prev    next >
Text File  |  1991-09-16  |  20KB  |  806 lines

  1. Comment
  2. ========================================================
  3.  
  4. Copyright 1990 by Marc Perkel * All right reserved.
  5.  
  6. MarxMenu now allows you to login to a Novell network without using
  7. Novell's login program or messing with nasty login scripts. You can
  8. be in MarxMenu all the way in.
  9.  
  10. Logging into Novell is tricky. Especially if you are using boot roms
  11. on your network cards. Through much trial and error, I have found
  12. some solid tricks that make life easier.
  13.  
  14. You should have the following two BATCH files in your LOGIN
  15. directory as follows:
  16.  
  17. LOADNET.BAT
  18. -----------
  19. NETX
  20. F:
  21. STARTUP
  22.  
  23. STARTUP.BAT
  24. -----------
  25. SET BOOTUP=LOGIN
  26. MarxMenu Login
  27. %BOOTUP%
  28.  
  29. Each workstation should have their own AUTOEXEC.BAT. The last line
  30. should be LOADNET. If you are running multiple versions of dos you
  31. can have the first line of LOADNET.BAT be %NET%. You will then have
  32. to have SET NET=NETX in your AUTOEXEC.BAT file.
  33.  
  34. Also, if you want automatic login you can add the following lines:
  35.  
  36. SET USERNAME=MARC   Your Name Here
  37. SET PASSWORD=NERD   Your Password Here
  38.  
  39. You should also change the COMSPEC= to the network command.com BEFORE
  40. you run NETX. For some unknown reason, this solves a lot of problems.
  41.  
  42. Example:
  43.  
  44. IPX
  45. SET COMSPEC=O:COMMAMD.COM
  46. NETX
  47.  
  48. Another boot rom quirk is that you can't run any program off a boot
  49. rom that trashes upper memory. An example is running QEMM on a
  50. monochrome monitor.
  51.  
  52. By using this method the boot disk or boot rom hands control over in
  53. a clean way. LOADNET.BAT then branches to STARTUP.BAT for the rest
  54. of the login sequence.
  55.  
  56. For some strange reason which I can't explain, LOADNET and STARTUP
  57. have to be two separate batch files. I think it forces the transient
  58. part of COMMAND.COM to load into memory. Anyhow, don't combine these
  59. into one batch file
  60.  
  61. The first line of STARTUP.BAT is a message that tells this menu that
  62. the user is logging in for the first time. This menu creates a batch
  63. file and puts the name of it in the environment variable BOOTUP.
  64. STARTUP.BAT then executes this file.
  65.  
  66. This is the example for MY network. You'll have to modify it for
  67. yours.
  68.  
  69. One word of caution. After modifing this menu, always run MARXCOMP
  70. LOGIN to compile it. Otherwise, if you boot up into it you won't
  71. have enough access rights to recompile automatically.
  72.  
  73. ========================================================
  74. EndComment
  75.  
  76. var
  77.    UserName
  78.    OldPass
  79.    NewPass
  80.    Logged
  81.    Station
  82.    NetAddress
  83.    SmartDir
  84.    MyServer
  85.    OrigServer
  86.    HomeDir
  87.    DosDir
  88.    BatName
  89.    BatFile
  90.    UseMarxLogin
  91.    Shell
  92.    PasswordExpDays
  93.    SkipError
  94.    Servers
  95.    StatusWin
  96.  
  97.  
  98. Comment
  99. ========================================================
  100.  
  101. If UseMarxLogin is set to true then this program will use the MarxMenu
  102. API call to log into the network. If set to false the it will shell
  103. Novell's LOGIN.EXE program.
  104.  
  105. If UseMarxLogin is set to true, and you are using 386 NetWare then you
  106. will have to add the following command to your AUTOEXEC.NCF file:
  107.  
  108. SET ALLOW UNENCRYPTED PASSWORDS = ON
  109.  
  110. ========================================================
  111. EndComment
  112.  
  113. UseMarxLogin = True
  114.  
  115. Shell = CleanFileName(ReadEnv('COMSPEC'))
  116. MyServer = NovDefaultServer
  117. OrigServer = MyServer
  118. NovServers(Servers)
  119. Logged = ReadEnv('LOGGED') = 'TRUE'
  120.  
  121. Comment
  122. ========================================================
  123.  
  124. If Environment variables USERNAME and PASSWORD are set, this menu
  125. will attempt to log into the network using these values. This allows
  126. for automatic login. You can also pass the parameters on the command
  127. line as follows.
  128.  
  129. MarxMenu Login <Name> <Password>
  130.  
  131. The name may contain a referrence to a server: Server/Name
  132.  
  133. ========================================================
  134. EndComment
  135.  
  136. ;----- If CapsLock key is on then override default login
  137.  
  138. SkipError = False
  139.  
  140. if not Logged
  141.    if CapsLock
  142.       CapsLock Off
  143.    else
  144.       UserName = ParamStr(2)
  145.       if UserName = '' then UserName = ReadEnv('USERNAME')
  146.       if UserName > ''
  147.          OldPass = ParamStr(3)
  148.          if OldPass = '' then OldPass = ReadEnv('PASSWORD')
  149.          if OldPass > ''
  150.             SkipError = True
  151.             Login (UserName,OldPass)
  152.             SkipError = False
  153.             if PasswordNeedsChanged
  154.                Logged = False
  155.                Suggest 'C'
  156.             endif
  157.          endif
  158.       endif
  159.    endif
  160. endif
  161.  
  162. if not Logged
  163.    LoginFromScreen
  164. endif
  165.  
  166. NovSetPrimaryServer (MyServer)
  167. NovSetPreferredServer (MyServer)
  168.  
  169. UserName = NovMyLoginName
  170. SetEnv ('NET=')
  171. SetEnv ('LOGGED=')
  172. SetEnv ('USERNAME=' + UserName)
  173. SetEnv ('PASSWORD=')
  174.  
  175. ;----- Another Server Selected
  176.  
  177. if MyServer <> OrigServer
  178.    SetEnv ('BOOTUP=STARTUP')
  179.    SetEnv ('LOGGED=TRUE')
  180.    NovMapDrive('F',MyServer + '/SYS:LOGIN')
  181.    ChDir('F:\LOGIN')
  182.    ExitMenu
  183. endif
  184.  
  185. Comment
  186. ========================================================
  187.  
  188. Here we set a different directory for a program depending on if we
  189. have a color or monochrome monitor.
  190.  
  191. ========================================================
  192. EndComment
  193.  
  194. if VideoMode = Mono
  195.    SmartDir = 'F:\PUBLIC\MSMART'
  196. else
  197.    SmartDir = 'F:\PUBLIC\CSMART'
  198. endif
  199.  
  200. ;----- You can't assume that you have an F: drive unless you map it.
  201.  
  202. NovMapDrive ('F','SYS:\LOGIN')
  203.  
  204. ;----- Here we calculate a home directory for each user.
  205.  
  206. HomeDir = 'F:\HOME\' + UserName
  207. if UserName = 'SUPERVISOR' then HomeDir = 'F:\SYSTEM'
  208. if not ExistDir(HomeDir) then HomeDir = 'F:\PUBLIC\UTIL'
  209.  
  210. Comment
  211. ========================================================
  212.  
  213. Here we calulate the the name of the dos directory that matches the
  214. version of dos we are running. The directory for DOS 5.0 would be
  215. F:\PUBLIC\DOSV5.00
  216.  
  217. ========================================================
  218. EndComment
  219.  
  220. DosDir = 'F:\PUBLIC\DOSV' + DosVersionString
  221.  
  222. ;----- DR DOS
  223.  
  224. if ReadEnv('OS') > ''
  225.    DosDir = 'F:\PUBLIC\' + ReadEnv('OS') + ReadEnv('VER')
  226. endif
  227.  
  228. Comment
  229. ========================================================
  230.  
  231. Here's where we map our drives. This does not set the search path.
  232. You set that explicitly by writing to the PATH environment variable.
  233.  
  234. Drive map commands may contain server and volume referrences:
  235.  
  236. ========================================================
  237. EndComment
  238.  
  239. NovMapRoot ('H', HomeDir)           ;Home Directory
  240. NovMapRoot ('N','F:\PUBLIC\NSK')    ;Network Survival Kit
  241. NovMapRoot ('O', DosDir)            ;Dos Directory
  242. NovMapRoot ('U','F:\PUBLIC\UTIL')   ;Utilities Directory
  243. NovMapRoot ('P','F:\PUBLIC')        ;Public Directory
  244. NovMapRoot ('L','F:\LOGIN')
  245. if NovConsoleOperator
  246.    NovMapRoot ('V','F:\SYSTEM')     ;System Directory
  247. endif
  248.  
  249. if MyServer = 'TYME'
  250.    NovMapDrive ('I','VOL1:')
  251.  
  252.    ;----- Here's where I log into a second server.
  253.  
  254.    if PosInList('TYME2',Servers) > 0
  255.       NovLogin('TYME2/' + UserName,OldPass)
  256.       NovMapDrive('K','TYME2/SYS:')
  257.    endif
  258.  
  259.    ;----- Here's where I log into a third server.
  260.  
  261.    if PosInList('TSS',Servers) > 0
  262.       NovLogin('TSS/' + UserName,OldPass)
  263.       NovMapDrive('J','TSS/SYS:')
  264.    endif
  265. endif
  266.  
  267. if ExistDir SmartDir
  268.    NovMapRoot ('S',SmartDir)
  269. endif
  270.  
  271. ;----- Turbo Pascal 6
  272.  
  273. if ExistDir (HomeDir + '\TP6') then NovMapRoot ('T',HomeDir + '\TP6')
  274.  
  275. ;----- Windows fake root is W:
  276.  
  277. if ExistDir (HomeDir + '\WIN') then NovMapRoot ('W',HomeDir + '\WIN')
  278.  
  279. ;----- If no drive C then use home directory
  280.  
  281. if not ExistDir ('C:\') then NovMapRoot('C','H:')
  282.  
  283. ;----- Here we define our search paths.
  284.  
  285. SetEnv ('PATH=T:\;H:\;U:\;N:\;O:\;P:\;V:\;S:\;')
  286.  
  287. FixPath    ;Verifies all search paths exist
  288.  
  289. ChDir (HomeDir)
  290.  
  291. ;----- Here's where we set master environment variable strings
  292.  
  293. SetEnv ('STATION=' + Station)
  294. if Left(Shell,2) <> 'C:' then SetEnv ('COMSPEC=O:\COMMAND.COM')
  295. SetEnv ('PROMPT=$e[1;33m$p: $e[0;32m')
  296. SetEnv ('MXECHO=OFF')
  297. if UserName <> 'MARC'
  298.    SetEnv ('PD.EXE=/$F:\HOME\PD.PIC')
  299. else
  300.    SetEnv ('PD.EXE=/$H:\PD.PIC')
  301. endif
  302.  
  303. Comment
  304. ========================================================
  305.  
  306. If a TEMP environment variable is set, MarxMenu will use it for
  307. temporary batch files. This is compatible with DOS 5 and Windows
  308. conventions. The users should be given full access rights to this
  309. directory. I'm using \TMPFILES for my network.
  310.  
  311. ========================================================
  312. EndComment
  313.  
  314. if ExistDir('\TMPFILES') then SetEnv('TEMP=' + CleanFileName('\TMPFILES'))
  315.  
  316. Comment
  317. ========================================================
  318.  
  319. Opens a semaphore that XMETER can read.
  320. To see how many users are users are on with XMETER type:
  321. XMETER LOGIN /U
  322.  
  323. ========================================================
  324. EndComment
  325.  
  326. NovOpenSemaphore ('XM-LOGIN',0)
  327.  
  328. ;----- Turn NumLock key on if in NumLock group.
  329.  
  330. if NovInGroup('NUMLOCK')
  331.    NumLock On
  332. else
  333.    NumLock Off
  334. endif
  335.  
  336. ;----- LOGIN is set to BOOTUP if logging in for the first time
  337.  
  338. if UpperCase(ReadEnv('BOOTUP')) <> 'LOGN' then ExitMenu
  339.  
  340. Comment
  341. ========================================================
  342.  
  343. In order to load TSRs, MarxMenu writes a temporary batch file and
  344. exits. The STARTUP.BAT file then jumps to this batch file.
  345.  
  346. ========================================================
  347. EndComment
  348.  
  349. ;----- Create temporary batch file for rest of login sequence
  350.  
  351. BatName = 'H:' + NamePart(BatFileName) + '.BAT'
  352. SetEnv ('BOOTUP=' + BatName)
  353. FileAssign(BatFile,BatName)
  354. FileCreate(BatFile)
  355.  
  356. ;----- To debug, set ECHO ON and add PAUSE commands
  357.  
  358. if DosVersionString < '3.30'
  359.    WriteBat('ECHO OFF')
  360. else
  361.    WriteBat('@ECHO OFF')
  362. endif
  363.  
  364. WriteBat ('SET BOOTUP=')
  365. ;WriteBat ('MARK > NUL')
  366. if UserName <> 'CLEAN' then WriteBat ('CASTAWAY /W=0 /I=0')
  367.  
  368. ;----- Load Lan Assist
  369.  
  370. if NovInGroup ('LANASSIST')
  371.    WriteBat ('F:\PUBLIC\QEMM\LOADHI P:LA\LA +N >NUL')
  372. endif
  373.  
  374. Comment
  375. ================================================================
  376.  
  377. This next section deals with running special programs bases on the
  378. physical station number rather than by user. This deals with special
  379. hardware that needs software drivers loaded.
  380.  
  381. ================================================================
  382. EndComment
  383.  
  384. ;----- CD ROM Machine
  385.  
  386. ;if NetAddress = '255:2'
  387. ;   WriteBat ('CD\PUBLIC\MA')
  388. ;   WriteBat ('MSCDEX.EXE /D:MSCD003 /M:12')
  389. ;   WriteBat ('MAR C:\ RW=/ /C')
  390. ;endif
  391.  
  392. ;----- Vicki's Printer
  393.  
  394. if NetAddress = '255:65'
  395. ;   WriteBat('P:PA\PA P=1 M=200 T=10 Q1=TYME/VICKI')
  396. ;   Capture('VICKI',1)
  397. endif
  398.  
  399. ;----- Grace's Printer
  400.  
  401. if NetAddress = '255:68'
  402. ;   WriteBat('P:PA\PA P=1 M=200 T=10 Q1=TYME/GRACE')
  403. ;   Capture('GRACE',1)
  404. endif
  405.  
  406. ;----- Nita's Printer
  407.  
  408. if NetAddress = '255:E8'
  409. ;   WriteBat('P:PA\PA P=1 M=200 T=10 Q1=TYME/NITA')
  410. ;   Capture('NITA',1)
  411. endif
  412.  
  413. if (NetAddress = '255:C3') or (NetAddress = '254:C3')
  414.    WriteBat('MODE BW80')
  415. endif
  416.  
  417. Comment
  418. ================================================================
  419.  
  420. This next section deals with running special programs bases on the
  421. users preferrences.
  422.  
  423. ================================================================
  424. EndComment
  425.  
  426. if UserName = 'MARC'
  427.    WriteBat('KBD 6 NumOff');
  428.    Capture('DOT',1)
  429.    Capture('LASER',2)
  430.    ChDir('TP6')
  431. endif
  432.  
  433. if UserName = 'VICKI'
  434.    Capture('LASER',2)
  435.    WriteBat('KBD 6');
  436.    WriteBat('MOUSE')
  437. endif
  438.  
  439. if UserName = 'KEVIN'
  440.    WriteBat('KBD 0,0 NumOn');
  441.    Capture('LASER',1)
  442.    Capture('DOT',2)
  443.    SetEnv('PROMPT=($p)')
  444.    SetEnv('PATH=' + ReadEnv( 'Path' ) + ';f:\home\kevin\brief' )
  445.    ChDir('MARX')
  446. endif
  447.  
  448. if UserName = '386'
  449.    WriteBat('KBD 6 NumOff');
  450.    Capture('DOT',1)
  451.    Capture('LASER',2)
  452. endif
  453.  
  454. if UserName = 'TBBS'
  455.    Capture('DOT',1)
  456.    Capture('LASER',2)
  457.    ChDir('I:\BBS\TBBS')
  458.    NovMapDrive('H','I:')
  459.    SetEnv('D.EXE=/O/I')
  460.    WriteBat('CASTOFF')
  461.    WriteBat('DROPTO ' + BatName + ' R1')
  462. endif
  463.  
  464. if UserName = 'GRACE'
  465.    WriteBat('KBD 6 NumOn');
  466.    Capture('LASER',2)
  467. endif
  468.  
  469. if UserName = 'NITA'
  470.    WriteBat('KBD 6 NumOn CapsOn');
  471.    Capture('LASER',2)
  472. endif
  473.  
  474. if UserName = 'WORK'
  475.    WriteBat('KBD 6 NumOff');
  476.    Capture('DOT',1)
  477.    Capture('LASER',2)
  478. endif
  479.  
  480. ;----- Load SideKick if in Sidekick Group
  481.  
  482. if NovInGroup 'SIDEKICK'
  483.    WriteBat ('KBD CR')
  484.    WriteBat ('F:\PUBLIC\QEMM\LOADHI SWAPSK/N/G/D' + HomeDir + ' >NUL')
  485.    WriteBat ('SK')
  486.    WriteBat ('CLS')
  487. endif
  488.  
  489.  
  490. ;----- Load SideKick 2 if in SK2 Group
  491.  
  492. if NovInGroup 'SK2'
  493.    WriteBat ('CD SK2')
  494.    WriteBat ('SK2')
  495.    WriteBat ('CD ..')
  496. endif
  497.  
  498.  
  499. Comment
  500. ================================================================
  501.  
  502. The batch file ends by jumping to personal menu, if there is one, or
  503. the default menu if there isn't. DROPTO.BAT is used to erase the
  504. temporary batch file that this menu creates.
  505.  
  506. ================================================================
  507. EndComment
  508.  
  509. if ExistFile ('F:\HOME\' + UserName + '\' + UserName + '.MNU')
  510.    WriteBat ('DROPTO ' + BatName + ' MARX ' + UserName)
  511. endif
  512.  
  513. WriteBat ('DROPTO ' + BatName + ' MARX TYME')
  514.  
  515. FileClose(BatFile)
  516.  
  517. ExitMenu
  518.  
  519. ;===============================================================
  520.  
  521. ;----- Procedure Definitions
  522.  
  523. Procedure WriteBat (BatLine)
  524.    FileWriteln(BatFile,BatLine)
  525. EndProc
  526.  
  527.  
  528. Procedure Pause
  529.    WriteBat ('PAUSE')
  530. EndProc
  531.  
  532.  
  533. Procedure Capture (Queue, PrinterPort)
  534. var PortSt
  535.    PortSt = Str(PrinterPort)
  536.    WriteBat ('P:CAPTURE Q=' + Queue + ' C=1 NB NFF TI=5 L=' + PortSt + '>NUL')
  537. EndProc
  538.  
  539.  
  540. ;----- Select colors and prepare screen
  541.  
  542. Procedure LoginFromScreen
  543.    if ColorScreen
  544.       TextColor White Red
  545.       BoxBorderColor Green Brown
  546.       BoxInsideColor Black Brown
  547.       ClearScreen 176
  548.       ClockColor Black Brown
  549.       TextColor Black Green
  550.       BoxHeaderColor Yellow Mag
  551.       Shadow
  552.    else
  553.       TextColor Grey Black
  554.       ClearScreen 176
  555.       TextColor Black Grey
  556.       BoxBorderColor Black Grey
  557.       BoxInsideColor Black Grey
  558.       BoxHeaderColor Black Grey
  559.       ClockColor Black Grey
  560.    endif
  561.    BlankMessage = 'Netware Login'
  562.    ClockMode = 262
  563.    GotoXY 1 25
  564.    ClearLine
  565.    WriteCenter "Computer Tyme Master Network Login Menu"
  566.    SingleLineBox
  567.    Explode Off
  568.    ShadowColor Grey Red
  569.    if ColorScreen
  570.       DrawBox 3 2 74 5
  571.       ClockPos 42 5
  572.       TextColor Blue Brown
  573.    else
  574.       DrawBox 3 2 76 5
  575.       ClockPos 44 5
  576.    endif
  577.    WriteCenter 'Computer Tyme Software Development Laboratory'
  578.    Writeln
  579.    TextColor Black Brown
  580.    WriteCenter '───────────────────────────────────────────────────────'
  581.    Writeln
  582.    TextColor Black Brown
  583.    Write "  (C) 1990 by Marc Perkel"
  584.    DoubleLineBox
  585.    BlankTime = 10
  586.  
  587.    Explode On
  588.    BlockBox
  589.    BoxBorderColor Green Blue
  590.    BoxInsideColor Yellow Blue
  591.    BoxHeader = " Station Information "
  592.    if ColorScreen
  593.       DrawBox 39 17 38 6
  594.       TextColor Yellow Blue
  595.    else
  596.       DrawBox 41 17 38 6
  597.       TextColor Grey Black
  598.    endif
  599.    StatusWin = CurrentWindow
  600.    UpdateStatusWindow
  601.  
  602.    ChooseOption
  603.  
  604.    EraseTopWindow
  605.    EraseTopWindow
  606.    EraseTopWindow
  607.    TextColor Grey Black
  608.    ClearScreen
  609. EndProc
  610.  
  611.  
  612. Procedure ChooseOption
  613. var Ch X
  614.    repeat
  615.       X = 4
  616.       if NumberOfElements(Servers) > 1 then X = 5
  617.       DrawBox 3 17 26 X
  618.       UseArrows
  619.       OnScreenOnly
  620.       InverseColor Yellow Cyan
  621.       Writeln '  L - Login to Network'
  622.       Write   '  C - Change Password'
  623.       if NumberOfElements(Servers) > 1
  624.          Writeln
  625.          Write   '  S - Select Server'
  626.       endif
  627.       Ch = UpperCase(ReadKey)
  628.       if (Ch = 'L') or (Ch = 'C') or (Ch = 'S')
  629.          EraseTopWindow
  630.          if Ch = 'L'
  631.             LoginToNetwork (False)
  632.          endif
  633.          if Ch = 'C'
  634.             LoginToNetwork (True)
  635.          endif
  636.          if Ch = 'S'
  637.             SelectServer
  638.          endif
  639.       endif
  640.    until Logged
  641. EndProc
  642.  
  643.  
  644. Procedure Warning (St)
  645.    BoxHeader ' Warning '
  646.    DrawBox 3 17 length(St) + 4 3
  647.    Write Char(7) ' ' St
  648.    Wait 300
  649.    EraseTopWindow
  650. EndProc
  651.  
  652.  
  653. Procedure LoginToNetwork (CP)
  654. var NewPassVerify
  655.    BoxHeader = ' Logging into Server * ' + MyServer + ' '
  656.    DrawBox 3 10 50 4
  657.    UseArrows Off
  658.    Security
  659.    repeat
  660.       if UserName = ''
  661.          Write ' Name: '
  662.          UserName = UpperCase(Readln)
  663.          Writeln
  664.       endif
  665.       Write ' Password: '
  666.       OldPass = UpperCase(Readln)
  667.       Write CR
  668.       ClearLine
  669.       Login (UserName,OldPass)
  670.       if not CP
  671.          CP = PasswordNeedsChanged
  672.          if CP then Warning('Time to change your password!')
  673.       endif
  674.       if CP
  675.          if LastKey <> Esc
  676.             repeat
  677.                Write ' New Password: '
  678.                NewPass = UpperCase(Readln)
  679.                Write CR
  680.                ClearLine
  681.                if NewPass = OldPass then Warning('Select a NEW Password!')
  682.             until NewPass <> OldPass
  683.          endif
  684.          if LastKey <> Esc
  685.             Write ' Verify: '
  686.             NewPassVerify = UpperCase(Readln)
  687.             Write CR
  688.             ClearLine
  689.             if NewPass = NewPassVerify
  690.                NovChangePassword (OldPass,NewPass)
  691.                if NovResult <> 0
  692.                   Warning ('Password Change Failed!')
  693.                   Logged = False
  694.                endif
  695.             else
  696.                Warning('Password Typed Wrong!')
  697.                Logged = False
  698.             endif
  699.          endif
  700.       endif
  701.    ClearScreen
  702.    if not Logged
  703.       UserName = ''
  704.    endif
  705.    until (LastKey = Esc) or Logged
  706.    EraseTopWindow
  707. EndProc
  708.  
  709.  
  710. Procedure Login (User, Pass)
  711.    if UseMarxLogin
  712.       NovLogin (MyServer + '/' + User, Pass)
  713.       if NovResult = 223 then NovResult = 0  ;grace login
  714.       Logged = NovResult = 0
  715.       if Logged
  716.          NovMapDrive('F',MyServer + '/SYS:LOGIN')
  717.       endif
  718.    else
  719.       ClearScreenFirst Off
  720.       UseCommand On
  721.       StuffKbd = Pass + CR
  722.       Execute ('LOGIN.EXE ' + MyServer + '/' + User + '>nul')
  723.       Logged = ExistDir ('F:\SYSTEM')
  724.    endif
  725.    if not Logged and not SkipError
  726.       if NovResult = 254
  727.          Warning('All Logins Disabled!')
  728.       else
  729.          if NovResult = 222
  730.             Warning('Password Expired!')
  731.          else
  732.             if NovResult = 220
  733.                Warning('Account Disabled!')
  734.             else
  735.                if (NovResult = 218) or (NovResult = 219)
  736.                   Warning('Invalid Login Time!')
  737.                else
  738.                   if NovResult = 197
  739.                      Warning('Intruder Lockout!')
  740.                   else
  741.                      if NovResult = 255
  742.                         Warning('Bad Password!')
  743.                      else
  744.                         Warning('Login Failed! '+ Str(NovResult))
  745.                      endif
  746.                   endif
  747.                endif
  748.             endif
  749.          endif
  750.       endif
  751.    endif
  752. EndProc
  753.  
  754.  
  755. Procedure PasswordNeedsChanged
  756. var X
  757.    X = NovPasswordExpDate (UserName)
  758.    if X = 0 then Return False
  759.    Return (X - Today) / SecondsInDay <= 5
  760. EndProc
  761.  
  762.  
  763. Procedure SelectServer
  764.    DrawBox 25 9 20 NumberOfElements (Servers) + 2
  765.    MyServer = PickOne (Servers)
  766.    NovSetPrimaryServer (MyServer)
  767.    NovSetPreferredServer (MyServer)
  768.    EraseTopWindow
  769.    UpdateStatusWindow
  770. EndProc
  771.  
  772.  
  773. Procedure UpdateStatusWindow
  774.    SetTopWindow StatusWin
  775.    ClearScreen
  776.    NetAddress = NovStationAddress (NovConnection)
  777.    Station = Str(NovConnection)
  778.    while length(Station) < 3
  779.       Station = '0' + Station
  780.    endwhile
  781.    Writeln '           Server: ' MyServer
  782.    Writeln '          Network: ' NetAddress
  783.    Writeln '       Connection: ' Station
  784.    Write   '      DOS Version: ' DosVersionString
  785.    if StatusWin <> CurrentWindow
  786.       SetWindowUnder (StatusWin,StatusWin + 1)
  787.    endif
  788. EndProc
  789.  
  790.  
  791. Procedure AfterHours
  792.    Return (DayOfWeek = Sun) or (DayOfWeek = Sat) or (Hour > 18) or (Hour < 5)
  793. EndProc
  794.  
  795. ;----- Show Item for Debugging
  796.  
  797. Procedure ShowMe (Item)
  798.    DrawBox 1 23 80 3
  799.    Write ' '
  800.    TextColor Yellow Cyan
  801.    Write Item
  802.    Wait 300
  803.    EraseTopWindow
  804. EndProc ;ShowItem
  805.  
  806.