[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

1837.0. "USERNAME -> ALL-IN-1 Account name" by MACNAS::PHUGHES () Mon Nov 23 1992 15:58

Is there a means of relating a VMS Username with the corresponding
ALL-IN-1 Account name on login,without having to edit the user's
login.com? I have a procedure (pre v2.3 ALL-IN-1) which reads
a file called OA$DATA:ALIAS.DAT. This file holds a Username,ALL-IN-1 Account
name,and document usage record,for each user.This file however never got
updated in ALL-IN-1 V2.3,so for new users we have to edit their login.
com,and insert a line to define a symbol ,e.g,
$a1:== allin1/user="bloggs.joe"

Has someone got a reliable,up-to-date method of getting a user's
ALL-IN-1 Account name without having to hard-code it into their login.com.

Thanks for any help.
Pat
T.RTitleUserPersonal
Name
DateLines
1837.1Just a SMOP...IOSG::PYEGraham - ALL-IN-1 Sorcerer's ApprenticeMon Nov 23 1992 17:1410
    Since the Profile has (since V2.4) the VMS user name as a secondary
    key, and the record layout of the profile can be determined fairly
    easily, it shouldn't be too hard to make a little program that looked
    up the ALL-IN-1 name from the profile, using the VMS name as a key, and
    then chained to the ALL-IN-1 image.
    
    If you could get the source file of CHECKMAIL or something like it, it
    would be trivial!
    
    Graham
1837.2See note 147.11GIDDAY::SETHIMan from DownunderMon Nov 23 1992 22:1810
    Hi Pat,
    
    See note 147.11 it has this wonderful command procedure that will
    overcome your problem.  I am sure the author will be happy to see his
    work of art being used by our customers.
    
    This is of course my unbiase and humble opinion :-).  If you feel
    like improving on it well just let us know.
    
    Sunil
1837.5EXE to do the job, anyone?WOTVAX::DORANAConfuse-a-cat LtdTue Nov 24 1992 12:1914
    Does anyone have the source of a C or BASIC program that reads the
    profile to get the ALL-IN-1 username for a given VMS user?
    
    I ask this for 2 reasons:-
    
    1) That the procedure mentioned in .-2 is great, but doesn't work on
    brand new accounts (the PST is blank initially).
    
    2) I'm interested in seeing the code behind to do this (I know it's
    relatively straightforward).
    
    Cheers,
    
    Andy
1837.6Pretty easy...SCOTTC::MARSHALLTue Nov 24 1992 13:2420
No code, but here's what you do...

