C
C	Author		: Patrick Feldner
C
C	Purpose		: The purpose of this program is to do all the account
C			  creation and deletion, both will be able to handle 
C			  the creation or deletion of a single account or a
C			  group of accounts.  This program should be upward 
C			  compatable with other versions of VMS do to the fact
C			  that the system UAF is accessed by disriptors not by
C			  postions.
C
C

	Program Accounts

	Character*20 command
	Integer      length

	Parameter ( screen=1 )

C	Begin the program 

	write (screen,101)
101	format (/,2x,'Welcome to the Account Managment Program ::',//)

120	write (screen,102)
102	format (' Command > ',$)
	read (screen,104,err=700) length,command
104	format (Q,A)
	if (length .eq. 0) goto 120
	goto (100,200,300,400,500,600,700,800,900,1000,1100,1200,
     +	      1300,1400,1500,1600,1700,1800,1900,2000) ,
     +	      analyze(command) 
100	write (screen,103)
103	format (1x,'%%%%% Invalid Command %%%%%',/)
	goto 120

C	Begin the Help Command :
200	call UserHelp
	goto 120

C	Begin the Make Account Command :
300	call make
	goto 120

C	Begin the Remove Account Command for a list :
400	call Remove(command)
	goto 120

C	Begin the Disuser Accounts Command :
500	call disuser
	goto 120

C	Begin the Make Account Command with a List :
600	call MakeList
	goto 120

C	Begin the Single user Disuser Accounts Command :
800	call disuser1
	goto 120

C	Begin the Remove Account Command for a Single User :
900	call RemoveSing
	goto 120

C	Begin the Add Sembud Command :
1000	call Add_Sembud
	goto 120

C	Begin the Delete Sembud Command :
1100	call Del_Sembud
	goto 120

C	Begin the Show Sembud Command with a List :
1200	call List_Sembud
	goto 120

C	Begin the Modify Sembud Command :
1300	call Mod_Sembud
	goto 120

C	Begin the Modify Sembud Command :
1400	call Show_Sembud
	goto 120

C	Begin the Labels intermediate Command:
1500	call Labels
	goto 120

C	Begin the 4 Labels Command :
1600	call Labels4
	goto 120

C	Begin the 3 Labels Command :
1700	call Labels3
	goto 120

C	Begin Last Login Time Check Command :
1800	call Last_Login_Check
	goto 120

C	Begin Last Login Time Check Command /LIST :
1900	call Last_Login_File
	goto 120

C	Begin Last Login Remove Command :
2000	call Last_Login_Remove
	goto 120

700	write (screen,701)
701	format (1x,'%%%%% Exiting Program %%%%%')

	END


	Function analyze(commandOut)

	Character*20 commandOut

	call str$upcase (commandOut,commandOut)
	if ( Index(commandOut,'HELP                ') .EQ. 1 ) then
		analyze=2
		Return
	end if	
	if ( Index(commandOut,'MAKE/LIST           ') .EQ. 1 ) then
		analyze=6
		Return
	end if	
	if ( Index(commandOut,'MAKE /LIST          ') .EQ. 1 ) then
		analyze=6
		Return
	end if	
	if ( Index(commandOut,'MAKE                ') .EQ. 1 ) then
		analyze=3
		Return
	end if	
	if ( Index(commandOut,'REMOVE/LIST         ') .EQ. 1 ) then
		analyze=4
		Return
	end if	
	if ( Index(commandOut,'REMOVE /LIST        ') .EQ. 1 ) then
		analyze=4
		Return
	end if	
	if ( Index(commandOut,'REMOVE /CONFIRM     ') .EQ. 1 ) then
		analyze=4
		Return
	end if	
	if ( Index(commandOut,'REMOVE/CONFIRM      ') .EQ. 1 ) then
		analyze=4
		Return
	end if	
	if ( Index(commandOut,'REMOVE              ') .EQ. 1 ) then
		analyze=9
		Return
	end if	
	if ( Index(commandOut,'DISUSER/LIST        ') .EQ. 1 ) then
		analyze=5
		Return
	end if	
	if ( Index(commandOut,'DISUSER /LIST       ') .EQ. 1 ) then
		analyze=5
		Return
	end if	
	if ( Index(commandOut,'DISUSER             ') .EQ. 1 ) then
		analyze=8
		Return
	end if	
	if ( Index(commandOut,'ADD                 ') .EQ. 1 ) then
		analyze=10
		Return
	end if	
	if ( Index(commandOut,'DELETE             ') .EQ. 1 ) then
		analyze=11
		Return
	end if	
	if ( Index(commandOut,'MODIFY             ') .EQ. 1 ) then
		analyze=13
		Return
	end if	
	if ( Index(commandOut,'SHOW/LIST          ') .EQ. 1 ) then
		analyze=12
		Return
	end if	
	if ( Index(commandOut,'SHOW /LIST         ') .EQ. 1 ) then
		analyze=12
		Return
	end if	
	if ( Index(commandOut,'SHOW               ') .EQ. 1 ) then
		analyze=14
		Return
	end if	
	if ( Index(commandOut,'LABELS/4           ') .EQ. 1 ) then
		analyze=16
		Return
	end if	
	if ( Index(commandOut,'LABELS /4          ') .EQ. 1 ) then
		analyze=16
		Return
	end if	
	if ( Index(commandOut,'LABELS/3           ') .EQ. 1 ) then
		analyze=17
		Return
	end if	
	if ( Index(commandOut,'LABELS /3          ') .EQ. 1 ) then
		analyze=17
		Return
	end if	
	if ( Index(commandOut,'LABELS             ') .EQ. 1 ) then
		analyze=15
		Return
	end if	
	if ( Index(commandOut,'OLD LOGIN /LIST    ') .EQ. 1 ) then
		analyze=19
		Return
	end if	
	if ( Index(commandOut,'OLD LOGIN/LIST     ') .EQ. 1 ) then
		analyze=19
		Return
	end if	
	if ( Index(commandOut,'OLD LOGIN /REMOVE  ') .EQ. 1 ) then
		analyze=20
		Return
	end if	
	if ( Index(commandOut,'OLD LOGIN/REMOVE   ') .EQ. 1 ) then
		analyze=20
		Return
	end if	
	if ( Index(commandOut,'OLD LOGIN          ') .EQ. 1 ) then
		analyze=18
		Return
	end if	
	if ( Index(commandOut,'EXIT ') .EQ. 1 ) then
		analyze=7
		Return
	end if	
	analyze=1
	Return

	end


	Subroutine UserHelp

	Parameter ( screen=1 )

	Character*80 topic
	integer*4    status
	external     lib$get_input,lib$put_output
	external     lbr$output_help

	write (screen,101)
101	format (/,1x,'Topic? ',$)
	read (screen,102,err=999) topic
102	format (1A80)
	status = lbr$output_help (lib$put_output,,
     +	topic,'MAKACT_HELP:MAKACT.HLB',,
     +	lib$get_input)
	if (.not. status) then
		write (screen,103)
103		format (2x'%%%%%% Error in Help file %%%%%%')
	end if

999	end
