parm groupset="?"; entry='MaIn' # Command file: Homeuser 1998/04/13 # Author: Paul H. Christidis : phchristidis@mail.hac.com # Remarks: Lists the MPE groups of an account and the name # of each MPE user 'homed' to each group. #------------------------------------------------------------ # ReadUserList section. Reads file with list of MPE users for the # account and reports anyone that has the 'current' MPE group as his # home group. It also lists the user's capabilities. if "!entry" = "ReadUserLiSt" then echo Group: !_gu_req_group ![RPT(" ",(17-LEN(_gu_req_group)))]& !_gu_grp_cap while (POS("$eou$",(SETVAR(_gu_text,INPUT()))) = 0) do if POS("USER:",_gu_text) <> 0 then setvar _gu_user RTRIM(STR(_gu_text,7,17) - ".!_gu_acct") elseif POS("HOME GROUP:",_gu_text) <> 0 then setvar _gu_home_group RTRIM(STR(_gu_text,13,17)) + ".!_gu_acct" elseif POS("CAP:",_gu_text) <> 0 then setvar _gu_usr_cap DWNS(RHT(RTRIM(_gu_text),-6)) setvar _gu_long_cap LEN(_gu_usr_cap) > 54 if _gu_long_cap then setvar _gu_usr_cap2 RHT(_gu_usr_cap,-55) setvar _gu_usr_cap LFT(_gu_usr_cap,54) endif if _gu_home_group = _gu_req_group then echo \----!_gu_user ![RPT(" ",(9-LEN(_gu_user)))] & !_gu_usr_cap if _gu_long_cap then echo ![RPT(" ",24)]+!_gu_usr_cap2 endif endif endif endwhile # (return to myself in the "main" entry code) return # ReadGroupList section. Reads file with list of MPE groups and # for each one 'calls' section for locating any users 'homed' to it. elseif "!entry" = "ReadGroupList" then while (POS("$eog$",(SETVAR(_gu_text,INPUT()))) = 0) do if POS("GROUP:",_gu_text) <> 0 then setvar _gu_req_group RTRIM(STR(_gu_text,8,17)) elseif POS("CAP:",_gu_text) <> 0 then setvar _gu_grp_cap RHT(RTRIM(_gu_text),-6) xeq !hpfile ;entry="ReadUserLiSt" <*usrlist endif endwhile return # Main Section: # Display banner and/or usage, validate parameters, build files. else setvar _gu_bell CHR(7) echo (PHC) MPE Group & User mapping V98.04.13 !hpdatef, !hptimef setvar _gu_group UPS("!groupset") setvar _gu_acct _gu_group setvar _gu_group STR(_gu_group,1,(POS(".",_gu_group)-1)) if "!_gu_group" = "?" then echo Usage: !_gu_bell echo ![FINFO(hpfile,"fname")] [ GroupSet ] echo echo GroupSet - An MPE group name in the form "Group.Account". echo Wild card characters are allowed for the "group" echo name portion but *not* for the account. return endif setvar _gu_acct _gu_acct - "!_gu_group." setvar _gu_clear chr(27)+"&a0c-1R"+chr(27)+"J"+chr(27)+"&a0c-1R" setvar cierror 0 continue listacct !_gu_acct > $null if cierror <> 0 OR NOT ALPHANUM(_gu_acct) then echo !_gu_bell Invalid ACCOUNT or missing capabilities... return endif setvar mpexfinfoany 1 file grplist,oldtemp if NOT FINFO("*grplist","exists") then build grplist;rec=,,v,ascii;disc=50000;temp endif setvar cierror 0 echo echo !_gu_bell Getting MPE group names.... continue listgroup !_gu_group.!_gu_acct > *grplist if cierror <> 0 then echo !_gu_bell Invalid GROUP specified... return endif echo $eog$ >>*grplist # Parameters were validated. Generate list of users, 'call' command # to process each group record. file usrlist,oldtemp listuser @.!_gu_acct > usrlist echo $eou$ >>*usrlist echo !_gu_clear echo Mpe Group\----Mpe User Capabilities echo ------------------------ ------------------------------- xeq !hpfile ;entry="ReadGroupList" <*grplist endif # Clean Up purge *usrlist purge *grplist deletevar mpexfinfoany if bound(traceon) then showvar _gu@ else deletevar _gu@ endif