[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

147.0. "ALL-IN-1 username and VMS username differ LOGIN.COM" by GIDDAY::SETHI (Man from Downunder) Mon Mar 02 1992 07:07

    G'day Digits,
    
    I know that this subject has been was discussed in the previous
    conference BUT I think this is a better way to solve the problem.
    
    PROBLEM
    
    ALL-IN-1 (notice it's in UPPERCASE) username is different from the VMS
    name.  When a user logs in via a captive command procedure they are
    forced to enter their ALL-IN-1 username.
    
    PAST SOLUTIONS
    
    Solutions in the past have search OA$DATA:PROFILE.DAT using the VMS
    account name as the key field.  This has involved using MACRO-32 or
    other languages.  There is nothing wrong with this but there is a
    simple way of overcoming this problem.           
    
    NEW IMPROVED ALL-IN-1 LOGIN COMMAND PROCEDURE (as you have never seen)
    
    What I have done is to make use of the users <parsed username>.PST 
    the Permanent Symbol Table found in their ALL-IN-1 directory.  It contains
    the permanent symbol called USERNAME this symbol stores the users
    ALL-IN-1 username which I use as the parameter for the /USER= qualifier
    for the DCL command ALLIN1.
    
    THE COMMAND PROCEDURE
    
$!
$!+ 	ALL-IN-1 command procedure for a captive account
$!
$!	set noverify
$ start:
$!
$	if "''f$mode()'" .nes. "INTERACTIVE" then $ exit
$!
$ 	save_message = f$environment ( "MESSAGE" )
$ 	set message/nofacility/noidentification/notext/noseverity/notext
$!
$	vms_username = f$getjpi ( "" , "USERNAME" )
$	prcname      = f$getjpi ( "" , "PRCNAME"  )
$	if "''vms_username'" .nes. "''prcname'" 
$	then
$		Write "%SYS-I-ALREADYLOG, you are already logged into ALL-IN-1"
$		wait 00:00:05
$		goto normal_logout
$	endif
$!
$ search_pst:
$!
$	search/output=sys$login:a1username.txt [.a1]*.pst USERNAME
$	if "''$status'" .nes. "%X10D710A2" then $ goto no_diskquota
$!
$	open/read/end=no_name a1username sys$login:a1username.txt
$!
$ initial_read:
$!
$	read/end=no_name a1username username
$!
$ read_loop:
$!
$	read/end=continue_processing a1username username
$	goto read_loop
$!
$ continue_processing:
$!
$	len = f$length ( "''username'" )
$	a1name = f$extract ( 30 , len , "''username'" )
$	close a1username
$	delete/noconfirm/nolog sys$login:a1username.txt.*
$	set message 'save_message'
$!
$	assign sys$command sys$input
$	on error then $ goto abnormal_exit
$	allin1/user="''username'"/noreenter
$	goto normal_logout
$!
$ no_name:
$!
$	write sys$output "%SYS-E-NONAME, ALL-IN-1 username not found"
$	assign sys$command sys$input
$	delete/noconfirm/nolog sys$login:a1username.txt.*
$	on error then $ goto abnormal_exit
$	allin1/noreenter
$	goto normal_logout
$!
$ no_diskquota:
$!
$	write sys$output "%SYSTEM-F-EXDISKQUOTA, disk quota exceeded"
$	wait 00:00:05
$!
$ normal_logout:
$!
$	logout
$!
$ abnormal_exit:
$!
$	write sys$output "%SYSTEM-F-ABNORMALEXIT, abnormal exit"
$	wait 00:00:05
$	logout
********************************************************************************
* COPYRIGHT (c) 1992 BY                                                        *
* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS.                       *
* ALL RIGHTS RESERVED.                                                         *
*                                                                              *
* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED        *
* ONLY  IN  ACCORDANCE  OF  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE        *
* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR  ANY  OTHER        *
* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY        *
* OTHER PERSON.  NO TITLE TO AND  OWNERSHIP OF THE  SOFTWARE IS  HEREBY        *
* TRANSFERRED.                                                                 *
*                                                                              *
* THE INFORMATION IN THIS SOFTWARE IS  SUBJECT TO CHANGE WITHOUT NOTICE        *
* AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT        *
* CORPORATION.                                                                 *
*                                                                              *
* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE  OR  RELIABILITY OF ITS        *
* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.                      *
*                                                                              *
*	Author: Sunil Sethi                                                    *
*	Date: 28th Feburary 1992                                               *
*                                                                              *
*	Standard login procedure for ALL-IN-1                                  *
********************************************************************************
     
    This command procedure should be changed to suit the sites needs.  I
    used the DCL search to check for disk quotas.  You could use the DCL
    open verb to open the .PST and do a $ read/key="USERNAME", this would
    work then close the file before entering ALL-IN-1.
    
    Well I thought I would chuck this into the ring and I would be happy to
    receive a pat on the back or a kick up the you know what.  By the way I
    did write a command procedure similar to this at a customer site they
    had a login command procedure for each user with their ALL-IN-1
    username written in the login.com.
    
    I hope that this gives a new approach to solving a minor problem and I
    feel the simple approach will make it easy to maintain the command
    procedure.
    
    Sunil
    
    (We must write ALL-IN-1 like this not all-in-1 or allin1 or we have
    ways and means of making you write it correctly).
T.RTitleUserPersonal
Name
DateLines
147.1Slight problemSIOG::T_REDMONDThoughts of an Idle MindMon Mar 02 1992 09:099
    One problem. You look for the .PST in [.A1]. What happens if users have
    [.OA], [.A1V2] (and now [.A1V3]) etc. sub-directories?  No match
    against the .PST...  Of course, some sites standardize on the ALL-IN-1
    sub-directories but others, perhaps for historical reasons, have a
    variety of different names. That's why people tend to look for
    something that is reliable, like the Profile, when checking for
    differences between the ALL-IN-1 and VMS user names.
    
    Tony
147.2PROFILE.DAT is protectedUTRTSC::BOSMANWe&#039;re just sugar mice in the rainMon Mar 02 1992 10:4410
    PROFILE is reliable but ...
    ... Normal users doesn't have access to it from DCL-level.
    ... The records may become (or already are) too large to be read from
        DCL.
    ... One cannot use ALLIN1 /NOINIT to use the PROFIL data-set.
    
    So Tony, how could we solve *that* one, without give the world
    read-access?
    
    Sjaak.
147.3Use a programSIOG::T_REDMONDThoughts of an Idle MindMon Mar 02 1992 10:518
    Use an approach like the Checkmail ASSETS package. Create a small image
    which reads the profile, finds the right record, and returns the
    desired information in the form of logical names or DCL symbols. Then
    read that data with the command procedure. The image needs to be
    installed with privileges (READALL), then it can be called and used by
    anybody.
    
    Tony
147.4okUTRTSC::BOSMANWe&#039;re just sugar mice in the rainMon Mar 02 1992 13:2211
    That makes it neccesary that the customer have to buy a compiler if he
    hasn't one (or have to write it in macro) or an ASSET.
    
    Stabilize the system so you always know what your ALL-IN-1 subdirectory
    is works fine for me. Ok, I have to admit, I'm defending .0 because
    this is the way I do this for several years and customers know without
    having any problems.
    
    Thanks for your nice suggestion anyway.
    
    Sjaak.
147.5Maintenance of software and customer needs come firstGIDDAY::SETHIMan from DownunderMon Mar 02 1992 23:3829
    The login.com that I have given in this note can be changed for to meet
    the customers needs.  So the sub-directory name is really not a major
    point or a show stopper.
    
    I have written this command procedure to make life easy for the
    customer from the maintenance point of view.  All customers know how to
    write DCL command procedures (well I hope they do), therefore it should
    be easy for them to maintain the login.com but not every customer knows
    MACRO-32, C, Pascal etc. if you get my point.  The customer must come
    first the easier we make life for them the more chance we have of
    selling them goods and services, hence keeping our jobs.
    
    By the way I missed one line of code in the login.com it's the comfort
    message.  Add the following $ WRITE SYS$OUTPUT "	INITIALISING PLEASE
    WAIT .... ", or the North Americans may wish to change the spelling of
    the comfort message to "INITIALIZING PLEASE WAIT ...." (I know so many
    languages British English, American and Australian my head is starting
    to swell).
    
    A couple of things to ponder over when a customer renames a users
    account, the .PST is not updated ie the permanent symbol USERNAME.  Is
    this still the case in ALL-IN-1 3.0 can it be changed when 3.n comes
    out ?  Also when a new username is created the USERNAME permanent
    symbol is not loaded with the ALL-IN-1 username can this be changed in
    3.n ?
    
    Thanks for your comments and I hope I have helped someone out.
    
    Sunil
147.6Why not an X-ref file?TRCOA::HALSEYI&#039;d rather be sailing!Wed Apr 29 1992 00:1618
    Sorry for a late response, I'm catching up.  I have a simple question
    on this topic though.
    
    	What is the problem with simply having a little index file with two
    fields (maintained through an ALL-IN-1 Entry form) that crossreferences
    the VMS username with the A1 profile name?
    
    	The A1LOGIN.COM procedure simply does a DCL index lookup on the
    VMS username and it's got the profile name.
    
    	As for maintenance and creation of the entries, that can be
    automated using the POST_PROCESS script field on the account template,
    (as long as you fix the SM_CR_USER_DETAILS.SCP script).
    
    	Did I miss something in the discussion?
    
    	Bob Halsey, Toronto SWS
    
147.7Making life easier for the CustomerGIDDAY::SETHIMan from DownunderWed Apr 29 1992 03:4015
    G'day Bob,
    
    What I suggested got away from having to tailor ALL-IN-1 and maintain
    an extra .DAT for xreferencing etc,  I thought it would make life alot
    simpler.
    
    System manager's etc. should know how to write DCL command procedures
    but not all of them know SCRIPT,C,PASCAL etc.  This would make life
    easier for them to maintain the command procedure.
    
    BUT if you want to do anything else well that's up to you.  My command 
    procedure is an alternative to tailoring and writing software to read 
    PROFILE.DAT to setup a symbol containing the ALL-IN-1 username.
    
    Sunil
147.8Could use PROFILE directly?IOSG::PYEGraham - ALL-IN-1 Sorcerer&#039;s ApprenticeWed Apr 29 1992 09:419
    Re .6
    
    Since V2.4, the PROFILE has the VMS user name as an alternate key, so
    that could be used to do the look up, rather than having a spearate
    file to maintain. Of course you'd need to do the lookup form a program
    that was $INSTALLed with READALL, so I suppose that invalidatesit based
    on your criterion that SMs don't do code!
    
    Graham
147.9It's just a suggestionGIDDAY::SETHIMan from DownunderWed Apr 29 1992 10:1813
    G'day Graham,
    
   > so I suppose that invalidatesit based on your criterion that SMs don't do
   > code!
    
    Mate I have come across some who don't even know how to use EDT and
    that's no joke!
    
    The point is it's a suggestion that I have made and you are all free to
    use it or not.  I have used this command procedure that had other
    things added to it with success and the site I worked at was pleased.
    
    Sunil
147.10New, improved!!SWAM2::RHODEWALT_BRPillage pillage, loot lootWed Sep 09 1992 22:4136
    I like the original idea. To reduce I/O and speed things along,
    however, I would make the following changes:
    
    Change the logic of looking through all PSTs from a "search ... *.pst"
    command to a f$search("*.PST") loop.
    
    Then, instead of reading through a temporary sequential file, open each
    PST directly and use an indexed read. 
    
    Like this:
    
    	$set default sys$login
    	$pst_loop:
    	$	pst_file = f$search("[.*]*.PST")
    	$	if pst_file .eqs. "" then goto end_pst_loop
    	$ 	pst_key = "USERNAME                      "
    	$ 	open/read pst ''pst_file'.pst
    	$ 	read/key="''pst_key'" pst user_rec
    	$ 	close pst
    	$ 	user = user_rec - pst_key
    	$	goto pst_loop
    	$ end_pst_loop:
    	.
    	.
    	.
    	$ allin1/user="''user'"
    
    Admittedly, this does not address the problem found in the original
    procedure of determining _which_ PST to use, if multiple PSTs are found. 
    (As the original procedure did, this procedure will use the _last_ PST 
    found.) This could be solved by maintaining only _one_ PST in a given user
    account. I have also not bothered with error checking on OPENs and
    READs. This -- as they say in the textbooks -- is left as an exercise
    for the reader.
    
    Bruce 
147.11The final version of A1LOGIN.COMGIDDAY::SETHIMan from DownunderFri Sep 11 1992 10:48136
    G'day Bruce,

    I have written the final version of this command procedure and taken
    out the search *.pst, etc.  That was in there to test for the users 
    diskquota since there is no lexical function that get's the value.

    The original procedure had a few misfeatures and needed a bit of a
    face lift.  Hopefully this procedure is easy to understand and
    maintain.  I wonder if this will become part of the standard base
    elements of ALL-IN-1 ?  :-).

    Sunil

$!
$!+ 	ALL-IN-1 command procedure for a captive account
$!
$	set noverify
$!
$ constants:
$!
$	a1dirname = "[.A1v030]"  ! change this for your site requirements
$	pst_key   = "USERNAME"   ! the key field for accessing the *.PST
$!
$!	message used in this command procedure
$!
$	comfort_message = "		INITIALISING PLEASE WAIT ...."
$	noname_msg      = "%SYS-E-NONAME, ALL-IN-1 username not found"
$	abnormal_msg    = "%SYS-F-ABNORMALEXIT, abnormal exit"
$	nopst_msg	= "%SYS-F-NOPST, the permanent symbol file could not be found"
$!
$ variables:
$!
$	save_message = ""
$	vms_username = ""
$	prcname      = ""
$	pst_file     = ""
$	username     = ""
$!
$ start:
$!
$	write sys$output ""
$	write sys$output "''comfort_message'"
$	write sys$output ""
$!
$	if "''f$mode()'" .nes. "INTERACTIVE" then $ exit
$!
$ 	save_message = f$environment ( "MESSAGE" )
$ 	set message/nofacility/noidentification/notext/noseverity/notext
$!
$	vms_username = f$getjpi ( "" , "USERNAME" )
$	vms_username = f$edit   ( vms_username , "COLLAPSE" )
$	prcname      = f$getjpi ( "" , "PRCNAM"  )
$	if "''vms_username'" .nes. "''prcname'" 
$	then
$		Write sys$output -
		"%SYS-I-ALREADYLOG, you are already logged into ALL-IN-1"
$		wait 00:00:05
$		goto normal_logout
$	endif
$!
$ find_pst:
$!
$	reset_search_context = f$search ( "''a1dirname'A.A" )
$	pst_file = f$search ( "''a1dirname'*.PST" )
$	if "''pst_file'" .eqs. "" then goto no_pst
$!
$ pst_read:
$!
$	open/read/error=abnormal_exit pst 'pst_file
$	read/key="''pst_key'"/error=abnormal_exit pst user_rec
$	close pst
$!
$ continue_processing:
$!
$	username = user_rec - pst_key
$	username = f$edit ( username , "COMPRESS" )
$!
$	set message 'save_message'
$	assign/nolog sys$command sys$input
$	on error then $ goto abnormal_exit
$	allin1/user="''username'"/noreenter
$	goto normal_logout
$!
$ no_name:
$!
$	write sys$output "''noname_msg'"
$	set message 'save_message'
$	assign/nolog sys$command sys$input
$	on error then $ goto abnormal_exit
$	allin1/noreenter
$	goto normal_logout
$!
$ abnormal_exit:
$!
$	set message 'save_message'
$	write sys$output "''abnormal_msg'" 
$	wait 00:00:05
$	logout
$!
$ no_pst:
$!
$	set message 'save_message'
$	write sys$output "''nopst_msg'"
$	wait 00:00:05
$	logout
$!
$ normal_logout:
$!
$	type/page nl: ! clear screen before logging out
$	logout
$!
********************************************************************************
* COPYRIGHT (c) 1992 BY                                                        *
* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS.                       *
* ALL RIGHTS RESERVED.                                                         *
*                                                                              *
* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED        *
* ONLY  IN  ACCORDANCE  OF  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE        *
* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR  ANY  OTHER        *
* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY        *
* OTHER PERSON.  NO TITLE TO AND  OWNERSHIP OF THE  SOFTWARE IS  HEREBY        *
* TRANSFERRED.                                                                 *
*                                                                              *
* THE INFORMATION IN THIS SOFTWARE IS  SUBJECT TO CHANGE WITHOUT NOTICE        *
* AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT        *
* CORPORATION.                                                                 *
*                                                                              *
* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE  OR  RELIABILITY OF ITS        *
* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.                      *
*                                                                              *
*	Author: Sunil Sethi                                                    *
*	Date: 28th Feburary 1992                                               *
*                                                                              *
*	Standard login procedure for ALL-IN-1                                  *
********************************************************************************