1. Set up the FAB to open the profile
2. Set up a key XAB to get the primary key info (ALL-IN-1 username)
3. Open the file.
4. Set up a RAB and connect to the file.
5. The key XAB gives you the position and length of the ALL-IN-1 username (this
     means you don't have to hard-code this info, hence your code will work
     unmodified if the profile layout changes - OK, so the position of the
     ALL-IN-1 username isn't likely to change, but best to be safe :-).
6. Set the alternate key (VMS username as KOR�.
87 Do get-by-key on the VMS username
8. Use the information in (5) to extract the ALL-IN-1 username.
9. Close file and return info from (8).

�You can either assume this is the first alternate key, or set up key XABs for
all alternate keys and search for the one with the right name.  It depends how
flash you want to be.

Scott
1837.7CHECKMAIL; I'm thinking of this sort of fix...IOSG::PYEGraham - ALL-IN-1 Sorcerer's ApprenticeTue Nov 24 1992 13:3322
    As I said in .1, CHECKMAIL would be a good template. Perhaps Tony
    Redmond will mail you a piece of the code when he's back in the office.
    Then you can publish your program to do it!
    
    As a result of someone beating me up about this last week, I was
    thinking of fixing this problem in a PFR, like this:
    
    	Pick up /USER qualifer or default ALL-IN-1 name to VMS A/C.
    
    	Look up ALL-IN-1 account name in profile.
    
    	If failure, and /USER specified then prompt again.
    
    	ELSE look up VMS A/C in profile, and if it's the only profile
    	record for that VMS A/C start up the image with that ALL-IN-1
    	account name.
    
    	If no profile entry or duplicate entries, prompt for username.
    
    Can anyone think of anything that would get broken by this change?
    
    Graham
1837.8Here's a programMAIL::SANDERSRRick Sanders, Messaging PracticeWed Nov 25 1992 20:2646
    
    >  Is there a means of relating a VMS Username with the corresponding
    >  ALL-IN-1 Account name on login,without having to edit the user's
    >  login.com?
    
    OK, here's a BASIC program to do this for Version 2.4.  It's called
    GET_A1USERNAME.EXE.  When you run it, it gets your VMS username and
    uses that as a key into PROFILE.DAT to get your ALL-IN-1 userid.
    
    It then sets a DCL symbol called A1_USERNAME which you can use in the
    ALLIN1/USER= command.  For example...
    
         $ r sys$system:get_a1username
         $ show symbol a1_username
               A1_USERNAME = "SANDERS.RICK                  "
         $ allin1/user='a1_username'
    
    You can put that into the user's LOGIN.COM and either put him directly
    into ALL-IN-1 or set up another symbol (eg, A1) which allows him to
    enter ALL-IN-1 by typing the command at his convenience.
    
    The source code is located in the next reply.  If you don't have a
    BASIC compiler, I've put the source, object, and executable image at
    the following location:
    
             STOPAS::EMSDEV::DKA300:[PUBLIC]
    
    A few comments...
    
    (1)  I've taken the brute force method, assuming that each user has a
         unique VMS account name.  As Scott pointed out in a previous note
         this may not always be the case so if necessary you'll have to
         make changes to the program.
    
    (2)  Again keeping things simple, I've hard-coded the layout of the 
         PROFILE.DAT for V2.4.  If you want to use the program with V3.0
         you'll need to replace the MAP statement for V2.4 with the one for
         V3.0 (included in the PUBLIC directory).
    
    (3)  Since ordinary users cannot access the Profile due to file
         protection, this program needs to be installed with privileges.
    
    
    Hope this helps,
    
    Rick
1837.9GET_A1USERNAME.BASMAIL::SANDERSRRick Sanders, Messaging PracticeWed Nov 25 1992 20:29248
	!******************************************************************
	!*								  *
        !*  PROGRAM NAME    GET_A1USERNAME                                *
	!*  WRITTEN BY	    Rick Sanders, Messaging Practice,             *
        !*                  Digital Equipment Corp.                       *
        !*  DATE            25 November 1992                              *
	!*								  *
	!*  PROGRAM DESCRIPTION			                          *
        !*                                                                *
        !*  The purpose of this program is to get the ALL-IN-1 username   *
        !*  associated with the VMS User account running this program.    *
        !*  The current process's VMS user account is obtained using the  *
        !*  GETJPI service.  Using the VMS Account name, the ALL-IN-1     *
        !*  Profile.dat record for that account is retrieved.  This gives *
        !*  us the ALL-IN-1 USERID.                                       *
        !*                                                                *
        !*  Finally a DCL symbol for that USERID ("A1_USERNAME") is set   *
        !*  so a user's login.com can invoke ALL-IN-1 with the following  *
        !*  command:  $ allin1/user='a1_username'.   For example:         *
        !*                                                                *
        !*       $ r get_a1username                                       *
        !$       $ allin1/user='a1_username'                              *
        !*                                                                *
        !*  Note that since ordinary users do not have read access to the *
        !*  PROFILE.DAT file this program needs to be installed with the  *
        !*  suitable privileges.                                          *
	!******************************************************************

	!******************************************************************
        !*                                                                *
        !*  MODIFICATION HISTORY                                          *
        !*                                                                *
	!******************************************************************

	!
	! No implicit declarations
	! 
	OPTION TYPE = EXPLICIT

  	!****************************************************************
	!
	!       V A R I A B L E    D E C L A R A T I O N S 
	!
	!****************************************************************

	%INCLUDE "$JPIDEF"  %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"

	DECLARE STRING  VMS_USER,A1_USERNAME
   	DECLARE LONG    PROFILE,SYS_STATUS

        EXTERNAL LONG FUNCTION LIB$GETJPI,LIB$SET_SYMBOL
	EXTERNAL LONG CONSTANT SS$_NORMAL

  	!****************************************************************
	!*							        *
	!*        M A P   S T A T E M E N T S				*
	!*								*
	!****************************************************************


	MAP (PROFILE) STRING USER        = 30%		,&
		STRING TEMPLATE          = 20%		,&         	 
		STRING DIRECT            = 68%		,&         	 
		STRING FRMLIB            = 68%		,&         	
		STRING NOT$IN$USE        =  1%		,&             
		STRING CREATE$FAIL       =  1%		,&             
                STRING VMSUSR            = 12%		,&            
                STRING RESERVED          = 15%		,& 		
                STRING RSVD_FOR_TCS      =  1%		,& 		
                STRING SURNAME1          = 40%		,& 		
                STRING FORENAME1         = 16%		,& 		
                STRING INITIALS1         =  5%		,& 		
                STRING FULNAM            = 64%		,& 		
                STRING COMPANY           = 64%		,& 		
                STRING DEPART            = 32%		,& 		
                STRING LOCATION          = 20%		,& 		
                STRING INT_LOCATION      = 20%		,& 		
                STRING GENERATION        =  3%		,& 		
                STRING TITLE             = 40%		,& 		
                STRING PHONE             = 32%		,& 		
                STRING INTERNAL_PHONE    = 32%		,& 		
                STRING ADDR1             = 40%		,& 		
                STRING ADDR2             = 40%		,& 		
                STRING ADDR3             = 40%		,& 		
                STRING ADDR4             = 40%		,& 		
                STRING ADDR5             = 40%		,& 		
                STRING ADDR6             = 40%		,& 		
      		STRING COUNTRY_NAME      = 40%		,& 		
      		STRING ZIPCOD            = 40%		,& 		
      		STRING FORENAME2         = 16%		,& 		
      		STRING FORENAME3         = 16%		,& 		
      		STRING FORENAME4         = 16%		,& 		
      		STRING FORENAME5         = 16%		,& 		
      		STRING SURNAME2          = 40%		,& 		
      		STRING SURNAME3          = 40%		,& 	       
      		STRING INITIALS2         =  5%		,& 	       
      		STRING INITIALS3         =  5%		,& 	       
      		STRING INITIALS4         =  5%		,& 	       
      		STRING INITIALS5         =  5%		,&           
      		STRING STATUS_LINE       = 68%		,&          
      		STRING MAIL_REPLY        = 31%		,&          
      		STRING NOTIFY            =  1%		,&           
      		STRING QPNOT             =  1%		,& 	       
      		STRING QBNOT             =  1%		,& 	       
      		STRING TICKLER           =  1%		,& 	       
      		STRING ACTITEM           =  1%		,& 	       
                STRING MAIL_FORWARD      = 78%          ,& 	       
                STRING MAIL_FORWARD2     = 78%          ,& 	       
                STRING MAIL_FORWARD3     = 78%          ,& 	       
                STRING MAIL_FORWARD4     = 78%          ,& 	       
      		STRING MAIDES            = 10%		,&   
                STRING MAIL_READ_RECEIPT =  1%		,& 	       
                STRING MAIL_MENU         = 10%		,& 	       
      		STRING DELETE$UNREAD     =  1%		,& 	       
		STRING START             = 30%		,& 	       
      		STRING EDITOR            = 10%		,& 	       
      		STRING PASWRD            = 31%		,& 	       
      		STRING ENFORCED_ARCHIVE  =  1%		,& 	       
      		STRING MAIL$AREA         =  8%		,&   	       
      		STRING AD$MIN            =  1%		,& 	       
      		STRING DATE$FORMAT       =  1%		,& 	       
      		STRING IMAGE$DISPLAY     =  1%		,& 	       
      		STRING TM$MENU           = 10%		,& 	       
      		STRING PRINTER           = 15%		,& 	       
      		STRING PRINTER_PORT      =  1%		,& 	       
      		STRING PRVDCL            =  1%		,&   	       
      		STRING PRVSUP            =  1%		,&   	       
      		STRING PRVERR            =  1%		,&   	       
		STRING PRVCMD            =  1%		,&   	       
      		STRING PRVSRC            =  1%		,&   	       
      		STRING PRVAPP            =  1%		,&   	       
      		STRING CORP_PHONE        =  1%		,&   	       
      		STRING PRVLOG            =  1%		,&   	       
      		STRING MDFLAG            =  1%		,& 	       
      		STRING MULTI_NODE        =  1%		,& 	       
      		STRING SET_MODE          =  1%		,& 	       
      		STRING NODE              = 13%		,& 	       
      		STRING KEY$BOARD         = 25%		,& 	       
      		STRING STARTD            =  1%		,& 	       
      		STRING STARTH            =  7%		,& 	       
      		STRING MEALS             =  7%		,& 	       
      		STRING NODAYS            =  1%		,& 	       
      		STRING ENDH              =  7%		,& 	       
      		STRING MEALE             =  7%		,& 	       
      		STRING TIMEFMT           =  1%		,& 	       
      		STRING CALTIMEINC        =  5%		,& 	       
      		STRING SETUSR            =  1%		,& 	       
      		STRING OPER              = 45%		,& 	       
      		STRING CALDAY            =  1%		,& 	       
      		STRING DDSID             = 32%		,& 	       
      		STRING EXTRA1            = 43%		,& 	       
      		STRING CLASS             = 10%		,& 	       
                STRING UFLAG1            =  1%		,&   	       
                STRING UFLAG2            =  1%		,&   	       
                STRING UFLAG3            =  1%		,&   	       
                STRING UFLAG4            =  1%		,&   	       
                STRING UFLAG5            =  1%		,&   	       
                STRING UFLAG6            =  1%		,&   	       
                STRING UFLAG7            =  1%		,&   	       
                STRING UFLAG8            =  1%		,&   	       
                STRING UFLAG9            =  1%		,&   	       
                STRING UFLAG10           =  1%		,&   	       
      		STRING LANGUAGE          = 20%		,&   
      		STRING EXTRA2            = 50%		,& 	       
      		STRING QUOTA             = 10%		,& 	       
		STRING OVERDRAFT         = 10%		,& 	       
      		STRING DOCCOUNT          = 10%		,& 	       
      		STRING LOGINCHK          =  1% 	       


        MAP (PROFILE) STRING WHOLE_THING = 1944%

	!****************************************************************
	!*								*
	!*     C H A N N E L    A S S I G N M E N T S 			*
	!*								*
	!****************************************************************

	PROFILE      = 1%

	!
	! Find out what our VMS Username is.
	!
	SYS_STATUS = LIB$GETJPI(JPI$_USERNAME,,,,VMS_USER,)
	IF SYS_STATUS <> SS$_NORMAL
	   THEN
		CALL LIB$STOP(SYS_STATUS BY VALUE)
	END IF


	!  PRINT "Username is ";VMS_USER

	WHEN ERROR IN
	    OPEN  "OA$DATA_SHARE:PROFILE.DAT" FOR INPUT AS FILE #PROFILE,	&
		ORGANIZATION INDEXED FIXED,				&
		RECORDTYPE NONE,					&
                ACCESS READ,						&
                ALLOW MODIFY,						&
		MAP PROFILE,   						&
		PRIMARY KEY USER,					&
		ALTERNATE KEY VMSUSR DUPLICATES CHANGES

	USE
	   PRINT ERR;" ";ERT$(ERR);" while opening PROFILE.DAT"
	   CONTINUE THE_END
	END WHEN

	!
	!  The VMS Username should be uppercase but let's make sure
	!
	VMS_USER = EDIT$(VMS_USER,32%)

	
	WHEN ERROR IN
	   GET #PROFILE, KEY #1 EQ VMS_USER
	   A1_USERNAME = USER 
	   !  PRINT "ALL-IN-1 Username ";USER
	   !
	   !  Now let's set up a DCL symbol for the A1 username so the
 	   !  the login procedure can execute $ALLIN1/USER='A1_USERNAME'
	   !  to start the ALL-IN-1 startup.
	   !
	   SYS_STATUS = LIB$SET_SYMBOL("A1_USERNAME",A1_USERNAME)
	   IF SYS_STATUS <> SS$_NORMAL
	      THEN
	         CALL LIB$STOP(SYS_STATUS BY VALUE)
	   END IF

	USE
	   IF ERR = 155%
	      THEN           
		  PRINT "ALL-IN-1 Profile record was not found for VMS account ";VMS_USER
		  CONTINUE THE_END
	    END IF
            !
	    !   some other error, signal it and quit
  	    PRINT ERR;"  ";ERT$(ERR);" while searching PROFILE.DAT"
	    CONTINUE THE_END
	END WHEN

	!
	! That's it. We're done.
	! 

THE_END:
	CLOSE #PROFILE
	END
    
1837.10I was doing this too!!IOSG::TALLETTGimmee an Alpha colour notebook...Wed Nov 25 1992 20:3814
    Hi there!
    
    	Rats! I spent quite a while trying to write a similar basic
    	program, but its been a while since I did basic (maybe I shouldn't
    	say that sort of thing in the current climate! :-)
    	I was struggling with SYS$GETJPI, should have been using
    	LIB$GETJPI, oh well!
    
    	Change the following line in .-1 for ALL-IN-1 V3.0:
    
        MAP (PROFILE) STRING WHOLE_THING = 2192%
    
    Regards,
    Paul
1837.12Just dropping a hint to have create and rename updatedGIDDAY::SETHIMan from DownunderWed Nov 25 1992 23:2612
    G'day Andy,
    
    Re .5
    
    >1) That the procedure mentioned in .-2 is great, but doesn't work
    >   on brand new accounts (the PST is blank initially).
    
    I had requested a chenge in the Create and Rename user account options
    as part of the topic I refered you to.  It would be an easy thing to do
    to update the .com's and add a few lines to update the .PST.
    
    Sunil