PARM CAP="" # ADDCAP.XEQ - Adds new capabilities to current logon. # # FROM CHAPTER 7 IN THE COMMAND INTERPRETER ACCESS # AND VARIABLES PROGRAMMER'S GUIDE # # AM capability is required to execute this command file. # Since the new capability does not become effective until # the user logs on again, the user is offered the option # of being logged on automatically. # # There are three possible outcomes in running this command # file using acceptable input: # # * No capability was entered as a parameter value. # The user's current capabilities are listed. # # * The user already has the capability. # # * The capability is added to the user's list. # Note that a relogging option prompts the user to relog # automatically or to wait until the next logon to activate # the new capabilities. IF ("!CAP"="") ECHO (ADDCAP): Your capabilities are: !HPUSERCAPF. RETURN ENDIF IF (POS(UPS("!CAP"),HPUSERCAPF) <> 0) ECHO (ADDCAP): You already have : !CAP. ECHO (ADDCAP): The capabilities are: !HPUSERCAPF. RETURN ENDIF SETVAR CIERROR 0 CONTINUE ALTUSER !HPUSER;CAP=![HPUSERCAPF + ",!CAP"] > $NULL IF CIERROR <> 0 ECHO (ADDCAP): The capabilities remain: !HPUSERCAPF. ELSE ECHO (ADDCAP): !HPUSER new capabilities are: ![HPUSERCAPF + ",!CAP"]. SETVAR ADDCAP_TEMP "N" INPUT ADDCAP_TEMP,"(ADDCAP): Log off/on now (Y/N) ==>",10 IF HPCIERR = -9003 ## TIMED READ EXPIRED ## ECHO ECHO (ADDCAP): Timed 10-second read expired. & Logon cancelled. ELSEIF NOT(UPS(LFT(ADDCAP_TEMP,1)) = "Y") THEN ECHO (ADDCAP): New capabilities take effect at next logon. ELSE HELLO !HPJOBNAME,!HPUSER.!HPACCOUNT,!HPGROUP ENDif ENDIF DELETEVAR ADDCAP_TEMP