home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / lan / alogin21.zip / ALOGIN.DOC < prev    next >
Text File  |  1993-05-07  |  18KB  |  370 lines

  1.  
  2.                          AutoLogin
  3.   
  4.   The automated login program for the LANtastic Network Operating System. 
  5.  
  6.  
  7.     "Real programmers don't write specs - users should consider 
  8.      themselves lucky to get any programs at all and take what they get."
  9.  
  10.                - From "Real Programmers Don't Write Specs"
  11.  
  12.  
  13. In just a moment, I'll start right in to the documentation, but first,
  14. here's a word, or I should say many words, that I have to tell you:
  15.  
  16. Yes, I wrote this program, and I have found that it works fine on my
  17. computer in my office.  If, for some very odd reason, it does not work on
  18. yours; or further, if it causes damage to your system for any reason,
  19. I will assume NO responsibility for such damages.  Also, noting that the
  20. programmer was an employee of Artisoft, Inc. until May 14, 1993, note that 
  21. Artisoft is not responsible for the contents of this documentation
  22. file; the functioning of the program which this documentation
  23. describes (or any damages resulting from the use or misuse of the
  24. program); and further, Artisoft Technical Support and other employees
  25. of Artisoft, Inc. are NOT RESPONSIBLE FOR SUPPORTING THIS PROGRAM.
  26. If you have problems or suggestions when using this program, direct
  27. them to the author, J Gerring, using ONLY the following methods:
  28.  
  29.     US Mail:          5500 N. Valley View #108, Tucson, AZ  85718
  30.         CompuServe Email: 73650,471 (best way)
  31.  
  32. Do not call the author during business hours for support, this program was
  33. not written during business hours, it will not be supported during
  34. business hours.
  35.  
  36. Which leads me to the following:  The ALOGIN program is hereby declared
  37. Public Domain (starting with version 1.2) and the source code is included.
  38. You may freely use it, distribute it as the file ALOGIN.ZIP (containing
  39. the files ALOGIN.EXE, AUTOLOG.EXE, ALOGIN.DOC and ALOGIN.C) and give as many
  40. copies to your friends as you like.  If you find it useful, fun, and
  41. interesting, drop me an email or a postcard and say thanks!  This program is
  42. copyrighted, so if you are interested in using any part or all of the source
  43. code in your own programs, please contact me for licensing.  In fact, you
  44. probably would be better off purchasing Artisoft's LANtastic LPI (LANtastic
  45. Programmer's Interface) product instead, since it handles all of the low-level
  46. DOS interrupts for logins, uses, etc. for you.  But if you like to read source
  47. code, here it is!
  48.  
  49. Yet another Note:
  50. Previous versions of ALOGIN were designated as shareware.  I changed my
  51. mind.  Anybody could write this program, I just happened to take a weekend
  52. out to do it. Consider any earlier versions Public Domain also, but you
  53. should probably upgrade to this version anyway.  Alogin was compiled under
  54. the Microsoft(R) C/C++ complier, version 7.0.
  55.  
  56.  
  57. -----------------------------------------------------------------------------
  58.  
  59. Release History:
  60.     
  61.     10-1-89   -  First release of program.
  62.  
  63. v1.0    10-2-89   -  Modified program to continue processing after encountering
  64.              an invalid command statement in user's data file.  Ok,
  65.              but at least I found this one before it was pointed out...
  66.              (this release says "AutoLogin 1.0 ..." in opening  
  67.                      message, previous version did not.)
  68.  
  69. v1.1    10-13-89  -  Added multiple adapter support. Previously, AutoLogin
  70.              would only work on adapter 0.  See documentation for 
  71.              further details.
  72.  
  73. v1.2    02-09-90  - Fixed a minor bug in the parser, re-designated the
  74.                     thing as Public Domain, and gave you the source code 
  75.                     so you can fix the rest of the bugs!  (just kidding, 
  76.                     if you find any, please let me know.)
  77.  
  78. v2.0    03-14-93  - Wow, long time, no updates!  Ok, here's a new version.
  79.             This version adds the WAITFOR "verb," which is used in
  80.             place of the LOGIN verb so ALOGIN will wait for a server
  81.             to come on line.  Hitting ESCape cancles the wait. See
  82.             main text for details.  This version also has significantly
  83.             better and more readable source code.
  84.  
  85. v2.1    05-07-93  - Added the new AUTO verb, which is used to turn on and off 
  86.             the LANtastic Auto-login feature.  ALOGIN also now turns 
  87.             Auto-login off at the start of the program. More details in
  88.             the main text. 
  89.             Also, ALOGIN now checks to make sure the LANtastic 
  90.             redirector (REDIR) is running before it trys to do any
  91.             network calls.  There were also a few minor bug fixes and
  92.             cosmetic changes made to this version.  It's probably the 
  93.             last version I'll distrubute.
  94.  
  95. -----------------------------------------------------------------------------
  96.  
  97.             Ok, here's the documentation! (finally...)
  98.  
  99. OVERVIEW     (or, after writing a program, how do I tell you about it?)
  100.  
  101. Note that this documentation file assumes that the reader has some
  102. experience with the LANtastic Network Operating System.  If you're
  103. a brand new user, I'd suggest reading up on LANtastic first.  The function of
  104. ALOGIN is to provide an easy interface for logging into, and using devices
  105. on LANtastic servers from the workstation (or redirector).  In general, it
  106. does this by accepting a username and a password as keyed input then
  107. reading a data file which the system administrator (or whoever) has set up
  108. for the specified username.  Details follow:
  109.  
  110.  
  111. SETTING UP   (there's always a setup, but don't be paranoid...)
  112.   
  113. Before you run ALOGIN, you need to set up a data file for the user.  This
  114. file is just an ASCII file which you need to locate in your \LANTASTI file
  115. directory.  ALOGIN determines the file name by the following algorithm:
  116.  
  117.     if username (entered at run time) is less than 9 characters then
  118.         filename = \LANTASTI\username.DAT
  119.     else
  120.         concatonate first 4 characters of username with last 4 
  121.         characters and
  122.                 filename = \LANTASTI\username[1 to 4]+username[n-4 to n].DAT
  123.  
  124. Examples:   
  125.     
  126.     username entered                 filename extracted
  127.         ----------------                 ------------------
  128.         MARK                 MARK.DAT
  129.     $MANAGER             $MANAGER.DAT
  130.     PROGRAMMER             PROGMMER.DAT
  131.     ADMINISTRATION1             ADMIION1.DAT
  132.      ---------------------------------------------------
  133.  
  134. Note: The above algorithm is used by ALOGIN.EXE.  On a large LAN, such as
  135. Artisoft's, you may not want to try to maintain a bunch of very similar
  136. configuration files that have different names across the LAN.  For that reason,
  137. I have included a special version of ALOGIN v2.1 called AUTOLOG.EXE.  It uses
  138. the hardwired name \LANTASTI\ALOGIN.DAT for the input file, but still uses the
  139. username and password you enter at run time to do logins.  That way, you don't
  140. have to remember everybody's username, you can just copy your default
  141. ALOGIN.DAT file to their computer.  AUTOLOG.EXE displays v2.1a as its version
  142. number. 
  143.  
  144. Now that you know how the filename is extracted, then get into your
  145. favorite word processing program and create an ASCII username.DAT file
  146. following these easy rules:
  147.  
  148.     1. Basic rule of thumb: ALOGIN processes NET LOGIN or NET USE 
  149.        type statements.  Statments are entered one (1) per line, with the 
  150.        NET part omitted.  
  151.        1a. As of version 2.0, the WAITFOR statement is supported.  This
  152.        is formatted exactly like a LOGIN statment, where WAITFOR replaces
  153.        LOGIN.
  154.        1b. As of version 2.1, the AUTO verb is now supported.  Options for AUTO
  155.        are ON or OFF.  This command either sets the LANtastic Auto-login 
  156.        name and password to the name and password you entered at the prompts
  157.        (that's the ON choice) or disables Auto-login (the OFF choice).  See
  158.        rule 6b for more info.
  159.     2. If you feel like putting in a comment, start the line with a 
  160.        semicolon character (;).  
  161.     3. Put in as many blank lines and other white space characters BETWEEN
  162.        statement lines as you like.
  163.     4. Don't put comments on the same line as a command statment.
  164.     5. Don't put extra arguments on a statement line, or you will get an
  165.        error message from ALOGIN concerning that line.
  166.     6. LOGIN lines contain only the server name and an optional
  167.            adapter number, ALOGIN assumes that the  user has the same 
  168.            password on each server.  (note: this
  169.        was done to create tight security; you don't have your password
  170.        published in an easily readable .BAT or .DAT file anywhere.  If you
  171.        don't use passwords, just hit the enter key when ALOGIN prompts
  172.        you for password.)  If an adapter number is not entered, ALOGIN
  173.            will attempt the login on all possible adapters, starting with
  174.            adapter 0.  If an adapter number is specified, ALOGIN will
  175.            attempt to login to that server ONLY on that adapter number.  Note 
  176.        that ALOGIN will run faster if you specify the adapter number, so if
  177.        you just have one adapter in your computer you may want to put the 
  178.        adapter number 0 at the end of each LOGIN line.
  179.            DO NOT enter the '\\' in front of the server name on the LOGIN line.
  180.            E.g. LOGIN TECHDATA is right, LOGIN \\TECHDATA is wrong.
  181.        6a. WAITFOR lines are just like LOGIN lines including the optional
  182.        adapter number.  The only difference is that when ALOGIN encounters
  183.        a WAITFOR it will keep trying to log you into that server until 
  184.        (a) it succeeds or (b) you hit ESCape key and cancel it.  If you 
  185.        cancel, ALOGIN displays a message to let you know it's stopped
  186.        trying to find that server and then continues processing with the 
  187.        next line in the data file.
  188.        6b. AUTO lines contain the word AUTO followed by either ON or OFF.  
  189.        AUTO ON enables LANtastic's Auto-login feature with the username and
  190.        password you entered at the prompts.  AUTO OFF disables the Auto-
  191.        login feature.  When it starts, ALOGIN turns off LANtastic's Auto-
  192.        login, so you will need to turn it on if you want to use it.
  193.        This only works on LANtastic NOS version 4.1 and above, as
  194.        the Auto-login feature did not exist in earlier versions.  The 
  195.        advantage to setting AUTO ON in your ALOGIN data file is that you 
  196.        don't need to use LOGIN statements from that point on in the file, 
  197.        you can just use USE commands and LANtastic will take care of the 
  198.        LOGINs.  It also means that any NET USE commands you issue later 
  199.        will use the username and password you entered here, which should
  200.        be the ones you want to use.  By default the LANtastic redirector 
  201.        uses your machine (the name specified on the REDIR command line)
  202.        name as the Auto-login user name without a password, which is 
  203.        probably not what you want it set to if you are using ALOGIN.  If 
  204.        this discussion of the AUTO verb seems confusing, read the section 
  205.        in your LANtastic NOS manual about Auto-login and it should all
  206.        become clear to you!  Also, check out the example below.
  207.     7. USE lines are done just like you were typing them into the
  208.            keyboard or in a BAT file, but without the NET part.
  209.  
  210. Here's a (real live) example file:
  211.  
  212. ;top of file
  213. ;This file logs me into all the machines on the network that I want to use.
  214. ;Additionally, I can write a whole novel of comments!
  215.  
  216. ;login to techdata 
  217.  
  218. login techdata
  219. use f: \\techdata\rootd
  220. use g: \\techdata\root
  221. use m: \\techdata\rootd
  222. ;login to Lu's machine, try login only on adapter 1
  223. login lka 1
  224. use lpt1 \\lka\@laser
  225. ;wait for TE_LASER to come on line then log in.
  226. waitfor te_laser
  227. use lpt2 \\te_laser\@printer
  228. use l: \\lka\root
  229. ;do bbs login
  230. login bbs
  231. use n: \\bbs\root
  232. use o: \\bbs\rootd
  233.  
  234. login bruce lee
  235. ;note that the above line WILL produce an error message!
  236. ;end of login file
  237.  
  238. Here's a file that will get you the same results, but using the AUTO ON verb:
  239.  
  240. ;top of file
  241. ;This file logs me into all the machines on the network that I want to use.
  242. ;Additionally, I can write a whole novel of comments!
  243.  
  244. ;enable LANtastic Autologin with my username and password
  245. auto on
  246.  
  247. ;login to techdata 
  248. use f: \\techdata\rootd
  249. use g: \\techdata\root
  250. use m: \\techdata\rootd
  251. ;login to Lu's machine, try login only on adapter 1
  252. login lka 1
  253. use lpt1 \\lka\@laser
  254. ;wait for TE_LASER to come on line then log in.
  255. waitfor te_laser
  256. use lpt2 \\te_laser\@printer
  257. use l: \\lka\root
  258. ;do bbs uses
  259. use n: \\bbs\root
  260. use o: \\bbs\rootd
  261.  
  262. ;end of login file
  263.  
  264. Note that you can still use LOGIN and WAITFOR commands when AUTO is ON.
  265.  
  266.  
  267. RUNNING ALOGIN    (one small set of keystrokes for humankind...[apol. to N.A.])
  268.  
  269. Quite simple: Just type it in at the command line or put it in a batch file.
  270.  
  271. I will mention a couple of things.  First, as noted before, ALOGIN will prompt
  272. you for a USERNAME and a PASSWORD.  The assumption is that you use the same
  273. username and password across the LAN.  If this is not true, you will need to
  274. create a \LANTASTI\username.DAT file for each username that you use on the LAN
  275. and invoke ALOGIN multiple times.  Or, you can make it easy on yourself and use
  276. the same username across the LAN...  If you have different passwords on each
  277. server, the best solution is to change them all to be the same, it will save
  278. you a lot of headaches!  There are two basic Ideas behind the function of
  279. ALOGIN:
  280.  
  281. 1) To make it easy and fast to login to more than 1 server while providing
  282. good security.  ALOGIN prompts for a password (and echos *s) so that you
  283. don't have to prompt for it on each NET LOGIN line of a batch file.
  284. (which you should be doing if security matters at all on your LAN) The USE
  285. part of the program was thrown in for completeness. The WAITFOR and AUTO parts
  286. were added because they make sense for LANtastic versions 4.1 and higher.
  287.  
  288. 2) To make it easy for different people who are using the same workstation
  289. at different times to obtain access to those resources that they need to
  290. access.  For example, say you have a part-time payroll accountant and a
  291. part-time student programmer who work for the same company.  They share
  292. the same machine and office (they work non-overlapping hours, of course),
  293. and obviously need access to very different resources - and you may not
  294. want them to have access to each others resources.  Maybe the programmer
  295. is paranoid that her programs might be "missing" one day...  So, create
  296. ALOGIN data files for each one and you've headed off some potential
  297. problems!  AND maintained security.  Wow!
  298.  
  299.  
  300. WHAT HAPPENS NEXT  (or "to function correctly or not to function crrecly")
  301.                         [apol. to you-know-who]
  302.                 
  303. Ok, so, you create your data file, run ALOGIN, and enter the username and
  304. password.  Did it work?  Here's how you know...
  305.  
  306. ALOGIN displays messages in the following order:
  307.  
  308. Opening message:           --- AutoLogin for LANtastic (tm) ---
  309.                                 (c) J Gerring 1990, 1993
  310.  
  311. Username prompt:           Enter username:
  312. Password prompt:           password:
  313.  
  314. Then, when you hit enter, it checks to make sure the LAN is there and aborts if
  315. not, setting the DOS ERRORLEVEL to 2. Then, it tries to open the data file for
  316. the username you entered (or, if you're using AUTOLOG.EXE, it tries to open
  317. \LANTASTI\ALOGIN.DAT).  If no file exists, you'll hear about it - this is
  318. another aborting error condition, bad lines in the .DAT file produce error
  319. messages, but processing of the file continues.  If ALOGIN dies due to a
  320. non-existant data file (say, if you mistakenly type MMARK for your user name),
  321. the ERRORLEVEL is conveniently set to 1.  Next, it begins executing the
  322. statements from the data file, displaying info about what it's doing along the
  323. way.  You'll get messages which indicate success or failure of the data file
  324. statments.  To explain, here's a complete capture of the screen output of an
  325. ALOGIN run based on the first example data file above:
  326.  
  327.           --- AutoLogin for LANtastic (tm) ---
  328.                 (c) J Gerring 1990, 1993
  329.  
  330. Enter username: $jag
  331. password: *****
  332. LANtastic Auto-login feature disabled
  333.  
  334. Logging in...
  335.  
  336. Logged into: TECHDATA
  337. Device F: redirected to \\TECHDATA\ROOTD 
  338. Device G: redirected to \\TECHDATA\ROOT 
  339. Device M: redirected to \\TECHDATA\ROOTD 
  340. Error logging into LKA -> Duplicate redirection or login to network node LKA
  341. Error redirecting LPT1 -> Duplicate redirection or login to network node LKA
  342. Trying to login to server TE_LASER.  Press ESC to cancel retrys.
  343. Logged into: TE_LASER
  344. Device LPT2: redirected to \\TE_LASER\@PRINTER
  345. Error redirecting L: -> Duplicate redirection or login to network node LKA
  346. Error logging into BBS -> Cannot locate network name   
  347. Error redirecting N: -> Path not found 
  348. Error redirecting O: -> Path not found 
  349. Warning: Badly formatted LOGIN statement ->LOGIN BRUCE LEE<-
  350. Login finished!
  351.  
  352. Note: if I'd used the AUTO ON command in my username.DAT file, you'd see the
  353. message "LANtastic Auto-login enabled with username $JAG" in the output.
  354.  
  355. A LITTLE TROUBLE SHOOTING   (although they are often difficult targets)
  356.  
  357. Generally, your output should look like the first 4 message lines of the
  358. above example for each login and redirection in the data file (starting
  359. with the line "Logged into: TECHDATA").  If you see error messages (as in
  360. the above example), these are the most common reasons:
  361.  
  362. 1) The server specified in the LOGIN statement is not powered on.
  363. 2) Specified server is not currently running LANtastic.
  364. 3) Specified server is not running the LANtastic SERVER program.
  365. 4) You are already logged into that server, or have already redirected the
  366.    specified device.
  367.  
  368.  
  369. THE END
  370.