home *** CD-ROM | disk | FTP | other *** search
- Path: wupost!uunet!europa.asd.contel.com!darwin.sura.net!noc.sura.net!haven.umd.edu!mimsy!nrlvx1.nrl.navy.mil!koffley
- From: koffley@nrlvx1.nrl.navy.mil
- Newsgroups: alt.sources
- Subject: VMS UAF PROFILE part 4 of 18
- Message-ID: <1991Sep5.074241.548@nrlvx1.nrl.navy.mil>
- Date: 5 Sep 91 11:42:41 GMT
- Organization: NRL SPACE SYSTEMS DIVISION
- Lines: 370
-
- -+-+-+-+-+-+-+-+ START OF PART 4 -+-+-+-+-+-+-+-+
- X Itemlist(19).retlen = %loc(wsextent_len)
- X Itemlist(20).buflen = 4
- X Itemlist(20).code = uai$_wsquota
- X Itemlist(20).addr = %loc(wsquo)
- X Itemlist(20).retlen = %loc(wsquo_len)
- X Itemlist(21).buflen = 3
- X Itemlist(21).code = uai$_batch_access_p
- X Itemlist(21).addr = %loc(batch_p)
- X Itemlist(21).retlen = %loc(batch_p_len)
- X Itemlist(22).buflen = 3
- X Itemlist(22).code = uai$_batch_access_s
- X Itemlist(22).addr = %loc(batch_s)
- X Itemlist(22).retlen = %loc(batch_s_len)
- X Itemlist(23).buflen = 3
- X Itemlist(23).code = uai$_dialup_access_p
- X Itemlist(23).addr = %loc(dialup_p)
- X Itemlist(23).retlen = %loc(dialup_p_len)
- X Itemlist(24).buflen = 3
- X Itemlist(24).code = uai$_dialup_access_s
- X Itemlist(24).addr = %loc(dialup_s)
- X Itemlist(24).retlen = %loc(dialup_s_len)
- X Itemlist(25).buflen = 3
- X Itemlist(25).code = uai$_local_access_p
- X Itemlist(25).addr = %loc(local_p)
- X Itemlist(25).retlen = %loc(local_p_len)
- X Itemlist(26).buflen = 3
- X Itemlist(26).code = uai$_local_access_s
- X Itemlist(26).addr = %loc(local_s)
- X Itemlist(26).retlen = %loc(local_s_len)
- X Itemlist(27).buflen = 3
- X Itemlist(27).code = uai$_network_access_p
- X Itemlist(27).addr = %loc(network_p)
- X Itemlist(27).retlen = %loc(network_p_len)
- X Itemlist(28).buflen = 3
- X Itemlist(28).code = uai$_network_access_s
- X Itemlist(28).addr = %loc(network_s)
- X Itemlist(28).retlen = %loc(network_s_len)
- X Itemlist(29).buflen = 3
- X Itemlist(29).code = uai$_remote_access_p
- X Itemlist(29).addr = %loc(remote_p)
- X Itemlist(29).retlen = %loc(remote_p_len)
- X Itemlist(30).buflen = 3
- X Itemlist(30).code = uai$_remote_access_s
- X Itemlist(30).addr = %loc(remote_s)
- X Itemlist(30).retlen = %loc(remote_s_len)
- X Itemlist(31).buflen = 4
- X Itemlist(31).code = uai$_bytlm
- X Itemlist(31).addr = %loc(bytlm)
- X Itemlist(31).retlen = %loc(bytlm_len)
- X Itemlist(32).buflen = 4
- X Itemlist(32).code = uai$_jtquota
- X Itemlist(32).addr = %loc(jtquota)
- X Itemlist(32).retlen = %loc(jtquota_len)
- X Itemlist(33).buflen = 4
- X Itemlist(33).code = uai$_cputim
- X Itemlist(33).addr = %loc(cpu)
- X Itemlist(33).retlen = %loc(cpu_len)
- X Itemlist(34).buflen = 4
- X Itemlist(34).code = uai$_flags
- X Itemlist(34).addr = %loc(flags)
- X Itemlist(34).retlen = %loc(flags_len)
- X Itemlist(35).buflen = 8
- X Itemlist(35).code = uai$_pwd_lifetime
- X Itemlist(35).addr = %loc(pwd_life)
- X Itemlist(35).retlen = %loc(pwd_life_len)
- X Itemlist(36).buflen = 8
- X Itemlist(36).code = uai$_expiration
- X Itemlist(36).addr = %loc(expir)
- X Itemlist(36).retlen = %loc(expir_len)
- X Itemlist(37).buflen = 8
- X Itemlist(37).code = uai$_def_priv
- X Itemlist(37).addr = %loc(def_priv)
- X Itemlist(37).retlen = %loc(def_priv_len)
- X Itemlist(38).buflen = 8
- X Itemlist(38).code = uai$_priv
- X Itemlist(38).addr = %loc(auth_priv)
- X Itemlist(38).retlen = %loc(auth_priv_len)
- X Itemlist(39).buflen = 4
- X Itemlist(39).code = uai$_uic
- X Itemlist(39).addr = %loc(uic_value)
- X Itemlist(39).retlen = %loc(uic_value_len)
- X Itemlist(40).buflen = 32 ! 9 for V4.7
- X Itemlist(40).code = uai$_account
- X Itemlist(40).addr = %loc(account)
- X Itemlist(40).retlen = %loc(account_len)
- X Itemlist(41).buflen = 64
- X Itemlist(41).code = uai$_lgicmd
- X Itemlist(41).addr = %loc(cmd_str)
- X Itemlist(41).retlen = %loc(lgicmd_len)
- X Itemlist(42).buflen = 32
- X Itemlist(42).code = uai$_clitables
- X Itemlist(42).addr = %loc(tables_str)
- X Itemlist(42).retlen = %loc(tables_len)
- X Itemlist(43).buflen = 32
- X Itemlist(43).code = uai$_defcli
- X Itemlist(43).addr = %loc(cli_str)
- X Itemlist(43).retlen = %loc(defcli_len)
- X Itemlist(44).buflen = 32
- X Itemlist(44).code = uai$_defdev
- X Itemlist(44).addr = %loc(dev_str)
- X Itemlist(44).retlen = %loc(defdev_len)
- X Itemlist(45).buflen = 64
- X Itemlist(45).code = uai$_defdir
- X Itemlist(45).addr = %loc(dir_str)
- X Itemlist(45).retlen = %loc(defdir_len)
- X Itemlist(46).buflen = 32
- X Itemlist(46).code = uai$_owner
- X Itemlist(46).addr = %loc(own_str)
- X Itemlist(46).retlen = %loc(owner_len)
- X
- X itemlist(47).end_list = 0
- X
- X other_itemlist(01).buflen = 8
- X other_itemlist(01).code = uai$_lastlogin_i
- X other_itemlist(01).addr = %loc(last_login_i(1))
- X other_itemlist(01).retlen = %loc(lastlogi)
- X other_itemlist(02).buflen = 8
- X other_itemlist(02).code = uai$_lastlogin_n
- X other_itemlist(02).addr = %loc(last_login_n(1))
- X other_itemlist(02).retlen = %loc(lastlogn)
- X other_itemlist(03).buflen = 8
- X other_itemlist(03).code = uai$_pwd_date
- X other_itemlist(03).addr = %loc(pwd_date(1))
- X other_itemlist(03).retlen = %loc(change_date_len)
- X
- X other_itemlist(04).end_list = 0
- X
- X`09def_Priv (1) = 0
- X`09def_Priv (2) = 0
- X`09auth_priv (1) = 0
- X`09auth_priv (2) = 0
- XC
- XC First determine if the terminal type is ansicrt.
- XC
- X sts = lib$getdvi ( dvi$_tt_ansicrt ,, 'tt:', value )
- X if (.not.value) stop 'SYS$INPUT must be an ANSI CRT'
- XC
- XC Make a call to LIB$GETJPI to find out process privileges. $GETUAI
- XC can actually be run by any user, as long as the account being
- XC examined is owned by the user, so we will cause the program to exit
- XC at this point. If a user wants to look at his own profile, let
- XC him write his own program!
- XC
- X priv_mask = prv$m_sysprv.or.prv$m_setprv
- X
- X sts = lib$getjpi ( jpi$_authpriv ,,, my_privs )
- X if (.not.sts) call lib$signal ( %val(sts) )
- XC
- XC If the user has SYSPRV, then set it (in case it is not already
- XC set). If the user does not have privileges, have the program end
- XC at this point.
- XC
- X if ((jiand(priv_mask,my_privs(1))).ne.0) then
- X priv_mask = prv$m_sysprv
- X sts = sys$setprv ( %val(enbflg), priv_mask ,, )
- X if (.not.sts) call lib$signal ( %val(sts) )
- X else
- X write (6,*) 'Insufficient privilege'
- X`09 call AST
- X call exit
- X endif
- XC
- XC Get the foreign command line.
- XC
- X call lib$get_foreign ( u, 'PROFILE> ', u_len )
- X if (u_len.eq.0) call AST
- XC
- XC Make the call to the system service $GETUAI to gather all information.
- XC If the username does not exist, a second call to $GETUAI will be made,
- XC using the DEFAULT template, and the significant fields altered to match
- XC the new user.
- XC
- X10 sts = sys$getuai ( ,, u(1:u_len), itemlist ,,, )
- X sts = sys$getuai ( ,, u(1:u_len), other_itemlist ,,, )
- X if (.not.sts) then ! user does not exist: use DEFAULT
- X user_exists = .false.
- X sts = sys$getuai ( ,, 'DEFAULT', itemlist ,,, )
- X username = u
- X u_len = index(username,' ')-1
- X owner = '(none)'
- X defdir = '`5B'//username(1:u_len)//'`5D'
- X password = username
- X else ! user exists: use given user record
- X own_str(1) = index(owner,' ')-1
- X if (own_str(1).eq.-1) own_str(1) = 32 ! to remove the
- X dir_str(1) = index(defdir,' ')-1 ! byte prefix
- X if (dir_str(1).eq.-1) dir_str(1) = 64 ! from the
- X user_exists = .true. ! returned
- X orig_uname = u ! strings
- X username = u
- X uname_len = index(u,' ')-1
- X password = '(unknown)'
- X endif
- XC
- XC Remove byte prefix from returned strings.
- XC
- X dev_str(1) = index(defdev,' ')-1
- X if (dev_str(1) .eq. -1) dev_str(1) = 32
- X tables_str(1) = index(tables,' ')-1
- X if (tables_str(1).eq.-1) tables_str(1) = 32
- X cli_str(1) = index(defcli,' ')-1
- X if (cli_str(1).eq.-1) cli_str(1) = 40
- X cmd_str(1) = index(lgicmd,' ')-1
- X if (cmd_str(1).eq.-1) cmd_str(1) = 64
- XC
- XC Find out what the uic is and format the string using LIB$SYS_FAO.
- XC
- X sts = lib$sys_fao ( '!%U', len, uic, %val(uic_value) )
- X if (.not.sts) call lib$signal ( %val(sts) )
- XC
- XC Find out what time fields (password expiration, account expiration,
- XC etc.) the user has.
- XC
- X sts = sys$asctim ( , pwd_lifetime, pwd_life, 0 )
- X if (.not.sts) call lib$signal ( %val(sts) )
- X if (pwd_lifetime(1:10).eq.'17-NOV-185') then
- Xd`09 write (66,*) 'pwd_Lifetime = ',pwd_lifetime
- Xd`09 write (66,'(1x,2(z8,2x))' ) pwd_life(1),pwd_life(2)
- X`09 pwd_lifetime = ' (none)'
- X`09endif
- X sts = sys$asctim ( , exprdate, expir, 0 )
- X if (.not.sts) call lib$signal ( %val(sts) )
- X if (exprdate(1:10).eq.'17-NOV-185') then
- Xd`09 write (66,*) 'exprdate = ',exprdate
- Xd`09 write (66,'(1x,2(z8,2x))' ) expir(1),expir(2)
- X`09 exprdate = ' (none)'
- X`09endif
- XC
- XC Convert last login date/time to ascii strings
- XC
- X sts = sys$asctim ( , char_last_login_i, last_Login_i(1), 0 )
- X if (.not.sts) call lib$signal ( %val(sts) )
- X sts = sys$asctim ( , char_last_login_n, last_Login_n(1), 0 )
- X if (.not.sts) call lib$signal ( %val(sts) )
- Xd`09write (66,*) 'last non-inter = ',char_last_Login_n
- X sts = sys$asctim ( , password_change_date, pwd_date(1), 0 )
- X if (.not.sts) call lib$signal ( %val(sts) )
- X if (index(password_change_date,'0 00:00:00.00') .ne. 0) then
- Xd`09 write (66,*) 'password pre-expired'
- X`09else
- Xd`09 write (66,*) 'last pword change: ',password_change_date
- X`09endif
- XC
- XC Convert the decimal value for cputime to a string in the format
- XC X XX:XX:XX (day hour:minute:second).
- XC
- X size = 2
- X if (cpu.ne.0) then
- X days = (cpu / 360000) / 24
- X cpu = cpu - days * 360000 * 24
- X hours = cpu / 360000
- X cpu = cpu - hours * 360000
- X hours = mod (hours, 1000 )
- X minutes = cpu / 6000
- X cpu = cpu - minutes * 6000
- X seconds = cpu /100
- X sts = ots$cvt_l_ti ( days, dummy )
- X cpu_string = dummy
- X str_len = index(cpu_string,' ')-1
- X sts = ots$cvt_l_ti ( hours, dummy, %val(size) )
- X cpu_string = cpu_string(1:str_len)//' '//dummy
- X str_len = index(cpu_string,' ')-1
- X sts = ots$cvt_l_ti ( minutes, dummy, %val(size) )
- X cpu_string = cpu_string(1:str_len)//':'//dummy
- X str_len = index(cpu_string,' ')-1
- X sts = ots$cvt_l_ti ( seconds, dummy, %val(size) )
- X cpu_string = cpu_string(1:str_len)//':'//dummy
- X else
- X cpu_string = ' (none)'
- X endif
- XC
- XC CONVERT function converts integer to ascii string representing the integer
- V.
- XC
- X sts = convert ( maxjobs, maxjobs_string )
- X sts = convert ( fillm, fillm_string )
- X sts = convert ( maxacctjobs, maxacctjobs_string )
- X sts = convert ( shrfillm, shrfillm_string )
- X sts = convert ( pbytlm, pbytlm_string )
- X sts = convert ( maxdetach, maxdetach_string )
- X sts = convert ( biolm, biolm_string )
- X sts = convert ( prclm, prclm_string )
- X sts = convert ( diolm, diolm_string )
- X sts = convert ( wsdef, wsdef_string )
- X sts = convert ( astlm, astlm_string )
- X sts = convert ( wsquo, wsquo_string )
- X sts = convert ( tqelm, tqelm_string )
- X sts = convert ( wsextent, wsextent_string )
- X sts = convert ( enqlm, enqlm_string )
- X sts = convert ( pgflquo, pgflquo_string )
- X sts = convert ( pwd_length, pwd_length_string )
- X sts = convert ( queprio, queprio_string )
- X sts = convert ( prio, prio_string )
- X sts = convert ( jtquota, jtquota_string )
- X sts = convert ( bytlm, bytlm_string )
- XC
- XC Create the virtual keyboard
- XC
- X call smg$create_virtual_keyboard ( keyboard )
- XC
- XC Create the virtual display displays
- XC
- X call smg$create_virtual_display ( 24, 80, main )
- X call smg$create_virtual_display ( 3, 80, message ,,
- X . smg$m_bold )
- X call smg$create_virtual_display ( 2, 50, error_message,
- X . smg$m_border )
- X call smg$create_virtual_display ( 3, 60, login_board,
- X . smg$m_border )
- X call smg$create_virtual_display ( 1, 80, prompt )
- X call smg$create_virtual_display ( 24, 80, priv_board )
- X call smg$create_virtual_display ( 24, 80, flags_board )
- X call smg$create_virtual_display ( 24, 80, access_board )
- X call smg$create_virtual_display ( 24, 80, days_board )
- X call smg$create_pasteboard ( pasteboard ,,,,,)
- Xd`09write (66,*) 'pasteboard = ',pasteboard
- XC
- XC Call the subroutine BOARD to put everything on the screen
- XC
- X call board ( owner, tables, defcli, defdev, defdir,
- X . lgicmd )
- XC
- XC Call the subroutine SELECT to pick and choose items on the screen.
- XC
- X call select ( owner, tables, defcli, defdev,
- X . defdir, lgicmd )
- XC
- XC Redefine some string lengths
- XC
- X own_str(1) = index(owner,' ')-1
- X if (own_str(1).eq.-1) own_str(1) = 32
- X
- X tables_str(1) = index(tables,' ')-1
- X if (tables_str(1).eq.-1) tables_str(1) = 32
- X
- X cli_str(1) = index(defcli,' ')-1
- X if (cli_str(1).eq.-1) cli_str(1) = 40
- X
- X dev_str(1) = index(defdev,' ')-1
- X if (dev_str(1).eq.-1) dev_str(1) = 32
- X
- X dir_str(1) = index(defdir,' ')-1
- X if (dir_str(1).eq.-1) dir_str(1) = 64
- X
- X cmd_str(1) = index(lgicmd,' ')-1
- X if (cmd_str(1).eq.-1) cmd_str(1) = 64
- X
- X call string_lengths ( owner, tables, defcli, defdev,
- X . defdir, lgicmd )
- XC
- XC Check to see if any changes were made. Exit program if no changes
- XC made.
- XC
- X if (.not.change) go to 20
- XC
- XC Confirm that the user wants to save the changes. Exit if response
- XC is negative.
- XC
- X call smg$set_cursor_abs ( main, 22, 1 )
- X call smg$read_string ( keyboard, confirm,
- X . 'Save changes? `5BY`5D ', 2 ,,,, length )
- X if (length.ne.0) then
- +-+-+-+-+-+-+-+- END OF PART 4 +-+-+-+-+-+-+-+-
- --
- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
- < Joe Koffley KOFFLEY@NRLVAX.NRL.NAVY.MIL >
- < Naval Research Laboratory KOFFLEY@CCF.NRL.NAVY.MIL >
- < Space Systems Division AT&T : 202-767-0894 >
- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
-