10 ! ----- [LOMASKY.SYS]SYSUAF.BAS ----- ! ! ----- VMS V4.6+/V5.0/V5.1/V5.2/V5.3 SYSUAF REPORT/MODIFY PROGRAM ----- ! ! ------------------------ Modification History ------------------------ ! ----- Date Version Description ----- ! ----- 10/31/91 5.00 Additional Optimization, 132-col screen ----- ! ----- auto-switching, ammended and ----- ! ----- completely redesigned menu selections ----- ! ---------------------------------------------------------------------- ! ! ----- Teradyne, Inc., 321 Harrison Avenue, M/S H87, Boston, MA 02118 ! ----- Brian Lomasky: (617) 422-2259 ! ! ----- Neither Brian Lomasky nor Teradyne, Inc. implicitly or ----- ! ----- explicitly implies this program is usable in any way. ----- ! ----- This program is released to the public domain in an ----- ! ----- "AS-IS" condition. ----- ! ! ----- Requires VAX BASIC V3.0 or later ----- ! ! ----- Requires read access to SYS$SYSTEM:SYSUAF.DAT and ----- ! ----- (SYS$SYSTEM:NETUAF.DAT or SYS$SYSTEM:NETPROXY.DAT) ----- ! ! ----- If looking up usernames on a remote node, Read access to ----- ! ----- the remote node's SYS$SYSTEM:SYSUAF.DAT is required ----- ! ! ----- Compile this program by typing: $BASIC/LONG SYSUAF ! ! ----- Link this program by typing: $LINK SYSUAF ! ! ----- (Do NOT install this program with any privileges) ----- ! OPTION TYPE = EXPLICIT ! ENSURE ALL VARIABLES DECLARED ON ERROR GOTO ERROR_ROUTINE ! TRAP ALL ERRORS %LET %DEBUG = 0% ! 1 IF DEBUG MODE, 0 IF NO DEBUG %LET %SWEAR = 1% ! 1 TO SWEAR AT NON-PRIV'ED USER ! ----- EXTERNAL CONSTANTS ----- EXTERNAL LONG CONSTANT IO$_SENSEMODE ! GET CURRENT TERMINAL MODE EXTERNAL LONG CONSTANT IO$_SETMODE ! SET TERMINAL MODE EXTERNAL LONG CONSTANT JPI$_USERNAME ! USERNAME EXTERNAL LONG CONSTANT SS$_ABORT ! ABORT STATUS EXTERNAL LONG CONSTANT SS$_ACCVIO ! ACCESS VIOLATION EXTERNAL LONG CONSTANT SS$_BUFFEROVF ! BUFFER OVERFLOW EXTERNAL LONG CONSTANT SS$_IVTIME ! INVALID TIME EXTERNAL LONG CONSTANT SS$_NOLOGNAM ! NO LOGICAL NAME TRANSLATION EXTERNAL LONG CONSTANT SS$_NORMAL ! NORMAL EXIT STATUS EXTERNAL LONG CONSTANT SS$_NOSUCHID ! NO IDENTIFIER FOUND %INCLUDE "$DVIDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB" %INCLUDE "$KGBDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB" %INCLUDE "$LNMDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET.TLB" ! ----- PROGRAM VERSION CONSTANTS ----- DECLARE STRING CONSTANT PROG_VERSION = "V5.00" ! ----- COMMON CONSTANTS ----- DECLARE LONG CONSTANT ERROR_NO_PUTMSG = X"10000002"L DECLARE WORD CONSTANT MAX_ACCESS = 12% ! NUMBER OF ACCESS RESTRICTIONS DECLARE WORD CONSTANT MAX_FLAG = 18% ! NUMBER OF LOGIN REPORT FLAGS DECLARE WORD CONSTANT MAX_FLAGS = 22% ! NUMBER OF SEARCH FLAGS DECLARE WORD CONSTANT MAX_PRIV = 39% ! NUMBER OF PRIVILEGE BITS DECLARE WORD CONSTANT MAX_SEARCH = 45% ! NUMBER OF SEARCH FIELDS DECLARE STRING CONSTANT MENU_STRING = & "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*+=;:?[]{}" DECLARE STRING CONSTANT PRINT_STRING = & "abcdefghijklmnopqrstuvwxyz1234567890+$%*=?/[\|]{};:" DECLARE WORD CONSTANT TRUE = (1% = 1%) DECLARE WORD CONSTANT FALSE = NOT TRUE ! ----- BASIC ERROR CODE CONSTANTS ----- DECLARE WORD CONSTANT BUCKET_LOCKED = 154% DECLARE WORD CONSTANT FILE_ATTRIBUTES_NOT_MATCHED = 160% DECLARE WORD CONSTANT END_OF_FILE = 11% DECLARE WORD CONSTANT NO_SUCH_FILE = 5% DECLARE WORD CONSTANT PROTECTION_VIOLATION = 10% DECLARE WORD CONSTANT REC_NOT_FOUND = 155% DECLARE WORD CONSTANT SUCCESS = 0% RECORD DVIBUF ! $GETDVIW RECORD WORD BUFFER_LENGTH1 WORD ITEM_CODE1 LONG BUFFER_ADDRESS1 LONG RETURN_LENGTH_ADDRESS1 LONG LIST_TERMINATOR END RECORD DVIBUF RECORD JPIBUF ! $GETJPIW RECORD WORD BUFFER_LENGTH1 WORD ITEM_CODE1 LONG BUFFER_ADDRESS1 LONG RETURN_LENGTH_ADDRESS1 LONG LIST_TERMINATOR END RECORD JPIBUF RECORD TRNBUF ! $TRNLNM RECORD WORD BUFFER_LENGTH1 WORD ITEM_CODE1 LONG BUFFER_ADDRESS1 LONG RETURN_LENGTH_ADDRESS1 LONG LIST_TERMINATOR END RECORD TRNBUF ! ----- VARIABLE DECLARATIONS ----- DIM WORD ACCESS_BIT_OFF(MAX_ACCESS) ! BIT OFF/CNTD STR POS/QUAD VAL DIM WORD ACCESS_BYTE_OFF(MAX_ACCESS) ! BYTE OFFSET DIM STRING ACCESS_DESC(MAX_ACCESS) ! DESC OF ACCESS DIM WORD ACCESS_LENGTH(MAX_ACCESS) ! LENGTH OF ACCESS DIM STRING ACCESS_TYPE(MAX_ACCESS) ! TYPE OF ACCESS TO SEARCH FOR DIM STRING ADDED_IDENTS(200%) ! LIST OF IDENTS THAT WERE ADDED DECLARE LONG ADDED_IDENTS_CTR ! ADDED_IDENTS ARRAY COUNTER DECLARE WORD ALL_SEARCHES_FAIL ! TRUE IF ALL SEARCHES FAIL DECLARE WORD ATTRIBUTE_COUNTER ! COUNT OF ATTRIBUTES DECLARE WORD BIT_OFF ! CALCULATED BIT OFFSET DECLARE WORD BIT_PRINT_CODE ! CODE FOR PRINTING UAF BITS DECLARE WORD BYTE_OFF ! CALCULATED BYTE OFFSET DECLARE WORD CHANNEL ! TERMINAL I/O CHANNEL DECLARE LONG CHARS_WRITTEN ! CHARS WRITTEN TO REPORT LINE DECLARE STRING CLEAR_VT100_SCREEN ! CHARACTER STRING TO CLEAR SCR DECLARE WORD COL ! COLUMN POSITION DECLARE WORD COMMAND_FILE ! TRUE IF CREATING COMMAND FILE DECLARE LONG CONTEXT ! CONTEXT FOR REPEATED CALLS DECLARE LONG CPUTIME_HOURS ! CALCULATED CPU HOURS DECLARE LONG CPUTIME_MINUTES ! CALCULATED CPU MINUTES DECLARE LONG CPUTIME_SECONDS ! CALCULATED CPU SECONDS DIM WORD DATA_BUF(5%) ! 12 BYTE CHARACTERISTICS BUFFER DECLARE LONG DAY_LIMIT ! DAY LIMIT FOR LOGGING IN DECLARE WORD DECCRT_LENGTH ! LENGTH OF DECCRT DECLARE LONG DEC_DIV ! FOR DEC_TO_OCT FUNCTION DECLARE LONG DEC_INPUT ! FOR DEC_TO_OCT FUNCTION DECLARE STRING DEVICE_SPEC ! DEVICE SPECIFICATION DECLARE STRING DIRECTORY_SPEC ! DIRECTORY SPECIFICATION DECLARE DVIBUF DVIITEM ! EQUATE $GETDVIW RECORD DECLARE WORD ERROR_CODE ! ERROR POSITION VALUE DECLARE STRING ERROR_LINE ! ERROR LINE DESCRIPTION DIM WORD FIELD_BIT_OFF(MAX_SEARCH) ! BIT OFF/CNTD STR POS/QUAD VAL DIM WORD FIELD_BYTE_OFF(MAX_SEARCH) ! BYTE OFFSET DIM STRING FIELD_CMD_FILE(MAX_SEARCH) ! FIELD COMMAND FILE PARAM NAMES DIM STRING FIELD_DESC(MAX_SEARCH) ! DESC OF FIELD DIM STRING FIELD_HEADER(MAX_SEARCH) ! PRINT HEADER FOR THIS FIELD DECLARE LONG FIELD_INDEX ! INDEX INTO FIELD ARRAYS DECLARE WORD FIELD_LEN ! POSITIVE VALUE LENGTH OF FIELD DIM WORD FIELD_LENGTH(MAX_SEARCH) ! LENGTH OF FIELD DIM STRING FIELD_TYPE(MAX_SEARCH) ! TYPE OF FIELD TO SEARCH FOR DIM WORD FIELD_WIDTH(MAX_SEARCH) ! FULL PRINTED WIDTH DIM WORD FIELD_WIDTH_TRUNCATED( & MAX_SEARCH) ! TRUNCATED PRINTED WIDTH DECLARE WORD FILL_OFFSET ! OFFSET BYTES FOR REMAP DECLARE WORD FIRST_HOUR ! FIRST HOURLY RESTRICTION DECLARE LONG FLAG ! TEMPORARY FLAG VARIABLE DIM WORD FLAG_BIT_OFF(MAX_FLAG) ! BIT OFFSET DIM WORD FLAG_BYTE_OFF(MAX_FLAG) ! BYTE OFFSET DIM STRING FLAG_DESC(MAX_FLAG) ! DESC OF LOGIN FLAG DIM STRING FLAG_TYPE(MAX_FLAG) ! TYPE OF LOGIN FLAG DIM WORD FLAGS_BIT_OFF(MAX_FLAGS) ! BIT OFFSET DIM WORD FLAGS_BYTE_OFF(MAX_FLAGS) ! BYTE OFFSET DIM STRING FLAGS_DESC(MAX_FLAGS) ! DESC OF FLAG TO SEARCH FOR DIM WORD FLAGS_LENGTH(MAX_FLAGS) ! LENGTH OF SEARCH FLAG DIM STRING FLAGS_TYPE(MAX_FLAGS) ! TYPE OF SEARCH FLAG DECLARE STRING HOLDER_LIST ! LIST OF IDENTIFIER HOLDERS DECLARE LONG ID ! IDENTIFIER VALUE DECLARE WORD ID_NAME_LENGTH ! LENGTH OF ID_NAME DECLARE LONG IDENTIFIER_ATTRIBUTES ! IDENTIFIER ATTRIBUTES DECLARE STRING IDENTIFIER_LIST ! LIST OF HELD IDENTIFIERS DECLARE STRING IDENT_PRINT_STR ! TEMP IDENTIFIER STRING DIM WORD IOSB(3%) ! I/O STATUS BLOCK FROM QIOW DECLARE JPIBUF JPIITEM ! EQUATE $GETJPIW RECORD DECLARE LONG JULIAN_DAYS ! FOR DELTA_DATES FUNCTION DECLARE LONG LINE_COUNTER ! COUNT OF REPORT LINES DECLARE WORD LINE_LENGTH ! TOTAL LINE LENGTH COUNTER DECLARE LONG LINES_PER_PAGE ! NUMBER OF LINES ON A PAGE DECLARE WORD LINPUT_FLAG ! TRUE WHEN LINPUTing DECLARE WORD LOGIN_FLAGS_WANTED ! TRUE IF LOGIN FLAGS WANTED DECLARE WORD LOG_LENGTH ! LENGTH OF LOGICAL NAME DECLARE LONG LONGEST_FLAG_DESC ! LENGTH OF LONGEST FLAG DECLARE LONG LONGEST_PRIV_DESC ! LENGTH OF LONGEST PRIVILEGE DECLARE WORD MATCHING_IDENT ! TRUE IF MATCHING IDENTIFIER DECLARE WORD MAX_ROW ! MAXIMUM ROW POSITION DECLARE LONG MY_LONGWORD ! LOCAL STATIC LONGWORD STORAGE DECLARE LONG MY_LONGWORD2 ! LOCAL STATIC LONGWORD STORAGE DECLARE LONG NEXT_DELIM ! NEXT DELIM IN IDENTIFIER LIST DECLARE STRING NEXT_IDENTIFIER ! NEXT EXTRACTED IDENTIFIER DECLARE WORD NOMATCH ! TRUE IF NO MATCHING IDENTIFIER DECLARE LONG OCT_OUTPUT ! FOR DEC_TO_OCT FUNCTION DECLARE WORD OPENING_NETUAF_FLAG ! 1 IF OPENING NETUAF/NETPROXY DECLARE STRING POSSIBLE_CHOICES ! LIST OF POSSIBLE MENU CHOICES DECLARE LONG PAGE_COUNTER ! PAGE COUNTER DECLARE WORD PRE_EXPIRED_RESPONSE ! PRE-EXPIRED FLAG USER-RESPONSE DECLARE WORD PREV_BYTE_OFFSET ! PREVIOUS BYTE OFFSET DECLARE WORD PREV_HOUR ! PREVIOUS HOURLY RESTRICTION DECLARE WORD PRINT_IDENTIFIER_ATTRIBUTES! TRUE TO PRINT IDENT ATTRIBUTES DECLARE WORD PRINT_IDENTIFIERS_WANTED ! IF IDENTIFIERS TO BE PRINTED DIM WORD PRIV_BIT_OFF(MAX_PRIV) ! BIT OFFSET DIM WORD PRIV_BYTE_OFF(MAX_PRIV) ! BYTE OFFSET DIM STRING PRIV_DESC(MAX_PRIV) ! DESC OF PRIVILEGE DECLARE LONG PRIV_IDX ! INDEX FOR PRIVILEGE ARRAYS DIM STRING PRIV_TYPE(MAX_PRIV) ! TYPE OF PRIV TO SEARCH FOR DECLARE STRING PROXY_DESC ! CHAR TO HOLD PROXY DESCR DECLARE STRING REMOTE_NODE_NAME ! NAME OF REMOTE NODE DECLARE LONG REPORT_COUNTER ! NUMBER OF REPORT ITEMS IN MEM DIM LONG REPORT_INDEX(MAX_SEARCH) ! LIST OF REPORT ITEM INDICES DECLARE STRING REPORT_OPTIONS ! USER-SELECTED MISC OPTIONS DECLARE STRING REPORT_OUTPUT ! S=SCREEN, F=FILE OUTPUT DECLARE WORD REPORT_RECORD_WRITTEN ! TRUE IF WRITTEN TO OUTPUT FILE DECLARE STRING REPORT_SEARCH ! USER-SELECTED SEARCH FIELDS DECLARE STRING REPORT_TYPE ! USER-SELECTED REPORT TYPE DECLARE LONG REPORT_WIDTH ! WIDTH OF REPORT (80 OR 132) DIM LONG REPORT_WIDTHS(MAX_SEARCH) ! LIST OF REPORT FIELD WIDTHS DECLARE WORD RESTRICTED_ACCESS ! TRUE IF ANY ACCESS RESTRICTION DECLARE STRING RETURNED_USERNAME ! USERNAME FROM $GETJPIW DECLARE STRING RJL0_STRING ! FOR RJL0 FUNCTION DECLARE STRING RJLB_STRING ! FOR RJLB FUNCTION DECLARE WORD ROW ! ROW POSITION DECLARE WORD SAVE_ERROR ! SAVED ERROR VALUE DIM WORD SEARCH_BIT_OFF(MAX_SEARCH) ! BIT OFF/CNTD STR POS/QUAD VAL DIM WORD SEARCH_BYTE_OFF(MAX_SEARCH) ! BYTE OFFSET TO SEARCH FOR DECLARE LONG SEARCH_COUNTER ! MAX ARRAY INDEX FOR SEARCHING DIM STRING SEARCH_DESC(MAX_SEARCH) ! DESC OF FIELD TO SEARCH FOR DECLARE LONG SEARCH_ELEMENT ! SEARCH SUBSTRING ELEMENT DECLARE WORD SEARCH_FAILS ! TRUE IF SEARCH FAILS DECLARE WORD SEARCH_FOR_HELD_IDENTS ! TRUE IF SEARCH FOR HELD IDENTS DECLARE WORD SEARCH_FOR_QUOTA ! TRUE TO SEARCH FOR QUOTA LABEL DIM STRING SEARCH_HOLDERS(MAX_SEARCH) ! IDENT HOLDERS TO SEARCH FOR DECLARE WORD SEARCH_INDEX ! ARRAY INDEX FOR SEARCH ITEM DIM WORD SEARCH_LENGTH(MAX_SEARCH) ! LENGTH OF FIELD TO SEARCH FOR DIM LONG SEARCH_LONG(MAX_SEARCH) ! LONGWORD VALUE TO SEARCH FOR DIM LONG SEARCH_LONG2(MAX_SEARCH) ! LONGWORD VALUE TO SEARCH FOR DIM STRING SEARCH_TEXT(MAX_SEARCH) ! FIELD SUBSTRING TO SEARCH FOR DIM STRING SEARCH_TEXT2(MAX_SEARCH) ! FIELD SUBSTRING TO SEARCH FOR DIM WORD SEARCH_TYPE(MAX_SEARCH) ! TYPE CODE OF FIELD TO SEARCH DECLARE WORD SKIP_DISUSERED_ACCTS ! TRUE TO SKIP DISUSER'ED ACCTS DECLARE WORD SKIP_THIS_USER ! TRUE TO SKIP THIS USERNAME DECLARE STRING STRING_TO_PRINT ! STRING TO BE PRINTED DECLARE LONG SYS_STATUS ! SYSTEM SERVICE EXIT STATUS DECLARE STRING SYSUAF_FILE_SPEC ! SYSUAF/NETUAF TRANSLATIONS DECLARE LONG TEMP ! TEMPORARY LONG STORAGE DECLARE LONG TEMP1 ! TEMPORARY LONG STORAGE DECLARE LONG TEMP2 ! TEMPORARY LONG STORAGE DECLARE STRING TEMP_DAY ! TEMPORARY DAY STORAGE DECLARE STRING TEMP_STRING ! TEMPORARY STRING STORAGE DECLARE STRING TEMP_STRING2 ! TEMPORARY STRING STORAGE DECLARE WORD TERMINAL_WIDTH ! EXTRACTED TERMINAL WIDTH DECLARE WORD TERMINAL_WIDTH_CHANGED ! TRUE IF TERMINAL WIDTH CHANGED DECLARE LONG TODAYS_DATE ! TODAY'S JULIAN DATE DECLARE TRNBUF TRNITEM ! EQUATE $TRNLNM RECORD DECLARE LONG UIC_GROUP ! CALCULATED OCTAL UIC GROUP DECLARE LONG UIC_MEMBER ! CALCULATED OCTAL UIC MEMBER DECLARE STRING USER_DATA_STRING ! STRING STORAGE FOR USER DATA DECLARE WORD USERNAME_LENGTH ! LENGTH OF USERNAME DECLARE WORD USER_NAME_PRINTED ! TRUE IF USERNAME PRINTED DECLARE STRING USER_SEARCH_INP ! USER-ENTERED SEARCH RESPONSE DECLARE WORD VALID_ENTRY ! TRUE IF VALID USER ENTRY DECLARE WORD VALID_NODE_NAME ! TRUE IF VALID NODE NAME ! ----- MAP VARIABLES REQUIRING FIXED-LENGTH STRINGS ----- MAP (ASCT) WORD TIME_BUFFER(6%), ! TIME FROM $NUMTIM & LONG CLUNK_DATE(1%), ! FROM_CLUNKS DATE & LONG FIRST_BINTIM(1%), ! DATE FOR DELTA_DATES & STRING TIME_STRING = 23%! TIME FROM $ASCTIM ! ----- MAPPED VARIABLE FOR CAPITALIZE_FIRST FUNCTION ----- MAP (CAPITAL) STRING MAPPED_STRING = 32% MAP (CAPITAL) BYTE MAPPED_BYTES(31%) ! ----- DEFINE REQUIRED VARIABLES FOR $GETDVI SYSTEM SERVICE ----- MAP (DVIMAP) LONG DECCRT ! DEC CRT? MAP (HOLDQUAD) LONG HOLDER(1%) ! HOLDER UIC QUADWORD MAP (IDNAME) STRING ID_NAME = 32% ! IDENTIFIER NAME BUFFER ! ----- DEFINE REQUIRED VARIABLES FOR $GETJPI SYSTEM SERVICE ----- MAP (JPIMAP) STRING JPI_USERNAME=12% ! USERNAME ! -------------------------------------------------------------- ! ----- FOLLOWING NETUAF_FLAGS BITS ARE TURNED ON IF ENABLED: ----- ! ----- NETUAF_FLAGS: ----- ! ----- BIT 0 = ALLOW TASK=0 ACCESS ----- ! ----- BIT 1 = ALLOW BATCH JOBS ----- ! ----- BIT 2 = ALLOW INTERACTIVE LOGIN ----- ! ----- BITS 3 - 31 = ----- ! -------------------------------------------------------------- MAP (NUAF) ! ----- REMOTE_NODE_USER IS THE PRIMARY KEY --- & STRING REMOTE_NODE_USER = 64%, & ! ----- LOCAL_USER IS THE ALTERNATE KEY ----- & STRING LOCAL_USER = 32%, & LONG NETUAF_FLAGS ! NETUAF.DAT FILE LAYOUT MAP (NUAF) STRING REMOTE_NODE = 32%, & STRING REMOTE_USER = 32%! NETUAF.DAT FILE LAYOUT ! -------------------------------------------------------------- ! ----- FOLLOWING NETPROXY_FLAGS BITS ARE TURNED ON IF ENABLED: ----- ! ----- NETPROXY_FLAGS: ----- ! ----- BIT 0 = ALLOW TASK=0 ACCESS ----- ! ----- BIT 1 = ALLOW BATCH JOBS ----- ! ----- BIT 2 = ALLOW INTERACTIVE LOGIN ----- ! ----- BIT 3 = REMOTE USER USES UIC AUTHENTIFICATION ----- ! ----- BITS 4 - 31 = ----- ! -------------------------------------------------------------- MAP (NUAF2) WORD RECORD_FORMAT_VERS,! FORMAT VERSION (S/B 1)& WORD RECORD_LENGTH, ! LENGTH OF THIS RECORD & WORD REMOTE_NODE_LENGTH,! LENGTH OF REMOTE_NODE2& WORD REMOTE_USER_LENGTH,! LENGTH OF REMOTE_USER2& LONG NETPROXY_FLAGS, ! NETPROXY FLAGS & ! ----- REMOTE_NODE_USER2 IS THE PRIMARY KEY -- & STRING REMOTE_NODE_USER2 = 64%, & STRING MORE_STUFF = 580%! NETPROXY.DAT FILE LAYOUT MAP (NUAF2) STRING FILL = 12%, & STRING REMOTE_NODE2 = 32%, & STRING REMOTE_USER2 = 32% ! NETPROXY.DAT FILE LAYOUT MAP (NUAF2) STRING FILL = 44%, & LONG REMOTE_UIC ! NETPROXY.DAT FILE LAYOUT MAP (NUAF2) STRING FILL = 44%, & WORD REMOTE_MEMBER_UIC, & WORD REMOTE_GROUP_UIC ! NETPROXY.DAT FILE LAYOUT ! ----- USED TO MAP OVER DIFFERENT SECTIONS OF MORE_STUFF ----- MAP DYNAMIC (NUAF2) WORD PROXY_LENGTH, & WORD PROXY_TYPE,! 1=DEFAULT, 2=NON-DEFLT& STRING LOCAL_PROXY MAP (TRNLNM) STRING LOG_NAME = 255% ! LOGICAL NAME FROM $TRNLNM ! -------------------------------------------------------------- ! ----- FOLLOWING PRIVILEGE BITS ARE TURNED ON IF ENABLED: ----- ! ----- (DEFAULT_PRIVILEGES() ARE THE SAME AS PRIVILEGES()) ----- ! ----- PRIVILEGES(0%): ----- ! ----- BIT 0 = CMKRNL (MAY CHANGE MODE TO KERNEL) ----- ! ----- BIT 1 = CMEXEC (MAY CHANGE MODE TO EXEC) ----- ! ----- BIT 2 = SYSNAM (MAY INSERT IN SYST LOG NAME TABLE) ----- ! ----- BIT 3 = GRPNAM (MAY INSERT IN GROUP LOG NAME TABLE) ---- ! ----- BIT 4 = ALLSPOOL (MAY ALLOCATE SPOOLED DEVICES) ----- ! ----- BIT 5 = DETACH (MAY CREATE DETACHED PROCESSES) ----- ! ----- BIT 6 = DIAGNOSE (MAY DIAGNOSE DEVICES) ----- ! ----- BIT 7 = LOG_IO (MAY DO LOGICAL I/O) ----- ! ----- PRIVILEGES(1%): ----- ! ----- BIT 0 = GROUP (MAY AFFECT OTHER GROUP PROCESSES) ----- ! ----- BIT 1 = ACNT (MAY SUPPRESS ACCOUNTING MESSAGE) ----- ! ----- BIT 2 = PRMCEB (MAY CREATE PERM. COMM. EVNT CLSTRS) ---- ! ----- BIT 3 = PRMMBX (MAY CREATE PERMANENT MAILBOX) ----- ! ----- BIT 4 = PSWAPM (MAY CHANGE PROCESS SWAP MODE) ----- ! ----- BIT 5 = ALTPRI (MAY SET ANY PRIORITY VALUE) ----- ! ----- BIT 6 = SETPRV (MAY SET ANY PRIVILEGE BITS) ----- ! ----- BIT 7 = TMPMBX (MAY CREATE TERMPORARY MAILBOX) ----- ! ----- PRIVILEGES(2%): ----- ! ----- BIT 0 = WORLD (MAY AFFECT OTHER WORLD PROCESSES) ----- ! ----- BIT 1 = MOUNT (MAY EXECUTE MOUNT ACP FUNCTIONS) ----- ! ----- BIT 2 = OPER (OPERATOR PRIVILEGE) ----- ! ----- BIT 3 = EXQUOTA (MAY EXCEED QUOTAS) ----- ! ----- BIT 4 = NETMBX (MAY CREATE NETWORK DEVICE) ----- ! ----- BIT 5 = VOLPRO (MAY OVERRIDE VOLUME PROTECTION) ----- ! ----- BIT 6 = PHY_IO (MAY DO PHYSICAL I/O) ----- ! ----- BIT 7 = BUGCHK (MAY MAKE BUG CHECK ERROR LOG ENTRIES) -- ! ----- PRIVILEGES(3%): ----- ! ----- BIT 0 = PRMGBL (MAY CREATE PERM. GLOBAL SECTIONS) ----- ! ----- BIT 1 = SYSGBL (MAY CREATE SYSTEM GLOBAL SECTIONS) ----- ! ----- BIT 2 = PFNMAP (MAY MAP TO SECTION BY PFN) ----- ! ----- BIT 3 = SHMEM (MAY ALLOCATE STRUCTURES IN SHARED MEM) -- ! ----- BIT 4 = SYSPRV (ELIGIBLE FOR SYSTEM PROTECTION FIELD) -- ! ----- BIT 5 = BYPASS (MAY BYPASS UIC BASED PROTECTION) ----- ! ----- BIT 6 = SYSLCK (MAY CREATE SYSTEM WIDE LOCKS) ----- ! ----- BIT 7 = SHARE (MAY ASSIGN CHANNEL TO NON-SHARED DEV) --- ! ----- PRIVILEGES(4%): ----- ! ----- BIT 0 = UPGRADE (MAY UPGRADE CLASSIFICATION) ----- ! ----- BIT 1 = DOWNGRADE (MAY DOWNGRADE CLASSIFICATION) ----- ! ----- BIT 2 = GRPPRV (GROUP ACCESS BY SYSTEM PROT FIELD) ----- ! ----- BIT 3 = READALL (READ ACCESS TO EVERYTHING) ----- ! ----- BIT 4 = TMPJNL (MAY CREATE TEMPORARY JOURNALS) ----- ! ----- BIT 5 = PRMJNL (MAY CREATE PERMANENT JOURNALS) ----- ! ----- BIT 6 = SECURITY (MAY PERFORM SECURITY FUNCTIONS) ----- ! --------------------------------------------------------- ! ----- FOLLOWING FLAG BITS ARE TURNED ON IF ENABLED: ----- ! ----- FLAGS(0%): ----- ! ----- BIT 0 = DISCTLY ----- ! ----- BIT 1 = DEFCLI ----- ! ----- BIT 2 = LOCKPWD ----- ! ----- BIT 3 = RESTRICTED (PRE VMS V5.2 CAPTIVE) ----- ! ----- BIT 4 = DISACNT ----- ! ----- BIT 5 = DISWELCOME ----- ! ----- BIT 6 = DISNEWMAIL ----- ! ----- BIT 7 = DISMAIL ----- ! ----- FLAGS(1%): ----- ! ----- BIT 0 = GENPWD ----- ! ----- BIT 1 = PWD_EXPIRED ----- ! ----- BIT 2 = PWD2_EXPIRED ----- ! ----- BIT 3 = AUDIT ----- ! ----- BIT 4 = DISREPORT ----- ! ----- BIT 5 = DISRECONNECT ----- ! ----- BIT 6 = AUTOLOGIN ----- ! ----- BIT 7 = DISFORCE PWD CHANGE ----- ! ----- FLAGS(2%): ----- ! ----- BIT 0 = CAPTIVE ----- ! ----- BIT 1 = DISIMAGE ----- ! -------------------------------------------------------------- ! ----- PRIMARY DAY RESTRICTED HOURS ARE NOTED BY SETTING ONE OR ----- ! ----- MORE OF THE FOLLOWING BITS CORRESPONDING TO THE DESIRED ----- ! ----- HOUR(S): ----- ! ----- ! ----- NETWORK_ACCESS(0%), BATCH_ACCESS(0%), LOCAL_ACCESS(0%), ----- ! ----- DIALUP_ACCESS(0%), REMOTE_ACCESS(0%) ----- ! ----- BIT 0 = 0 ----- ! ----- BIT 1 = 1 ----- ! ----- BIT 2 = 2 ----- ! ----- BIT 3 = 3 ----- ! ----- BIT 4 = 4 ----- ! ----- BIT 5 = 5 ----- ! ----- BIT 6 = 6 ----- ! ----- BIT 7 = 7 ----- ! ----- NETWORK_ACCESS(1%), BATCH_ACCESS(1%), LOCAL_ACCESS(1%), ----- ! ----- DIALUP_ACCESS(1%), REMOTE_ACCESS(1%) ----- ! ----- BIT 0 = 8 ----- ! ----- BIT 1 = 9 ----- ! ----- BIT 2 = 10 ----- ! ----- BIT 3 = 11 ----- ! ----- BIT 4 = 12 ----- ! ----- BIT 5 = 13 ----- ! ----- BIT 6 = 14 ----- ! ----- BIT 7 = 15 ----- ! ----- NETWORK_ACCESS(2%), BATCH_ACCESS(2%), LOCAL_ACCESS(2%), ----- ! ----- DIALUP_ACCESS(2%), REMOTE_ACCESS(2%) ----- ! ----- BIT 0 = 16 ----- ! ----- BIT 1 = 17 ----- ! ----- BIT 2 = 18 ----- ! ----- BIT 3 = 19 ----- ! ----- BIT 4 = 20 ----- ! ----- BIT 5 = 21 ----- ! ----- BIT 6 = 22 ----- ! ----- BIT 7 = 23 ----- ! -------------------------------------------------------------- ! ----- SECONDARY DAY RESTRICTED HOURS ARE NOTED BY SETTING ONE OR ----- ! ----- MORE OF THE FOLLOWING BITS CORRESPONDING TO THE DESIRED ----- ! ----- HOUR(S): ----- ! ----- ! ----- NETWORK_ACCESS(3%), BATCH_ACCESS(3%), LOCAL_ACCESS(3%), ----- ! ----- DIALUP_ACCESS(3%), REMOTE_ACCESS(3%) ----- ! ----- BIT 0 = 0 ----- ! ----- BIT 1 = 1 ----- ! ----- BIT 2 = 2 ----- ! ----- BIT 3 = 3 ----- ! ----- BIT 4 = 4 ----- ! ----- BIT 5 = 5 ----- ! ----- BIT 6 = 6 ----- ! ----- BIT 7 = 7 ----- ! ----- NETWORK_ACCESS(4%), BATCH_ACCESS(4%), LOCAL_ACCESS(4%), ----- ! ----- DIALUP_ACCESS(4%), REMOTE_ACCESS(4%) ----- ! ----- BIT 0 = 8 ----- ! ----- BIT 1 = 9 ----- ! ----- BIT 2 = 10 ----- ! ----- BIT 3 = 11 ----- ! ----- BIT 4 = 12 ----- ! ----- BIT 5 = 13 ----- ! ----- BIT 6 = 14 ----- ! ----- BIT 7 = 15 ----- ! ----- NETWORK_ACCESS(5%), BATCH_ACCESS(5%), LOCAL_ACCESS(5%), ----- ! ----- DIALUP_ACCESS(5%), REMOTE_ACCESS(5%) ----- ! ----- BIT 0 = 16 ----- ! ----- BIT 1 = 17 ----- ! ----- BIT 2 = 18 ----- ! ----- BIT 3 = 19 ----- ! ----- BIT 4 = 20 ----- ! ----- BIT 5 = 21 ----- ! ----- BIT 6 = 22 ----- ! ----- BIT 7 = 23 ----- ! -------------------------------------------------------------- ! ----- PRIMARY DAYS ARE NOTED BY TURNING OFF THE DESIRED BIT(S): ----- ! ----- SECONDARY DAYS ARE NOTED BY TURNING ON THE DESIRED BIT(S): ---- ! ----- PRIMEDAYS: ----- ! ----- BIT 0 = Monday ----- ! ----- BIT 1 = Tuesday ----- ! ----- BIT 2 = Wednesday ----- ! ----- BIT 3 = Thursday ----- ! ----- BIT 4 = Friday ----- ! ----- BIT 5 = Saturday ----- ! ----- BIT 6 = Sunday ----- ! -------------------------------------------------------------- MAP (UAF) STRING UAF_REC = 1412% MAP (UAF) STRING FILL = 36%, & ! ----- UIC_IDENTIFIER IS THE ----- & ! ----- ALTERNATE KEY #2 ----- & ! ----- (DUPLICATES, CHANGES) ----- & STRING UIC_IDENTIFIER = 8% MAP (UAF) STRING FILL = 4%, & STRING USER_NAME_NO_TAG = 31%, & STRING USER_NAME_TAG = 1%, & WORD OCT_UIC_MEMBER, & WORD OCT_UIC_GROUP MAP (UAF) BYTE UAF_RECORD_TYPE, & BYTE UAF_FORMAT_VERSION, & WORD USER_DATA_LENGTH, & ! ----- USER_NAME IS THE PRIMARY KEY ----- & ! ----- (NO DUPLICATES, NO CHANGES) ----- & STRING USER_NAME = 32%, ! ALJTB & ! ----- UIC IS THE ALTERNATE KEY #1 ----- & ! ----- (DUPLICATES, CHANGES) ----- & LONG UIC, & LONG USER_SUB_IDENTIFIER, & ! ----- PARENT_ID (EXTENDED USER ----- & ! ----- IDENTIFICATION) IS THE ALTERNATE ----- & ! ----- KEY #3 (DUPLICATES, CHANGES) ----- & STRING PARENT_ID = 8%, & STRING ACCOUNT_NAME = 32%, ! ALJTB & BYTE OWNER_NAME_LENGTH, & STRING OWNER_NAME = 31%, & BYTE DEVICE_LENGTH, & STRING THE_DEVICE = 31%, & BYTE DIRECTORY_NAME_LENGTH, & STRING DIRECTORY_NAME = 63%, & BYTE LOGIN_COMMAND_FILE_LENGTH, & STRING LOGIN_COMMAND_FILE = 63%, & BYTE CLI_LENGTH, & STRING CLI = 31%, & BYTE CLI_TABLES_LENGTH, & STRING CLI_TABLES = 31%, & STRING PASSWORD = 8%, ! HASHED & STRING PASSWORD2 = 8%, ! HASHED & WORD NUMBER_OF_LOGIN_FAILURES, & WORD RANDOM_PASSWORD_SEED, & BYTE ENCRYPTION_ALGORITHM, & BYTE ENCRYPTION_ALGORITHM_PASSWORD2, & BYTE MINIMUM_PASSWORD_LENGTH, & BYTE FILL1, & LONG ACCOUNT_EXPIRATION_DATE(1%), ! CLUNKS & LONG PASSWORD_LIFETIME(1%), ! CLUNKS & ! ----- (PASSWORD PRE-EXPIRED IF ----- & ! ----- DATE_OF_PASSWORD_CHANGE(0)=-1 AND ----- & ! ----- DATE_OF_PASSWORD_CHANGE(1)=-1) ----- & LONG DATE_OF_PASSWORD_CHANGE(1%), ! CLUNKS & LONG DATE_OF_PASSWORD2_CHNGE(1%), ! CLUNKS & LONG LAST_INTER_LOGIN_DATE(1%), ! CLUNKS & LONG LAST_NINTER_LOGIN_DATE(1%), ! CLUNKS & BYTE PRIVILEGES(7%), & BYTE DEFAULT_PRIVILEGES(7%), & STRING MINIMUM_SECURITY_CLASS = 20%, ! COUNTED & STRING MAXIMUM_SECURITY_CLASS = 20%, ! COUNTED & BYTE FLAGS(3%), & BYTE NETWORK_ACCESS(5%), & BYTE BATCH_ACCESS(5%), & BYTE LOCAL_ACCESS(5%), & BYTE DIALUP_ACCESS(5%), & BYTE REMOTE_ACCESS(5%), & STRING CUSTOMER_SITE_SPECIFIC_DATA = 12%, & BYTE PRIMEDAYS, & BYTE FILL2, & BYTE BASE_PRIORITY, & BYTE MAX_JOB_QUEUEING_PRIORITY, & WORD MAXJOBS, ! (0=NO LIMIT) & WORD MAXACCTJOBS, ! (0=NO LIMIT) & WORD MAXDETACH, ! (0=NO LIMIT) & WORD PRCLM, ! SUBPROCESS CREATION LIMIT & WORD BIOLM, ! BUFFERED I/O LIMIT & WORD DIOLM, ! DIRECT I/O LIMIT & WORD TQELM, ! TIMER QUEUE ENTRY LIMIT & WORD ASTLM, ! AST QUEUE LIMIT & WORD ENQLM, ! ENQUEUE LIMIT & WORD FILLM, ! OPEN FILE LIMIT & WORD SHRFILLM, ! SHARED FILE LIMIT & LONG WSQUOTA, ! WORKING SET QUOTA & LONG WSDEFAULT, ! DEFAULT WORKING SET SIZE & LONG WSEXTENT, ! WORKING SET EXTENT & LONG PGFLQUOTA, ! PAGE FILE QUOTA & LONG CPUTIME, ! CPU TIME QUOTA & LONG BYTLM, ! BUFFER I/O BYTE COUNT LIMIT & LONG PBYTLM, ! PAGED BUF I/O BYT COUNT LIMIT & LONG JTQUOTA, ! JOB LOGICAL NAME TABLE QUOTA & WORD PROXY_LIM, ! # OF PROXIES USER CAN GRANT & WORD PROXIES, ! # OF PROXIES GRANTED & WORD ACNT_LIM, ! # OF SUB-ACCOUNTS ALLOWED & WORD ACCOUNTS, ! # OF SUB-ACCOUNTS IN USE & STRING FILL3 = 64%, & STRING USER_DATA_AREA = 768% ! ----- DEFINE DYNAMIC MAP USED TO MAP LOCAL VARIABLES OVER ----- ! ----- ENTIRE UAF MAP ----- MAP DYNAMIC (UAF) & LONG CLUNK_DATE1, & LONG CLUNK_DATE2, & LONG A_LONGWORD, & WORD A_WORD, & BYTE A_BYTE, & BYTE A_BYTE2, & STRING A_TEXT EXTERNAL LONG FUNCTION LIB$DAY ! RETURN JULIAN DATE EXTERNAL LONG FUNCTION SYS$ASCTIM ! CONVERT QUAD-WORD TO ASCII EXTERNAL LONG FUNCTION SYS$ASCTOID ! CONVERT ASCII TO IDENTIFIER EXTERNAL LONG FUNCTION SYS$ASSIGN ! ASSIGN I/O CHANNEL EXTERNAL LONG FUNCTION SYS$DASSGN ! DEASSIGN I/O CHANNEL EXTERNAL SUB SYS$EXIT ! EXIT WITH STATUS EXTERNAL LONG FUNCTION SYS$FIND_HOLDER ! FIND HOLDER OF AN IDENTIFIER EXTERNAL LONG FUNCTION SYS$FIND_HELD ! FIND IDENTIFIER THAT IS HELD EXTERNAL LONG FUNCTION SYS$FINISH_RDB ! TERMINATE RIGHTS DATA CONTEXT EXTERNAL LONG FUNCTION SYS$GETDVIW ! GET DEVICE INFORMATION/WAIT EXTERNAL LONG FUNCTION SYS$GETJPIW ! GET JOB INFORMATION + WAIT EXTERNAL LONG FUNCTION SYS$IDTOASC ! CONVERT IDENTIFIER TO ASCII EXTERNAL LONG FUNCTION SYS$NUMTIM ! CONVERT QUAD-WORD TO NUMERIC EXTERNAL LONG FUNCTION SYS$QIOW ! QUEUE I/O REQUEST AND WAIT EXTERNAL LONG FUNCTION SYS$TRNLNM ! TRANSLATE LOGICAL NAME ! ----- LOCAL FUNCTION THAT READS A NETUAF.DAT OR NETPROXY.DAT ----- ! ----- RECORD FOR A SPECIFIC LOCAL USERNAME ----- DEF LONG READ_NETUAF(STRING LOCAL_USER_NAME_TO_CHECK) ON ERROR GOTO READ_NETUAF_ERROR READ_NETUAF = REC_NOT_FOUND ! ASSUME NO MATCHING RECORD IF POS(SYSUAF_FILE_SPEC, "NETPROXY", 1%) <> 0% THEN ! ----- RESET FILE POINTER TO BEGINNING OF FILE ----- RESET #2%, KEY #0% WHILE TRUE ! ----- READ NEXT PROXY RECORD ----- GET #2%, REGARDLESS TEMP = 76% ! INIT TO BYTE 1 OF VAR-LENGTH AREA ! ----- FOR ALL LOCAL USERNAMES: ----- WHILE TEMP < RECORD_LENGTH REMAP (NUAF2) STRING FILL = & TEMP, & PROXY_LENGTH, & PROXY_TYPE, & LOCAL_PROXY = 32% ! ----- SEE IF MATCHING LOCAL ----- ! ----- DEFAULT USERNAME ----- IF LOCAL_USER_NAME_TO_CHECK = & LEFT(LOCAL_PROXY, & PROXY_LENGTH) AND & PROXY_TYPE = 1% THEN ! ----- FOUND A MATCH ----- UNLOCK #2% ! ----- RETURN SUCCESS ----- ! ----- STATUS ----- READ_NETUAF = SUCCESS EXIT DEF END IF ! ----- CALC OFFSET TO BEGINNING ----- ! ----- OF NEXT LOCAL USER ----- TEMP = TEMP + 4% + PROXY_LENGTH NEXT NEXT ELSE LOCAL_USER = LOCAL_USER_NAME_TO_CHECK GET #2%, KEY #1% EQ LOCAL_USER, REGARDLESS END IF UNLOCK #2% READ_NETUAF = SUCCESS ! RETURN SUCCESS STATUS EXIT DEF READ_NETUAF_ERROR: IF ERR = BUCKET_LOCKED THEN WAIT 1% RESUME END IF RESUME READ_NETUAF_EXIT IF ERR = REC_NOT_FOUND OR & ERR = END_OF_FILE ON ERROR GO BACK READ_NETUAF_EXIT: END DEF ! ----- LOCAL FUNCTION TO FORMAT A DD-MMM-YYYY DATE AS MM/DD/YY ----- DEF STRING MMDDYY(STRING MMDDYY_DATE) TEMP_STRING = MMDDYY_DATE ! ----- Find Month Index, Make Date MMDDYY ----- TEMP_STRING = "0" + RIGHT(TEMP_STRING, 2%) & IF LEFT(TEMP_STRING, 1%) = " " TEMP_STRING = NUM1$((POS("JANFEBMARAPRMAYJUNJULAUG"+ & "SEPOCTNOVDEC", MID(TEMP_STRING, 4%, 3%), 1%) & + 2%) / 3%) + "/" + LEFT(TEMP_STRING, 2%) + "/" & + MID(TEMP_STRING, 10%, 2%) ! ----- ENSURE LENGTH OF EIGHT ----- TEMP_STRING = "0" + TEMP_STRING IF LEN(TEMP_STRING) < 8% MMDDYY = TEMP_STRING ! RETURN DATE AS MM/DD/YY END DEF ! ----- LOCAL FUNCTION TO FORMAT A DD-MMM-YYYY DATE AS YYMMDD ----- DEF STRING YYMMDD(STRING MMDDYY_DATE) TEMP_STRING = MMDDYY_DATE ! ----- Find Month Index, Make Date MMDDYY ----- TEMP_STRING = "0" + RIGHT(TEMP_STRING, 2%) & IF LEFT(TEMP_STRING, 1%) = " " TEMP_DAY = NUM1$((POS("JANFEBMARAPRMAYJUNJULAUG"+ & "SEPOCTNOVDEC", MID(TEMP_STRING, 4%, 3%), 1%) & + 2%) / 3%) ! ----- ENSURE TWO-CHARACTER MONTH ----- TEMP_DAY = "0" + TEMP_DAY IF LEN(TEMP_DAY) < 2% YYMMDD = MID(TEMP_STRING, 10%, 2%) + TEMP_DAY + & LEFT(TEMP_STRING, 2%) ! RETURN DATE AS YYMMDD END DEF ! ----- LOCAL FUNCTION TO CONVERT FROM CLUNKS TO YYMMDD STRING ----- DEF STRING FROM_CLUNKS SYS_STATUS = SYS$ASCTIM(, TIME_STRING, CLUNK_DATE1 BY REF, ) CALL LIB$STOP(SYS_STATUS BY VALUE) & IF (SYS_STATUS AND 1%) <> SS$_NORMAL FROM_CLUNKS = TRM$(YYMMDD(TIME_STRING)) END DEF ! ----- LOCAL FUNCTION TO CONVERT FROM CLUNKS TO MM/DD/YY STRING ----- DEF STRING FROM_CLUNKS_MDY SYS_STATUS = SYS$ASCTIM(, TIME_STRING, CLUNK_DATE() BY REF, ) CALL LIB$STOP(SYS_STATUS BY VALUE) & IF (SYS_STATUS AND 1%) <> SS$_NORMAL FROM_CLUNKS_MDY = TRM$(MMDDYY(TIME_STRING)) END DEF ! ----- LOCAL FUNCTION TO CONVERT FROM CLUNKS TO ----- ! ----- "DD-MMM-YY HH:MM:SS.CC" STRING ----- DEF STRING FROM_CLUNKS_DMY SYS_STATUS = SYS$ASCTIM(, TIME_STRING, CLUNK_DATE() BY REF, ) CALL LIB$STOP(SYS_STATUS BY VALUE) & IF (SYS_STATUS AND 1%) <> SS$_NORMAL FROM_CLUNKS_DMY = EDIT$(TIME_STRING, 136%) END DEF ! ----- LOCAL FUNCTION TO LEFT-JUSTIFY STRING WITH TRAILING BLANKS ----- DEF STRING LJTBS(STRING LJTBS_STRING, LONG LJTBS_LENGTH) IF LEN(LJTBS_STRING) < LJTBS_LENGTH THEN LJTBS = LJTBS_STRING + SPACE$(LJTBS_LENGTH - & LEN(LJTBS_STRING)) ELSE LJTBS = LJTBS_STRING END IF END DEF ! ----- LOCAL FUNCTION TO RIGHT-JUSTIFY NUMBER WITH LEADING BLANKS ----- DEF STRING RJLB(LONG RJLB_INPUT, LONG RJLB_LENGTH) RJLB_STRING = NUM1$(RJLB_INPUT) IF LEN(RJLB_STRING) < RJLB_LENGTH THEN RJLB = SPACE$(RJLB_LENGTH - LEN(RJLB_STRING)) + & RJLB_STRING ELSE RJLB = RJLB_STRING END IF RJLB_STRING = "" END DEF ! ----- LOCAL FUNCTION TO RIGHT-JUSTIFY STRING WITH LEADING BLANKS ----- DEF STRING RJLBS(STRING RJLBS_STRING, LONG RJLBS_LENGTH) IF LEN(RJLBS_STRING) < RJLBS_LENGTH THEN RJLBS = SPACE$(RJLBS_LENGTH - & LEN(RJLBS_STRING)) + RJLBS_STRING ELSE RJLBS = RJLBS_STRING END IF END DEF ! ----- LOCAL FUNCTION TO RIGHT-JUSTIFY NUMBER WITH LEADING ZEROS ----- DEF STRING RJL0(LONG RJL0_INPUT, LONG RJL0_LENGTH) RJL0_STRING = NUM1$(RJL0_INPUT) IF LEN(RJL0_STRING) < RJL0_LENGTH THEN RJL0 = STRING$(RJL0_LENGTH - LEN(RJL0_STRING), & 48%) + RJL0_STRING ELSE IF LEN(RJL0_STRING) = RJL0_LENGTH THEN RJL0 = RJL0_STRING ELSE RJL0 = STRING$(RJL0_LENGTH, 42%) END IF END IF RJL0_STRING = "" END DEF ! ----- LOCAL FUNCTION THAT RETURNED CENTERED TEXT WITHIN WIDTH ----- DEF STRING CENTER_TEXT(STRING STRING_TO_CENTER) CENTER_TEXT = SPACE$((REPORT_WIDTH - & LEN(STRING_TO_CENTER)) / 2%) + STRING_TO_CENTER END DEF ! ----- LOCAL FUNCTION TO PRINT REPORT RANGE HEADINGS ----- DEF WORD PRINT_RANGE_HEADINGS PRINT_RANGE_HEADINGS = 0% ! ALWAYS RETURN ZERO ! ----- PRINT RANGE HEADINGS FOR ALL SEARCH CRITERIA ----- TEMP = 0% ! SET SO LOOP WILL EXECUTE WHILE TEMP < SEARCH_COUNTER TEMP = TEMP + 1% SELECT SEARCH_TYPE(TEMP) CASE 0%, 1% ! QUADWORD ABSOLUTE/DELTA TIME TEMP_STRING = "For " + SEARCH_DESC(TEMP) IF SEARCH_BIT_OFF(TEMP) = 0% THEN TEMP_STRING = TEMP_STRING + " from " IF SEARCH_TEXT(TEMP) = "" THEN TEMP_STRING = & TEMP_STRING + & " first date to " ELSE TEMP_STRING = & TEMP_STRING + & MID(SEARCH_TEXT(& TEMP), 3%, 2%) & + "/" + RIGHT( & SEARCH_TEXT( & TEMP), 5%) + & "/" + LEFT( & SEARCH_TEXT( & TEMP), 2%) + " to " END IF IF SEARCH_TEXT2(TEMP) = "" THEN TEMP_STRING = & TEMP_STRING + & " last date" ELSE TEMP_STRING = & TEMP_STRING + & MID( & SEARCH_TEXT2( & TEMP), 3%, 2%) & + "/" + RIGHT( & SEARCH_TEXT2( & TEMP), 5%) + & "/" + LEFT( & SEARCH_TEXT2( & TEMP), 2%) END IF END IF PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 2%, 3%, 16% ! FLAG BIT / QUADWORD SET/CLEAR TEMP_STRING = "For " + SEARCH_DESC(TEMP) PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 4%, 9% ! [UN]HELD IDENTIFIER SELECT SEARCH_TYPE(TEMP) CASE 4% ! HELD IDENTIFIER TEMP_STRING = & "For users holding" + & " exact identifier: " + & SEARCH_TEXT(TEMP) CASE 9% ! UN-HELD IDENTIFIER TEMP_STRING = & "For users not holding" & + " exact identifier: " & + SEARCH_TEXT(TEMP) END SELECT IF SEARCH_LONG(TEMP) = 0% THEN TEMP_STRING = TEMP_STRING + & " (regardless of any" + & " attributes)" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% ELSE TEMP_STRING = TEMP_STRING + " ..." PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% ATTRIBUTE_COUNTER = 0% TEMP_STRING = " ... with the" IF (SEARCH_LONG(TEMP) AND 1%) <> 0% THEN TEMP_STRING = & TEMP_STRING + & " RESOURCE" ATTRIBUTE_COUNTER = & ATTRIBUTE_COUNTER + 1% END IF IF (SEARCH_LONG(TEMP) AND 2%) <> 0% THEN TEMP_STRING = & TEMP_STRING + & " DYNAMIC" ATTRIBUTE_COUNTER = & ATTRIBUTE_COUNTER + 1% END IF IF ATTRIBUTE_COUNTER <> 0% THEN IF ATTRIBUTE_COUNTER = 1% THEN TEMP_STRING = & TEMP_STRING + & " attribute set" ELSE TEMP_STRING = & TEMP_STRING + & " attributes" & + " set" END IF ATTRIBUTE_COUNTER = -1% END IF IF (SEARCH_LONG(TEMP) AND 4%) <> 0% THEN IF ATTRIBUTE_COUNTER = -1% THEN TEMP_STRING = & TEMP_STRING + & " and the" ATTRIBUTE_COUNTER = 0% END IF TEMP_STRING = & TEMP_STRING + & " RESOURCE" ATTRIBUTE_COUNTER = & ATTRIBUTE_COUNTER + 1% END IF IF (SEARCH_LONG(TEMP) AND 8%) <> 0% THEN IF ATTRIBUTE_COUNTER = -1% THEN TEMP_STRING = & TEMP_STRING + & " and the" ATTRIBUTE_COUNTER = 0% END IF TEMP_STRING = & TEMP_STRING + & " DYNAMIC" ATTRIBUTE_COUNTER = & ATTRIBUTE_COUNTER + 1% END IF IF ATTRIBUTE_COUNTER > 0% THEN IF ATTRIBUTE_COUNTER = 1% THEN TEMP_STRING = & TEMP_STRING + & " attribute" & + " not set" ELSE TEMP_STRING = & TEMP_STRING + & " attributes" & + " not set" END IF END IF PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% END IF CASE 5% ! SEARCH FOR CONTAINING TEXT TEMP_STRING = "For " + & SEARCH_DESC(TEMP) + & " containing: " + SEARCH_TEXT(TEMP) PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 6% ! SEARCH FOR UIC GROUP TEMP_STRING = "For users having a UIC" & + " Group of " + & NUM1$(SEARCH_LONG(TEMP)) PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 7% ! ANY EXISTING USERDATA TEMP_STRING = "For users having any Userdata" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 8% ! QUOTA OR VALUE RANGE TEMP_STRING = "For " + & SEARCH_DESC(TEMP) + " from " + & NUM1$(SEARCH_LONG(TEMP)) + & " to " + NUM1$(SEARCH_LONG2(TEMP)) PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 10% ! ANY ACCESS RESTRICTIONS TEMP_STRING = "For users having any" + & " Access Restriction" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 11% ! PRIMARY ACCESS TEMP_STRING = "For Primary " + & SEARCH_DESC(TEMP) + " from " + & NUM1$(SEARCH_LONG(TEMP)) + & " to " + NUM1$(SEARCH_LONG2(TEMP)) PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 12% ! PRIMARY DAY TEMP_STRING = "For users having " + & SEARCH_DESC(TEMP) + " as a Primary day" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 13% ! SECONDARY DAY TEMP_STRING = "For users having " + & SEARCH_DESC(TEMP) + & " as a Secondary day" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 14% ! SECONDARY ACCESS TEMP_STRING = "For Secondary " + & SEARCH_DESC(TEMP) + " from " + & NUM1$(SEARCH_LONG(TEMP)) + & " to " + NUM1$(SEARCH_LONG2(TEMP)) PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% CASE 15% ! CPUTIME TEMP_STRING = "For " + & SEARCH_DESC(TEMP) + " from " + & NUM1$(SEARCH_LONG(TEMP)) + & " seconds to " + & NUM1$(SEARCH_LONG2(TEMP)) + " seconds" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% END SELECT NEXT ! ----- SEE IF SORTING BY UIC ----- IF POS(REPORT_OPTIONS, "1", 1%) <> 0% THEN TEMP_STRING = "Sorted by Ascending UIC" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% END IF ! ----- SEE IF SKIPPING USERNAMES WHICH ARE ON A REMOTE ----- ! ----- NODE ----- IF POS(REPORT_OPTIONS, "2", 1%) <> 0% THEN TEMP_STRING = & "Skipping Users which exist on node: " +& REMOTE_NODE_NAME PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% END IF ! ----- SEE IF SKIPPING USERNAMES WHICH ARE NOT ON A ----- ! ----- REMOTE NODE ----- IF POS(REPORT_OPTIONS, "3", 1%) <> 0% THEN TEMP_STRING = & "Skipping Users which do not exist" + & " on node: " + REMOTE_NODE_NAME PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% END IF ! ----- SEE IF SEARCHING FOR ANY MATCHING SEARCH CRITERIA ----- ! ----- (RATHER THAN FOR ALL MATCHING SEARCH CRITERIA) ----- IF POS(REPORT_OPTIONS, "4", 1%) <> 0% THEN TEMP_STRING = & "Searching for users which match" + & " ANY of the above search criteria" PRINT #10%, CENTER_TEXT(TEMP_STRING) LINE_COUNTER = LINE_COUNTER + 1% END IF END DEF ! ----- LOCAL FUNCTION TO SEE IF A FIELD IS TO BE TRUNCATED ----- DEF STRING CIFLONG(STRING FIELD_TO_BE_TESTED, LONG MAX_FIELD_SIZE) ! ----- SEE IF WE SHOULD TRUNCATE EXTRA-LONG FIELDS ----- IF POS(REPORT_OPTIONS, "6", 1%) = 0% THEN ! ----- NO, SO RETURN FULL-LENGTH STRING ----- CIFLONG = FIELD_TO_BE_TESTED ELSE ! ----- YES, SO SEE IF FIELD IS TOO LONG ----- IF LEN(FIELD_TO_BE_TESTED) >= MAX_FIELD_SIZE THEN ! ----- FIELD IS TOO LONG - APPEND AN ----- ! ----- EXCLAMATION MARK IF TRUNCATING ANY ----- ! ----- SIGNIFICANT CHARACTERS ----- IF LEN(TRM$(FIELD_TO_BE_TESTED)) >= & MAX_FIELD_SIZE THEN CIFLONG = & LEFT(FIELD_TO_BE_TESTED,& MAX_FIELD_SIZE - 1%) + "!" ELSE CIFLONG = & LEFT(FIELD_TO_BE_TESTED,& MAX_FIELD_SIZE) END IF ELSE ! ----- FIELD IS NOT TOO LONG ----- CIFLONG = FIELD_TO_BE_TESTED END IF END IF END DEF ! ----- LOCAL FUNCTION TO PRINT NEW HEADINGS, IF NEEDED ----- DEF LONG CHECK_FOR_HEADINGS ON ERROR GOTO CHECK_FOR_HEADINGS_ERROR CHECK_FOR_HEADINGS = FALSE ! ASSUME SUCCESS STATUS ! ----- EXIT IF THE CURRENT PAGE IS NOT YET FILLED ----- EXIT DEF IF LINE_COUNTER < LINES_PER_PAGE ! ----- EXIT IF NO HEADINGS ARE SUPPOSED TO BE PRINTED ----- EXIT DEF IF POS(REPORT_OPTIONS, "5", 1%) <> 0% CHECK_FOR_HEADINGS = TRUE ! ASSUME ERROR STATUS PAGE_COUNTER = PAGE_COUNTER + 1% IF LINE_COUNTER <> 99% THEN IF REPORT_OUTPUT = "F" THEN ! ----- NO FORM FEED IF BUILDING A COMMAND ----- ! ----- FILE ----- IF NOT COMMAND_FILE THEN PRINT #10%, FF END IF ELSE PRINT #10% PRINT #10%, TAB((REPORT_WIDTH - 34%) / & 2%); & "(Press the RETURN key to continue)"; LINPUT_FLAG = TRUE LINPUT #10%, TEMP_STRING LINPUT_FLAG = FALSE IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF END IF END IF ! ----- CHECK FOR TYPE OF REPORT TO BE PRINTED ----- SELECT REPORT_TYPE CASE "A", "B" ! NORMAL SCREEN/FILE REPORT LINE_COUNTER = 4% TEMP_STRING = DATE$(0%) + " " + TIME$(0%) PRINT #10%, "Page " + NUM1$(PAGE_COUNTER); & TAB((REPORT_WIDTH - 13%) / 2%); & "SYSUAF Report"; & TAB(REPORT_WIDTH - 1% - & LEN(TEMP_STRING)); TEMP_STRING TEMP = PRINT_RANGE_HEADINGS PRINT #10% PRINT #10%, "Username"; TAB(13%); TEMP = 0% WHILE TEMP < REPORT_COUNTER TEMP = TEMP + 1% ! ----- SEE IF FIELD HEADER SHOULD BE LEFT ----- ! ----- OR RIGHT JUSTIFIED WITHIN THE ----- ! ----- FIELD WIDTH ----- SELECT FIELD_TYPE(REPORT_INDEX(TEMP)) CASE "FLAGMENU" ! LOGIN FLAGS (VARIABLE LENGTH) ! ----- SKIP FLAGS TILL END OF ----- ! ----- HEADING LINE ----- CASE "ACCESSMENU" ! ACCESS RESTRICTIONS (VAR LEN) ! ----- SKIP SINCE THEY PRINT ON ----- ! ----- SUBSEQUENT LINES ----- CASE "IDENT" ! HELD IDENTIFIERS ! ----- SKIP SINCE THEY PRINT ON ----- ! ----- SUBSEQUENT LINES ----- CASE "USERDATA" ! USERDATA ! ----- SKIP SINCE THIS PRINTS ON ----- ! ----- SUBSEQUENT LINES ----- CASE "AUTHPRIVMENU", "DEFPRIVMENU" ! AUTHORIZED OR DEFAULT PRIVS ! ----- SKIP SINCE THIS PRINTS ON ----- ! ----- SUBSEQUENT LINES ----- CASE "CPUTIME", "QUOTA", "VALUE" ! ----- PRINT RIGHT-JUSTIFIED ----- ! ----- HEADING ----- PRINT #10%, RJLBS(FIELD_HEADER( & REPORT_INDEX(TEMP)), & REPORT_WIDTHS(TEMP)); CASE ELSE ! ----- PRINT LEFT-JUSTIFIED ----- ! ----- HEADING ----- PRINT #10%, LJTBS(" " + & FIELD_HEADER( & REPORT_INDEX(TEMP)), & REPORT_WIDTHS(TEMP)); END SELECT NEXT ! ----- ALL LOGIN FLAGS WILL PRINT AT THE END ----- IF LOGIN_FLAGS_WANTED THEN PRINT #10%, " Login Flags:"; END IF PRINT #10% ! END DETAIL LINE IF PRINT_IDENTIFIERS_WANTED THEN IF PRINT_IDENTIFIER_ATTRIBUTES THEN PRINT #10%, TAB(20%); & "Held Identifiers" + & " Attributes" ELSE PRINT #10%, TAB(20%); "Held Identifiers" END IF LINE_COUNTER = LINE_COUNTER + 1% END IF ! ----- PRINT MINUS SIGNS ACROSS THE PAGE ----- PRINT #10%, STRING$(REPORT_WIDTH, 45%) CASE "C" ! FLAGS REPORT LINE_COUNTER = 4% + LONGEST_FLAG_DESC TEMP_STRING = DATE$(0%) + " " + TIME$(0%) PRINT #10%, "Page " + & NUM1$(PAGE_COUNTER); & TAB(29%); "SYSUAF FLAGS Report"; & TAB(79% - LEN(TEMP_STRING)); TEMP_STRING TEMP = PRINT_RANGE_HEADINGS PRINT #10% ! ----- FOR AS MANY HEADING LINES AS ARE IN THE ----- ! ----- LONGEST FLAG DESCRIPTION ----- FOR TEMP2 = 1% TO LONGEST_FLAG_DESC IF TEMP2 = LONGEST_FLAG_DESC THEN PRINT #10%, "Username"; TAB(33%); ELSE PRINT #10%, TAB(33%); END IF TEMP = 0% ! SO LOOP WILL WORK ! ----- FOR EACH POSSIBLE FLAG ITEM ----- WHILE TEMP < MAX_FLAG TEMP = TEMP + 1% TEMP_STRING = RJLBS(FLAG_DESC( & TEMP), LONGEST_FLAG_DESC) PRINT #10%, MID(TEMP_STRING, & TEMP2, 1%) + " "; NEXT PRINT #10% ! END HEADING DETAIL LINE NEXT TEMP2 ! ----- PRINT MINUS SIGNS ----- PRINT #10%, STRING$(MAX_FLAG * 2% + 33%, 45%) ! ----- PRINT FLAG LETTERS LEGEND ----- PRINT #10%, TAB(33%); TEMP = 0% ! SO LOOP WILL WORK WHILE TEMP < MAX_FLAG TEMP = TEMP + 1% PRINT #10%, MID(PRINT_STRING, TEMP, 1%) + " "; NEXT PRINT #10% ! END HEADING DETAIL LINE CASE "D", "H" ! PRIVILEGE REPORTS SELECT REPORT_TYPE CASE "D" ! PRIVILEGE REPORT LINE_COUNTER = 5% + LONGEST_PRIV_DESC TEMP_STRING = DATE$(0%) + " " + TIME$(0%) PRINT #10%, "Page " + & NUM1$(PAGE_COUNTER); & TAB(53%); "SYSUAF PRIVILEGE" + & " Report"; & TAB(131% - LEN(TEMP_STRING)); & TEMP_STRING CASE "H" ! SPECIAL PRIVILEGE REPORT LINE_COUNTER = 6% + LONGEST_PRIV_DESC TEMP_STRING = DATE$(0%) + " " + TIME$(0%) PRINT #10%, "Page " + & NUM1$(PAGE_COUNTER); & TAB(131% - LEN(TEMP_STRING)); & TEMP_STRING PRINT #10%, "SYSUAF PRIVILEGE" + & " Report of all users" + & " having other than" + & " GROUP/MOUNT/NETMBX" + & "/TMPMBX privileges" + & " (or priv'ed UIC)" + & " that are not DISUSERed" END SELECT TEMP = PRINT_RANGE_HEADINGS PRINT #10% ! ----- FOR AS MANY HEADING LINES AS ARE IN THE ----- ! ----- LONGEST PRIVILEGE DESCRIPTION ----- FOR TEMP2 = 1% TO LONGEST_PRIV_DESC SELECT TEMP2 CASE LONGEST_PRIV_DESC PRINT #10%, "Username"; TAB(33%); CASE ELSE PRINT #10%, TAB(33%); END SELECT TEMP = 0% ! SO LOOP WILL WORK ! ----- FOR EACH POSSIBLE PRIVILEGE ITEM ----- WHILE TEMP < MAX_PRIV TEMP = TEMP + 1% TEMP_STRING = RJLBS(PRIV_DESC( & TEMP), LONGEST_PRIV_DESC) PRINT #10%, MID(TEMP_STRING, & TEMP2, 1%) + " "; NEXT SELECT REPORT_TYPE CASE "D" ! PRIVILEGE REPORT ! ----- END HEADING DETAIL LINE ----- PRINT #10% CASE "H" ! SPECIAL PRIVILEGE REPORT SELECT TEMP2 CASE LONGEST_PRIV_DESC - 4% PRINT #10%, & " P" CASE LONGEST_PRIV_DESC - 3% PRINT #10%, & " r" CASE LONGEST_PRIV_DESC - 2% PRINT #10%, & " o" CASE LONGEST_PRIV_DESC - 1% PRINT #10%, & " Privileged x" CASE LONGEST_PRIV_DESC PRINT #10%, & " UIC y" CASE ELSE ! ----- END HEADING DETAIL ----- ! ----- LINE ----- PRINT #10% END SELECT END SELECT NEXT TEMP2 ! ----- PRINT MINUS SIGNS ACROSS THE PAGE ----- PRINT #10%, STRING$(REPORT_WIDTH, 45%) ! ----- PRINT PRIVILEGE LETTERS LEGEND ----- PRINT #10%, TAB(33%); TEMP = 0% ! SO LOOP WILL WORK WHILE TEMP < MAX_PRIV TEMP = TEMP + 1% PRINT #10%, MID(PRINT_STRING, TEMP, 1%) + " "; NEXT PRINT #10% ! END HEADING DETAIL LINE CASE "E" ! USERS WHO EVER LOGGED IN LINE_COUNTER = 4% TEMP_STRING = DATE$(0%) + " " + TIME$(0%) PRINT #10%, "Page " + & NUM1$(PAGE_COUNTER); & TAB(24%); & "Users Who Have Ever Logged In"; & TAB(79% - LEN(TEMP_STRING)); TEMP_STRING TEMP = PRINT_RANGE_HEADINGS PRINT #10% PRINT #10%, & " " + & "Date of Last Date of Last" PRINT #10%, & "Username Int" +& "eractive Login Non-Interactive Login" ! ----- PRINT 80 MINUS SIGNS ----- PRINT #10%, STRING$(80%, 45%) CASE "F" ! USERS WHO HAVE NEVER LOGGED IN LINE_COUNTER = 4% TEMP_STRING = DATE$(0%) + " " + TIME$(0%) PRINT #10%, "Page " + & NUM1$(PAGE_COUNTER); & TAB(24%); & "Users Who Have Never Logged In"; & TAB(79% - LEN(TEMP_STRING)); TEMP_STRING TEMP = PRINT_RANGE_HEADINGS PRINT #10% PRINT #10%, "Username" ! ----- PRINT 80 MINUS SIGNS ----- PRINT #10%, STRING$(80%, 45%) CASE "G" ! "N" DAYS NOT LOGGED IN ! ----- LIST OF USERNAMES AND DATES WHO HAVE NOT ----- ! ----- LOGGED IN WITHIN "N" DAYS ----- LINE_COUNTER = 6% TEMP_STRING = DATE$(0%) + " " + TIME$(0%) PRINT #10%, "Page " + NUM1$(PAGE_COUNTER); & TAB(79% - LEN(TEMP_STRING)); TEMP_STRING PRINT #10%, " Report of all users who have" + & " not logged in within the last " + & NUM1$(DAY_LIMIT) + " days" PRINT #10% TEMP = PRINT_RANGE_HEADINGS PRINT #10%, & " " + & "Date of Last Date of Last" PRINT #10%, & "Username Int" +& "eractive Login Non-Interactive Login" ! ----- PRINT 80 MINUS SIGNS ----- PRINT #10%, STRING$(80%, 45%) END SELECT CHECK_FOR_HEADINGS = FALSE ! RETURN SUCCESS STATUS EXIT DEF CHECK_FOR_HEADINGS_ERROR: RESUME LINPUT_ERROR IF LINPUT_FLAG ON ERROR GO BACK LINPUT_ERROR: END DEF ! ----- DECIMAL-TO-OCTAL CONVERSION FUNCTION ----- DEF LONG DEC_TO_OCT(LONG DEC_UIC) DEC_INPUT = DEC_UIC OCT_OUTPUT = 0% FOR TEMP = 6% TO 0% STEP -1% DEC_DIV = INT(DEC_INPUT / 8^TEMP) IF DEC_DIV > 0% THEN OCT_OUTPUT = OCT_OUTPUT + 10^TEMP * DEC_DIV DEC_INPUT = DEC_INPUT - 8^TEMP * DEC_DIV END IF NEXT TEMP DEC_TO_OCT = OCT_OUTPUT END DEF ! ----- LOCAL FUNCTION TO RETURN THE DIFFERENCE IN DATES ----- ! ----- BETWEEN A QUADWORD AND TODAY ----- DEF LONG DELTA_DATES SYS_STATUS = LIB$DAY(JULIAN_DAYS, FIRST_BINTIM() BY REF, ) CALL LIB$STOP(SYS_STATUS BY VALUE) & IF (SYS_STATUS AND 1%) <> SS$_NORMAL DELTA_DATES = ABS%(TODAYS_DATE - JULIAN_DAYS) END DEF ! ----- LOCAL FUNCTION TO LOOK UP ALL IDENTIFIERS ASSOCIATED WITH ----- ! ----- A SPECIFIC UIC (AND THEIR ATTRIBUTES, IF WANTED) ----- DEF LONG LOCATE_IDENTIFIER LOCATE_IDENTIFIER = TRUE ! ASSUME ERROR STATUS IDENTIFIER_LIST = "~" ! INIT LIST OF HELD IDENTIFIERS CONTEXT = 0% HOLDER(0%) = UIC HOLDER(1%) = 0% SYS_STATUS = SS$_NORMAL WHILE SYS_STATUS = SS$_NORMAL SYS_STATUS = SYS$FIND_HELD(HOLDER() BY REF, & ID, IDENTIFIER_ATTRIBUTES, CONTEXT) SELECT SYS_STATUS CASE SS$_NORMAL SYS_STATUS = SYS$IDTOASC(ID BY VALUE, & ID_NAME_LENGTH, ID_NAME,,,) SELECT SYS_STATUS CASE SS$_NORMAL ITERATE IF ID_NAME_LENGTH = 0% ! ----- MOVE TO MAP AND ENSURE ----- ! ----- IDENTIFIERS ARE UPPERCASE ----- ID_NAME = EDIT$(LEFT(ID_NAME, & ID_NAME_LENGTH), 32%) IF PRINT_IDENTIFIER_ATTRIBUTES THEN TEMP_STRING = "" ! ----- SEE IF IDENTIFIER ----- ! ----- HAS RESOURCE ----- ! ----- ATTRIBUTE ----- IF (IDENTIFIER_ATTRIBUTES AND & KGB$M_RESOURCE) <> 0% THEN TEMP_STRING = & TEMP_STRING + & " Resource" END IF ! ----- SEE IF IDENTIFIER ----- ! ----- HAS DYNAMIC ----- ! ----- ATTRIBUTE ----- IF (IDENTIFIER_ATTRIBUTES AND & KGB$M_DYNAMIC) <> 0% THEN TEMP_STRING = & TEMP_STRING + & " Dynamic" END IF IF TEMP_STRING <> "" THEN TEMP_STRING = & " (" + & EDIT$( & TEMP_STRING, & 8%) + ")" END IF IDENTIFIER_LIST = & IDENTIFIER_LIST & + ID_NAME + & TEMP_STRING + "~" ELSE IDENTIFIER_LIST = & IDENTIFIER_LIST & + LEFT(ID_NAME, & ID_NAME_LENGTH) + "~" END IF CASE SS$_NOSUCHID PRINT #10%, "ERROR: " + & "SS$_NOSUCHID FROM SYS$IDTOASC" LINE_COUNTER = LINE_COUNTER + 1% EXIT DEF IF CHECK_FOR_HEADINGS CASE ELSE PRINT #10%, "ERROR: " + & "SYS_STATUS="; SYS_STATUS LINE_COUNTER = LINE_COUNTER + 1% EXIT DEF IF CHECK_FOR_HEADINGS END SELECT CASE SS$_NOSUCHID CASE ELSE PRINT #10%, "ERROR: SYS_STATUS="; SYS_STATUS LINE_COUNTER = LINE_COUNTER + 1% EXIT DEF IF CHECK_FOR_HEADINGS END SELECT NEXT SYS_STATUS = SS$_NORMAL LOCATE_IDENTIFIER = FALSE ! RETURN SUCCESS STATUS END DEF ! ----- LOCAL FUNCTION TO LOOK UP ALL HOLDERS FOR A SPECIFIC ----- ! ----- IDENTIFIER (WITH THE SPECIFIED ATTRIBUTE(S)) ----- ! ----- (RETURNS SS$_NORMAL IF SUCCESSFUL, ----- ! ----- SS$_NOSUCHID IF INVALID IDENTIFIER SPECIFIED, OR SYSTEM ----- ! ----- SERVICE ERROR VALUE IF ANY OTHER UNEXPECTED ERROR OCCURS) ----- ! ----- (IF SUCCESSFUL, RETURNS TILDE-SEPARATED LIST OF IDENTIFIER ----- ! ----- HOLDERS) ----- DEF LONG LOCATE_HOLDER(STRING IDENTIFIER_NAME, LONG ATTRIBUTE_SEARCH) ! ----- ATTRIBUTE_SEARCH contains one or more of the ----- ! ----- following values: ----- ! ----- 0 = Any attribute ----- ! ----- 1 = RESOURCE attribute set ----- ! ----- 2 = DYNAMIC attribute set ----- ! ----- 4 = RESOURCE attribute NOT set ----- ! ----- 8 = DYNAMIC attribute NOT set ----- HOLDER_LIST = "~" ! INIT LIST OF IDENT HOLDERS ! ----- TRANSLATE ASCII STRING TO BINARY IDENTIFIER VALUE ----- SYS_STATUS = SYS$ASCTOID(IDENTIFIER_NAME, ID, ) IF SYS_STATUS <> SS$_NORMAL THEN IF SYS_STATUS <> SS$_NOSUCHID THEN EXIT DEF IF CHECK_FOR_HEADINGS PRINT #10%, "Unexpected LOCATE_HOLDER" +& " error from SYS$ASCTOID:" LINE_COUNTER = LINE_COUNTER + 1% END IF ! ----- RETURN ERROR STATUS ----- LOCATE_HOLDER = SYS_STATUS EXIT DEF END IF ! ----- SEARCH RIGHTSLIST FOR THE IDENTIFIER HOLDERS ----- CONTEXT = 0% ! INIT FOR IDENTIFIER SEARCH WHILE SYS_STATUS = SS$_NORMAL ! ----- LOCATE NEXT HOLDER FOR THIS IDENTIFIER ----- SYS_STATUS = SYS$FIND_HOLDER(ID BY VALUE, & HOLDER() BY REF, IDENTIFIER_ATTRIBUTES, CONTEXT) IF SYS_STATUS <> SS$_NORMAL THEN IF SYS_STATUS <> SS$_NOSUCHID THEN EXIT DEF IF CHECK_FOR_HEADINGS PRINT #10%, "Unexpected" + & " LOCATE_HOLDER" + & " error from SYS$FIND_HOLDER" LINE_COUNTER = LINE_COUNTER + 1% END IF ITERATE END IF ! ----- SEE IF ANY SEARCH BY ATTRIBUTE WANTED ----- IF ATTRIBUTE_SEARCH <> 0% THEN ! ----- SEE IF HOLDER HAS RESOURCE ----- ! ----- ATTRIBUTE ----- IF (IDENTIFIER_ATTRIBUTES AND & KGB$M_RESOURCE) <> 0% THEN ! ----- SKIP IF SEARCHING FOR ----- ! ----- NO RESOURCE ATTRIBUTE SET ----- ITERATE IF (ATTRIBUTE_SEARCH & AND 4%) <> 0% ELSE ! ----- SKIP IF SEARCHING FOR ----- ! ----- RESOURCE ATTRIBUTE SET ----- ITERATE IF (ATTRIBUTE_SEARCH & AND 1%) <> 0% END IF ! ----- SEE IF HOLDER HAS DYNAMIC ----- ! ----- ATTRIBUTE ----- IF (IDENTIFIER_ATTRIBUTES AND & KGB$M_DYNAMIC) <> 0% THEN ! ----- SKIP IF SEARCHING FOR ----- ! ----- NO DYNAMIC ATTRIBUTE SET ----- ITERATE IF (ATTRIBUTE_SEARCH & AND 8%) <> 0% ELSE ! ----- SKIP IF SEARCHING FOR ----- ! ----- DYNAMIC ATTRIBUTE SET ----- ITERATE IF (ATTRIBUTE_SEARCH & AND 2%) <> 0% END IF END IF ! ----- TRANSLATE HOLDER VALUE TO ASCII STRING ----- SYS_STATUS = SYS$IDTOASC(HOLDER(0%) BY VALUE, & ID_NAME_LENGTH, ID_NAME, , , ) IF SYS_STATUS <> SS$_NORMAL THEN IF SYS_STATUS = SS$_NOSUCHID THEN SYS_STATUS = SS$_NORMAL ELSE PRINT #10%, "Unexpected" + & " LOCATE_HOLDER error" +& " from SYS$IDTOASC" PRINT #10%, "ERROR:" + & " SYS_STATUS="; SYS_STATUS END IF ELSE IF ID_NAME_LENGTH = 0% THEN SYS_STATUS = SS$_NORMAL ELSE HOLDER_LIST = HOLDER_LIST + & LEFT(ID_NAME, & ID_NAME_LENGTH) + "~" END IF END IF NEXT ! ----- IGNORE ERROR IF NO MORE HOLDERS ----- IF SYS_STATUS = SS$_NOSUCHID THEN SYS_STATUS = SS$_NORMAL ! STORE SUCCESS STATUS TO RETURN ELSE IF SYS_STATUS = SS$_NORMAL THEN ! ----- TERMINATE RIGHTS DATABASE CONTEXT ----- SYS_STATUS = SYS$FINISH_RDB(CONTEXT) IF SYS_STATUS <> SS$_NORMAL THEN PRINT #10%, "Unexpected" + & " LOCATE_HOLDER error" +& " from SYS$FINISH_RDB" PRINT #10%, "ERROR:" + & " SYS_STATUS="; SYS_STATUS END IF END IF END IF LOCATE_HOLDER = SYS_STATUS ! RETURN FINAL EXIT STATUS ! ----- ENSURE IDENTIFIER HOLDERS ARE UPPERCASE ----- HOLDER_LIST = EDIT$(HOLDER_LIST, 32%) END DEF ! ----- LOCAL FUNCTION TO PRINT SELECTED IDENTIFIERS ASSOCIATED ----- ! ----- WITH A SPECIFIC UIC ----- DEF LONG PRINT_IDENTIFIERS PRINT_IDENTIFIERS = TRUE ! ASSUME ERROR STATUS IDENT_PRINT_STR = IDENTIFIER_LIST ! TEMP COPY HELD IDENTIFIERS UNTIL IDENT_PRINT_STR = "~" ! ----- SEARCH FOR NEXT DELIMITTER ----- NEXT_DELIM = POS(IDENT_PRINT_STR, "~", 2%) IF NEXT_DELIM < 3% THEN PRINT #10%, "ERROR: INVALID IDENTIFIER IN:" PRINT #10%, IDENT_PRINT_STR REPORT_RECORD_WRITTEN = TRUE EXIT DEF END IF ! ----- EXTRACT NEXT IDENTIFIER FROM ----- ! ----- IDENT_PRINT_STR ----- NEXT_IDENTIFIER = SEG$(IDENT_PRINT_STR, 2%, & NEXT_DELIM - 1%) ! ----- REMOVE THIS IDENTIFIER FROM ----- ! ----- IDENT_PRINT_STR ----- IDENT_PRINT_STR = RIGHT(IDENT_PRINT_STR, NEXT_DELIM) ! ----- SEE IF JUST A LIST OF IDENTIFIERS ARE TO ----- ! ----- BE PRINTED ----- IF PRINT_IDENTIFIERS_WANTED THEN EXIT DEF IF CHECK_FOR_HEADINGS PRINT #10%, TAB(20%); NEXT_IDENTIFIER REPORT_RECORD_WRITTEN = TRUE LINE_COUNTER = LINE_COUNTER + 1% ITERATE END IF ! ----- PRINT REPORT DETAIL LINE ----- SELECT REPORT_TYPE CASE "J" ! ----- IF SEARCHING FOR ANY IDENTIFIER: ----- IF SEARCH_FOR_HELD_IDENTS THEN ! ----- REVOKE ONLY THOSE ----- ! ----- IDENTIFIERS THAT WERE ----- ! ----- SEARCHED FOR ----- ! ----- ASSUME NO MATCHING IDENT ----- MATCHING_IDENT = FALSE ! ----- SET SO LOOP WILL EXECUTE ----- SEARCH_INDEX = 0% WHILE SEARCH_INDEX < & SEARCH_COUNTER AND NOT & MATCHING_IDENT SEARCH_INDEX = SEARCH_INDEX + 1% ! ----- SKIP IF NOT IDENT ----- ! ----- SEARCH ----- ITERATE IF SEARCH_TYPE( & SEARCH_INDEX) <> 4% ! ----- SET FLAG IF THIS ----- ! ----- IDENTIFIER MATCHES ----- ! ----- SUBSTRING SEARCH ----- MATCHING_IDENT = TRUE & IF POS( & NEXT_IDENTIFIER,& SEARCH_TEXT( & SEARCH_INDEX), 1%) <> 0% NEXT ! ----- SKIP IF THIS IDENTIFIER ----- ! ----- SUBSTRING IS NOT HELD ----- ITERATE IF NOT MATCHING_IDENT END IF ! ----- REVOKE THE SPECIFIC IDENTIFIER ----- PRINT #10%, "REVOKE/IDENTIFIER " + & NEXT_IDENTIFIER + " " + TRM$(USER_NAME) REPORT_RECORD_WRITTEN = TRUE CASE "K" ! AUTHORIZE DUPLICATE CMD FILE TEMP = 0% NOMATCH = TRUE WHILE TEMP < ADDED_IDENTS_CTR AND NOMATCH TEMP = TEMP + 1% NOMATCH = FALSE IF & ADDED_IDENTS(TEMP) = & NEXT_IDENTIFIER NEXT IF NOMATCH THEN ! ----- ADD THIS IDENTIFIER ----- PRINT #10%, "ADD/IDENTIFIER" + & "/ATTRIBUTE=RESOURCE " & + NEXT_IDENTIFIER IF ADDED_IDENTS_CTR < 200% THEN ADDED_IDENTS_CTR = & ADDED_IDENTS_CTR + 1% ADDED_IDENTS( & ADDED_IDENTS_CTR& ) = NEXT_IDENTIFIER END IF END IF ! ----- GRANT THE SPECIFIC IDENTIFIER ----- PRINT #10%, "GRANT/IDENTIFIER" + & "/ATTRIBUTE=RESOURCE " + & NEXT_IDENTIFIER + " " + TRM$(USER_NAME) CASE ELSE PRINT #10%, TAB(20%); NEXT_IDENTIFIER LINE_COUNTER = LINE_COUNTER + 1% EXIT DEF IF CHECK_FOR_HEADINGS REPORT_RECORD_WRITTEN = TRUE END SELECT NEXT PRINT_IDENTIFIERS = FALSE ! RETURN SUCCESS STATUS END DEF ! ----- LOCAL FUNCTION TO ENSURE THE FIRST (AND ONLY THE FIRST) ----- ! ----- LETTER OF A STRING IS CAPITALIZED ----- DEF STRING CAPITALIZE_FIRST(STRING NAME_TO_CAPITALIZE) ! ----- EXIT IF NO STRING WAS PASSED ----- IF NAME_TO_CAPITALIZE = "" THEN CAPITALIZE_FIRST = "" EXIT DEF END IF ! ----- MOVE TO MAPPED DATA FOR SUBSEQUENT MODIFICATION ----- MAPPED_STRING = NAME_TO_CAPITALIZE FOR TEMP = 1% TO LEN(NAME_TO_CAPITALIZE) SELECT MAPPED_BYTES(TEMP - 1%) CASE 65% TO 90% ! "A" TO "Z" ! ----- LOWERCASE ONLY LETTERS AFTER THE ----- ! ----- FIRST LETTER ----- IF TEMP > 1% THEN MAPPED_BYTES(TEMP - 1%) = & MAPPED_BYTES(TEMP - 1%) & OR 32% END IF CASE 97% TO 122% ! "a" TO "z" ! ----- UPPERCASE ONLY THE FIRST LETTER ----- IF TEMP = 1% THEN MAPPED_BYTES(TEMP - 1%) = & MAPPED_BYTES(TEMP - 1%) & AND NOT 32% END IF END SELECT NEXT TEMP ! ----- RETURN MODIFIED STRING ----- CAPITALIZE_FIRST = LEFT(MAPPED_STRING, LEN(NAME_TO_CAPITALIZE)) END DEF ! ----- LOCAL FUNCTION TO TRY TO OPEN A SYSUAF FILE ON A REMOTE ----- ! ----- NODE ----- DEF LONG TRY_TO_OPEN_NODE TRY_TO_OPEN_NODE = TRUE ! ASSUME ERROR STATUS ERROR_LINE = " TRY TO OPEN REMOTE NODE" ON ERROR GOTO TRY_TO_OPEN_NODE_ERROR OPEN SYSUAF_FILE_SPEC FOR INPUT AS FILE #3%, & RECORDSIZE 1412%, & ACCESS READ, & ALLOW MODIFY, & INDEXED VARIABLE, & MAP UAF, & RECORDTYPE ANY TRY_TO_OPEN_NODE = FALSE ! RETURN SUCCESS STATUS EXIT DEF TRY_TO_OPEN_NODE_ERROR: RESUME TRY_TO_OPEN_NODE_EXIT TRY_TO_OPEN_NODE_EXIT: PRINT PRINT "ERROR"; ERR; "while trying to open " + & SYSUAF_FILE_SPEC + BEL PRINT END DEF ! ----- LOCAL FUNCTION THAT RETURNS TRUE IF USERNAME EXISTS ON A ----- ! ----- REMOTE NODE ----- DEF LONG REMOTE_NODE_LOOKUP REMOTE_NODE_LOOKUP = FALSE ! ASSUME USERNAME DOES NOT EXIST ON ERROR GOTO REMOTE_NODE_LOOKUP_ERROR FIND #3%, KEY #0% EQ USER_NAME, REGARDLESS UNLOCK #3% REMOTE_NODE_LOOKUP = TRUE ! RETURN "USERNAME EXISTS" STAT EXIT DEF REMOTE_NODE_LOOKUP_ERROR: RESUME REMOTE_NODE_LOOKUP_EXIT IF ERR = REC_NOT_FOUND & OR ERR = END_OF_FILE ON ERROR GO BACK REMOTE_NODE_LOOKUP_EXIT: END DEF ! ----- LOCAL FUNCTION TO PRINT "MODIFY" LINES UP TILL 132 COLS ----- DEF WORD PRINT_MOD(STRING MODIFY_LINE) PRINT_MOD = 0% ! ALWAYS RETURN ZERO REPORT_RECORD_WRITTEN = TRUE ! ----- SEE IF THE USER_NAME HAS NOT YET BEEN PRINTED ----- IF NOT USER_NAME_PRINTED THEN USER_NAME_PRINTED = TRUE PRINT #10%, "MODIFY " + TRM$(USER_NAME); CHARS_WRITTEN = 7% + LEN(TRM$(USER_NAME)) END IF CHARS_WRITTEN = CHARS_WRITTEN + LEN(MODIFY_LINE) IF CHARS_WRITTEN > 132% THEN ! ----- SPECIAL CASE IF WE HAVE TO BREAK A LINE ----- ! ----- WHILE PRINTING MODIFY BIT FLAGS ----- IF BIT_PRINT_CODE <> 0% AND TEMP1 THEN PRINT #10%, ")" ! END BIT FLAGS DETAIL LINE ! ----- SEE IF ONLY PRINTING BIT FLAGS ----- ! ----- TERMINATOR ----- IF MODIFY_LINE <> ")" THEN SELECT BIT_PRINT_CODE CASE 1% ! /FLAGS PRINT #10%, "MODIFY " + & TRM$(USER_NAME) & + "/FLAG=(" + & FLAG_DESC(FLAG); CHARS_WRITTEN = 14% + & LEN(TRM$( & USER_NAME)) + & LEN(FLAG_DESC(FLAG)) CASE 2% ! /PRIVILEGES PRINT #10%, "MODIFY " + & TRM$(USER_NAME) & + "/PRIV=(" + & PRIV_DESC(FLAG); CHARS_WRITTEN = 14% + & LEN(TRM$( & USER_NAME)) + & LEN(PRIV_DESC(FLAG)) CASE 3% ! /DEFPRIVILEGES PRINT #10%, "MODIFY " + & TRM$(USER_NAME) & + "/DEFPRIV=(" +& PRIV_DESC(FLAG); CHARS_WRITTEN = 17% + & LEN(TRM$( & USER_NAME)) + & LEN(PRIV_DESC(FLAG)) END SELECT ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME); CHARS_WRITTEN = 7% + & LEN(TRM$(USER_NAME)) END IF ELSE PRINT #10% ! END DETAIL LINE PRINT #10%, "MODIFY " + TRM$(USER_NAME) & + MODIFY_LINE; CHARS_WRITTEN = 7% + & LEN(TRM$(USER_NAME)) + LEN(MODIFY_LINE) END IF ELSE PRINT #10%, MODIFY_LINE; END IF END DEF ! ----- LOCAL FUNCTION TO RETURN STRING EQUIVALENT OF ACCESS BYTES ----- ! ----- WHICH ALLOW ACCESS ----- DEF STRING DO_ACCESS(LONG BYTE_OFFSET) ! ----- MAP 6-BYTE STRING OVER THE DESIRED ACCESS BITS ----- REMAP (UAF) STRING FILL = BYTE_OFFSET, A_TEXT = 6% TEMP_STRING = "" ! INIT ACCESS STRING TEMP = FALSE ! CLEAR TEMP FLAG FIRST_HOUR = -1% ! INIT FIRST HOUR RESTRICTION PREV_HOUR = -1% ! INIT PREVIOUS HOUR RESTRICTION ! ----- PROCESS ALL PRIMARY DAY RESTRICTIONS ----- FOR TEMP1 = 1% TO 3% ! BYTE OFFSET ! ----- MOVE NEXT BYTE TO A LOCAL LONGWORD ----- MY_LONGWORD = ASCII(MID(A_TEXT, TEMP1, 1%)) FOR TEMP2 = 0% TO 7% ! BIT OFFSET ! ----- IF THIS HOUR IS UN-RESTRICTED ----- IF (MY_LONGWORD AND 2% ^ TEMP2) = 0% THEN ! ----- SEE IF CONSECUTIVE HOUR ----- IF PREV_HOUR + 1% = & TEMP1 * 8% - 8% + TEMP2 & OR FIRST_HOUR = -1% THEN ! YES IF FIRST_HOUR = -1% THEN FIRST_HOUR = & TEMP1 * & 8% - 8% + TEMP2 END IF PREV_HOUR = TEMP1 * & 8% - 8% + TEMP2 ITERATE ELSE ! NO TEMP_STRING = & TEMP_STRING + & "," & IF TEMP_STRING <> "" ! ----- SEE IF "PRIMARY" ----- ! ----- PRINTED ----- IF NOT TEMP THEN TEMP = TRUE TEMP_STRING = & TEMP_STRING + & "PRIMARY," END IF TEMP_STRING = & TEMP_STRING + & NUM1$( & FIRST_HOUR) IF FIRST_HOUR <> PREV_HOUR THEN TEMP_STRING = & TEMP_STRING + & "-" + & NUM1$(PREV_HOUR) END IF FIRST_HOUR = TEMP1 * & 8% - 8% + TEMP2 PREV_HOUR = FIRST_HOUR END IF END IF NEXT TEMP2 NEXT TEMP1 ! ----- APPEND ANY STORED UN-RESTRICTED DAYS ----- IF FIRST_HOUR <> -1% THEN TEMP_STRING = TEMP_STRING + "," IF TEMP_STRING <> "" ! ----- SEE IF "PRIMARY" PRINTED ----- IF NOT TEMP THEN TEMP = TRUE TEMP_STRING = TEMP_STRING + "PRIMARY," END IF TEMP_STRING = TEMP_STRING + NUM1$(FIRST_HOUR) IF FIRST_HOUR <> PREV_HOUR THEN TEMP_STRING = TEMP_STRING + "-" + & NUM1$(PREV_HOUR) END IF END IF ! ----- THEN PROCESS ALL SECONDARY DAY RESTRICTIONS ----- TEMP = FALSE ! CLEAR TEMP FLAG FIRST_HOUR = -1% ! INIT FIRST HOUR RESTRICTION PREV_HOUR = -1% ! INIT PREVIOUS HOUR RESTRICTION ! ----- PROCESS ALL SECONDARY DAY RESTRICTIONS ----- FOR TEMP1 = 4% TO 6% ! BYTE OFFSET ! ----- MOVE NEXT BYTE TO A LOCAL LONGWORD ----- MY_LONGWORD = ASCII(MID(A_TEXT, TEMP1, 1%)) FOR TEMP2 = 0% TO 7% ! BIT OFFSET ! ----- IF THIS HOUR IS UN-RESTRICTED ----- IF (MY_LONGWORD AND 2% ^ TEMP2) = 0% THEN ! ----- SEE IF CONSECUTIVE HOUR ----- IF PREV_HOUR + 1% = & TEMP1 * 8% - 32% + TEMP2& OR FIRST_HOUR = -1% THEN ! YES IF FIRST_HOUR = -1% THEN FIRST_HOUR = & TEMP1 * & 8% - 32% + TEMP2 END IF PREV_HOUR = TEMP1 * & 8% - 32% + TEMP2 ITERATE ELSE ! NO TEMP_STRING = & TEMP_STRING + & "," & IF TEMP_STRING <> "" ! ----- SEE IF "SECONDARY" ----- ! ----- PRINTED ----- IF NOT TEMP THEN TEMP = TRUE TEMP_STRING = & TEMP_STRING + & "SECONDARY," END IF TEMP_STRING = & TEMP_STRING + & NUM1$( & FIRST_HOUR) IF FIRST_HOUR <> PREV_HOUR THEN TEMP_STRING = & TEMP_STRING + & "-" + & NUM1$(PREV_HOUR) END IF FIRST_HOUR = TEMP1 * & 8% - 32% + TEMP2 PREV_HOUR = FIRST_HOUR END IF END IF NEXT TEMP2 NEXT TEMP1 ! ----- APPEND ANY STORED UN-RESTRICTED DAYS ----- IF FIRST_HOUR <> -1% THEN TEMP_STRING = TEMP_STRING + "," IF TEMP_STRING <> "" ! ----- SEE IF "SECONDARY" PRINTED ----- IF NOT TEMP THEN TEMP = TRUE TEMP_STRING = TEMP_STRING + "SECONDARY," END IF TEMP_STRING = TEMP_STRING + NUM1$(FIRST_HOUR) IF FIRST_HOUR <> PREV_HOUR THEN TEMP_STRING = TEMP_STRING + "-" + & NUM1$(PREV_HOUR) END IF END IF ! ----- SPECIAL PROCESSING IF NOT COMMAND FILE ----- SELECT REPORT_TYPE CASE "A", "B" ! NORMAL SCREEN/FILE REPORT SELECT TEMP_STRING CASE "PRIMARY,0-23,SECONDARY,0-23" ! ----- RETURN "All" IF NO RESTRICTIONS ----- TEMP_STRING = "All" CASE "" ! ----- RETURN "None" IF COMPLETELY ----- ! ----- RESTRICTED ----- TEMP_STRING = "None" END SELECT END SELECT DO_ACCESS = TEMP_STRING ! RETURN ACCESS STRING END DEF ! ----- LOCAL FUNCTION TO GET THE ACCESS RESTRICTIONS VIA A MENU ----- DEF WORD GET_ACCESS_MENU GET_ACCESS_MENU = TRUE ! ASSUME USER WANTS TO GO BACK ON ERROR GOTO GET_ACCESS_MENU_ERROR IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF PRINT "*** Select none or more of the following" + & " access restrictions to search for: ***" PRINT ! ----- DISPLAY ALL OF THE ACCESS RESTRICTIONS ----- POSSIBLE_CHOICES = "" TEMP = 1% WHILE TEMP < MAX_ACCESS ! FOR ALL ACCESS ITEMS: ! ----- DISPLAY ODD-NUMBERED ACCESS ----- ! ----- DESCRIPTION WITH ITS MENU CHARACTER ----- IF ACCESS_DESC(TEMP) <> "" THEN PRINT TAB(6%); & MID(MENU_STRING, TEMP, 1%) + & ") " + ACCESS_DESC(TEMP); POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP, 1%) END IF ! ----- DISPLAY EVEN-NUMBERED ACCESS ----- ! ----- DESCRIPTION WITH ITS MENU CHARACTER ----- IF ACCESS_DESC(TEMP + 1%) <> "" THEN PRINT TAB(46%); & MID(MENU_STRING, TEMP + 1%, 1%) & + ") " + ACCESS_DESC(TEMP + 1%); POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP + 1%, 1%) END IF PRINT ! END MENU DETAIL LINE TEMP = TEMP + 2% NEXT PRINT PRINT "Enter none or more of the above items" + & " (concatenated as one string of chars):" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT LINPUT #4%, "==> "; REPORT_SEARCH ! ----- CONVERT TO UPPERCASE ----- REPORT_SEARCH = EDIT$(REPORT_SEARCH, 38%) TEMP = 0% WHILE TEMP < LEN(REPORT_SEARCH) TEMP = TEMP + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(REPORT_SEARCH, TEMP, 1%), 1%) IF SEARCH_INDEX = 0% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(REPORT_SEARCH) PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END IF NEXT NEXT ! ----- PROCESS EACH INDICATED TYPE OF ACCESS RESTRICTION ----- SEARCH_ELEMENT = 0% ! INIT SEARCH ELEMENT POSITION WHILE SEARCH_ELEMENT < LEN(REPORT_SEARCH) SEARCH_ELEMENT = SEARCH_ELEMENT + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(REPORT_SEARCH, SEARCH_ELEMENT, 1%), 1%) ! ----- DEPENDING ON TYPE OF ACCESS TO SEARCH: ----- PRINT SELECT ACCESS_TYPE(SEARCH_INDEX) CASE "ACCESS" ! SPECIFIC ACCESS RESTRICTION PRINT "For " + ACCESS_DESC(SEARCH_INDEX) + ":" ! ----- SEE IF PRIMARY OR SECONDARY DAYS ----- ! ----- ARE TO BE CHECKED ----- PRINT PRINT " Do you want to check for" + & " PRIMARY or SECONDARY day" + & " restrictions?" ! ----- SET FLAG SO LOOP WILL EXECUTE ----- VALID_ENTRY = FALSE UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE LINPUT #4%, & " (Enter P or S) ==> "; & TEMP_STRING ! ----- CONVERT TO UPPERCASE ----- TEMP_STRING = & EDIT$(TEMP_STRING, 38%) SELECT TEMP_STRING CASE "P" ! ----- STORE CODE FOR ----- ! ----- PRIMARY ACCESS ----- ! ----- SEARCH ----- SEARCH_TYPE( & SEARCH_COUNTER & + 1%) = 11% CASE "S" ! ----- STORE CODE FOR ----- ! ----- SECONDARY ACCESS ----- ! ----- SEARCH ----- SEARCH_TYPE( & SEARCH_COUNTER & + 1%) = 14% CASE ELSE ! ----- SET TO ITERATE ----- ! ----- OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid" + & " Response" + & " - Try Again" + BEL PRINT ITERATE END SELECT NEXT ! ----- GET EARLIEST HOUR OF ACCESS TO ----- ! ----- CHECK ----- SEARCH_LONG(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG(SEARCH_COUNTER + 1%) & <> -987123% PRINT PRINT " Enter the Earliest" + & " Time (0->23) of" + & " the day to search" + & " for (Default=0)" LINPUT #4%, " ==> "; TEMP_STRING ! ----- DISCARD ANY CONTROL ----- ! ----- CHARACTERS AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = "0" IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 3% THEN SEARCH_LONG( & SEARCH_COUNTER & + 1%) = INTEGER & (TEMP_STRING, LONG) END IF IF SEARCH_LONG(SEARCH_COUNTER + & 1%) = -987123% THEN PRINT PRINT "Invalid" + & " Response -" + & " Try Again" + BEL PRINT END IF NEXT ! ----- GET LATEST HOUR OF ACCESS TO CHECK ----- SEARCH_LONG2(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG2(SEARCH_COUNTER + 1%) & <> -987123% PRINT PRINT " Enter the Latest" + & " Time (" + & NUM1$(SEARCH_LONG( & SEARCH_COUNTER + 1%)) + & "->23) of the day to" + & " search for (Default=" & + NUM1$(SEARCH_LONG( & SEARCH_COUNTER + 1%)) + ")" LINPUT #4%, " ==> "; TEMP_STRING ! ----- DISCARD ANY CONTROL ----- ! ----- CHARACTERS AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = NUM1$(SEARCH_LONG(& SEARCH_COUNTER + 1%)) & IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 3% THEN SEARCH_LONG2( & SEARCH_COUNTER & + 1%) = INTEGER & (TEMP_STRING, LONG) END IF IF SEARCH_LONG2(SEARCH_COUNTER & + 1%) < SEARCH_LONG( & SEARCH_COUNTER + 1%) THEN SEARCH_LONG2( & SEARCH_COUNTER & + 1%) = -987123% PRINT PRINT "ERROR - This" + & " time is" + & " before the" + & " earliest" + & " time -" + & " Try Again" + BEL PRINT ITERATE END IF IF SEARCH_LONG2(SEARCH_COUNTER & + 1%) = -987123% THEN PRINT PRINT "Invalid" + & " Response -" + & " Try Again" + BEL PRINT END IF NEXT ! ----- INCREMENT NUMBER OF SEARCH ITEMS ----- ! ----- IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = & ACCESS_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & ACCESS_BYTE_OFF(SEARCH_INDEX) ! ----- OFFSET FROM PRIMARY TO SECONDARY ----- ! ----- BYTES IF REQUIRED ----- IF SEARCH_TYPE(SEARCH_COUNTER) = 14% THEN SEARCH_BYTE_OFF(SEARCH_COUNTER) & = SEARCH_BYTE_OFF( & SEARCH_COUNTER) + 3% END IF ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(ACCESS_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED ----- ! ----- STRING POSITION/QUADWORD VALUE ----- ! ----- TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & ACCESS_BIT_OFF(SEARCH_INDEX) CASE "ACCESSR" ! ANY ACCESS RESTRICTION ! ----- INCREMENT NUMBER OF SEARCH ITEMS ----- ! ----- IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = & ACCESS_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & ACCESS_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(ACCESS_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED ----- ! ----- STRING POSITION/QUADWORD VALUE ----- ! ----- TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & ACCESS_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR ANY ACCESS ----- ! ----- RESTRICTION SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 10% CASE ELSE PRINT PRINT "Invalid ACCESS_TYPE(" + & NUM1$(SEARCH_INDEX) + "): " + & ACCESS_TYPE(SEARCH_INDEX) + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END SELECT NEXT GET_ACCESS_MENU = FALSE ! RETURN "VALID RESPONSE" STATUS EXIT DEF GET_ACCESS_MENU_ERROR: RESUME GET_ACCESS_MENU_EXIT IF ERR = END_OF_FILE ON ERROR GO BACK GET_ACCESS_MENU_EXIT: END DEF ! ----- LOCAL FUNCTION TO GET THE FLAG BIT SEARCHES VIA A MENU ----- DEF WORD GET_FLAG_MENU GET_FLAG_MENU = TRUE ! ASSUME USER WANTS TO GO BACK ON ERROR GOTO GET_FLAG_MENU_ERROR IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF PRINT TAB(7%); "*** Select none or more of the" + & " following flags to search for: ***" PRINT ! ----- DISPLAY ALL OF THE FLAGS ----- POSSIBLE_CHOICES = "" TEMP = 1% WHILE TEMP < MAX_FLAGS ! FOR ALL SEARCH FLAG ITEMS: ! ----- DISPLAY ODD-NUMBERED FLAG ----- ! ----- DESCRIPTION WITH ITS MENU CHARACTER ----- IF FLAGS_DESC(TEMP) <> "" THEN PRINT TAB(6%); & MID(MENU_STRING, TEMP, 1%) + & ") " + FLAGS_DESC(TEMP); END IF ! ----- DISPLAY EVEN-NUMBERED FLAG ----- ! ----- DESCRIPTION WITH ITS MENU CHARACTER ----- IF FLAGS_DESC(TEMP + 1%) <> "" THEN PRINT TAB(46%); & MID(MENU_STRING, TEMP + 1%, 1%) & + ") " + FLAGS_DESC(TEMP + 1%); END IF POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP, 2%) PRINT ! END MENU DETAIL LINE TEMP = TEMP + 2% NEXT PRINT PRINT "Enter none or more of the above items" + & " (concatenated as one string of chars):" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT LINPUT #4%, "==> "; REPORT_SEARCH ! ----- CONVERT TO UPPERCASE ----- REPORT_SEARCH = EDIT$(REPORT_SEARCH, 38%) TEMP = 0% WHILE TEMP < LEN(REPORT_SEARCH) TEMP = TEMP + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(REPORT_SEARCH, TEMP, 1%), 1%) IF SEARCH_INDEX = 0% OR & FLAGS_DESC(SEARCH_INDEX) = "" THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(REPORT_SEARCH) PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END IF NEXT NEXT ! ----- PROCESS EACH INDICATED TYPE OF FLAG ----- SEARCH_ELEMENT = 0% ! INIT SEARCH ELEMENT POSITION WHILE SEARCH_ELEMENT < LEN(REPORT_SEARCH) SEARCH_ELEMENT = SEARCH_ELEMENT + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(REPORT_SEARCH, SEARCH_ELEMENT, 1%), 1%) ! ----- DEPENDING ON TYPE OF FLAG TO SEARCH: ----- SELECT FLAGS_TYPE(SEARCH_INDEX) CASE "FLAGC" ! TEST FOR FLAG CLEAR ! ----- INCREMENT NUMBER OF SEARCH ITEMS ----- ! ----- IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = & FLAGS_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FLAGS_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FLAGS_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED ----- ! ----- STRING POSITION/QUADWORD VALUE ----- ! ----- TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FLAGS_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR CLEAR FLAG SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 2% CASE "FLAGS" ! TEST FOR FLAG SET ! ----- INCREMENT NUMBER OF SEARCH ITEMS ----- ! ----- IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = & FLAGS_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FLAGS_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FLAGS_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED ----- ! ----- STRING POSITION/QUADWORD VALUE ----- ! ----- TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FLAGS_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR SET FLAG SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 3% ! ----- SEE IF DISUSER'ED ACCTS ARE NOT ----- ! ----- SKIPPED (DEFAULT OF SKIPPING ----- ! ----- DISUSER'ED ACCOUNTS) ----- IF SEARCH_DESC(SEARCH_COUNTER) = & "DISUSER flag set" THEN SKIP_DISUSERED_ACCTS = FALSE END IF CASE ELSE PRINT PRINT "Invalid FLAGS_TYPE(" + & NUM1$(SEARCH_INDEX) + "): " + & FLAGS_TYPE(SEARCH_INDEX) + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END SELECT NEXT GET_FLAG_MENU = FALSE ! RETURN "VALID RESPONSE" STATUS EXIT DEF GET_FLAG_MENU_ERROR: RESUME GET_FLAG_MENU_EXIT IF ERR = END_OF_FILE ON ERROR GO BACK GET_FLAG_MENU_EXIT: END DEF ! ----- LOCAL FUNCTION TO GET THE PRIMARY/SECONDARY BIT ----- ! ----- SEARCHES VIA A MENU ----- DEF WORD GET_PRIMARY_MENU GET_PRIMARY_MENU = TRUE ! ASSUME USER WANTS TO GO BACK ON ERROR GOTO GET_PRIMARY_MENU_ERROR IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF PRINT " *** Select none or more of the" + & " following days to search for: ***" PRINT ! ----- DISPLAY ALL OF THE PRIMARY/SECONDARY DAYS ----- PRINT TAB(34%); MID(MENU_STRING, 1%, 1%) + ") Monday" PRINT TAB(34%); MID(MENU_STRING, 2%, 1%) + ") Tuesday" PRINT TAB(34%); MID(MENU_STRING, 3%, 1%) + ") Wednesday" PRINT TAB(34%); MID(MENU_STRING, 4%, 1%) + ") Thursday" PRINT TAB(34%); MID(MENU_STRING, 5%, 1%) + ") Friday" PRINT TAB(34%); MID(MENU_STRING, 6%, 1%) + ") Saturday" PRINT TAB(34%); MID(MENU_STRING, 7%, 1%) + ") Sunday" PRINT PRINT "Enter none or more of the above items" + & " (concatenated as one string of chars):" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT LINPUT #4%, "==> "; REPORT_SEARCH ! ----- CONVERT TO UPPERCASE ----- REPORT_SEARCH = EDIT$(REPORT_SEARCH, 38%) TEMP = 0% WHILE TEMP < LEN(REPORT_SEARCH) TEMP = TEMP + 1% SEARCH_INDEX = POS(MENU_STRING, & MID(REPORT_SEARCH, TEMP, 1%), 1%) IF SEARCH_INDEX = 0% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(REPORT_SEARCH) PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END IF NEXT NEXT ! ----- PROCESS EACH TYPE OF PRIMARY/SECONDARY FLAGS ----- SEARCH_ELEMENT = 0% ! INIT SEARCH ELEMENT POSITION WHILE SEARCH_ELEMENT < LEN(REPORT_SEARCH) SEARCH_ELEMENT = SEARCH_ELEMENT + 1% SEARCH_INDEX = POS(MENU_STRING, & MID(REPORT_SEARCH, SEARCH_ELEMENT, 1%), 1%) ! ----- SEE WHETHER TO SEARCH FOR A PRIMARY OR ----- ! ----- SECONDARY DAY ----- PRINT PRINT " Search for users having this day" + & " as a PRIMARY or SECONDARY day?" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE LINPUT #4%, " (Enter P or S) ==> "; & TEMP_STRING ! ----- CONVERT TO UPPERCASE ----- TEMP_STRING = EDIT$(TEMP_STRING, 38%) SELECT TEMP_STRING CASE "P" ! ----- STORE CODE FOR PRIMARY ----- ! ----- DAY SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER + 1%) = 12% CASE "S" ! ----- STORE CODE FOR SECONDARY ----- ! ----- DAY SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER + 1%) = 13% CASE ELSE ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END SELECT NEXT ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SELECT SEARCH_INDEX CASE 1% SEARCH_DESC(SEARCH_COUNTER) = "Monday" CASE 2% SEARCH_DESC(SEARCH_COUNTER) = "Tuesday" CASE 3% SEARCH_DESC(SEARCH_COUNTER) = "Wednesday" CASE 4% SEARCH_DESC(SEARCH_COUNTER) = "Thursday" CASE 5% SEARCH_DESC(SEARCH_COUNTER) = "Friday" CASE 6% SEARCH_DESC(SEARCH_COUNTER) = "Saturday" CASE 7% SEARCH_DESC(SEARCH_COUNTER) = "Sunday" END SELECT ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = 0% ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = 1% ! ----- STORE BIT OFFSET TO DATA ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = SEARCH_INDEX - 1% NEXT GET_PRIMARY_MENU = FALSE ! RETURN "VALID RESPONSE" STATUS EXIT DEF GET_PRIMARY_MENU_ERROR: RESUME GET_PRIMARY_MENU_EXIT IF ERR = END_OF_FILE ON ERROR GO BACK GET_PRIMARY_MENU_EXIT: END DEF ! ----- LOCAL FUNCTION TO GET THE PRIVILEGE SEARCHES VIA A MENU ----- DEF WORD GET_PRIV_MENU(STRING PRIV_LIST) GET_PRIV_MENU = TRUE ! ASSUME USER WANTS TO GO BACK ON ERROR GOTO GET_PRIV_MENU_ERROR IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF PRINT "** Select none or more of the following " + & PRIV_LIST + " privileges to search for: **" PRINT ! ----- DISPLAY ALL OF THE PRIVILEGES ----- POSSIBLE_CHOICES = "" TEMP = 1% WHILE TEMP < MAX_PRIV ! FOR ALL PRIV ITEMS: IF PRIV_DESC(TEMP) <> "" THEN PRINT TAB(9%); & MID(MENU_STRING, TEMP, 1%) + & ") " + PRIV_DESC(TEMP); POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP, 1%) END IF IF PRIV_DESC(TEMP + 1%) <> "" THEN PRINT TAB(34%); & MID(MENU_STRING, TEMP + 1%, 1%) & + ") " + PRIV_DESC(TEMP + 1%); POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP + 1%, 1%) END IF IF PRIV_DESC(TEMP + 2%) <> "" THEN PRINT TAB(59%); & MID(MENU_STRING, TEMP + 2%, 1%) & + ") " + PRIV_DESC(TEMP + 2%); POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP + 2%, 1%) END IF PRINT ! END MENU DETAIL LINE TEMP = TEMP + 3% NEXT PRINT PRINT "Enter none or more of the above items" + & " (concatenated as one string of chars):" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT LINPUT #4%, "==> "; REPORT_SEARCH ! ----- CONVERT TO UPPERCASE ----- REPORT_SEARCH = EDIT$(REPORT_SEARCH, 38%) TEMP = 0% WHILE TEMP < LEN(REPORT_SEARCH) TEMP = TEMP + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(REPORT_SEARCH, TEMP, 1%), 1%) IF SEARCH_INDEX = 0% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(REPORT_SEARCH) PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END IF NEXT NEXT ! ----- PROCESS EACH INDICATED TYPE OF PRIVILEGE ----- SEARCH_ELEMENT = 0% ! INIT SEARCH ELEMENT POSITION WHILE SEARCH_ELEMENT < LEN(REPORT_SEARCH) SEARCH_ELEMENT = SEARCH_ELEMENT + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(REPORT_SEARCH, SEARCH_ELEMENT, 1%), 1%) ! ----- SEE IF PRIV IS TO BE SET OR CLEARED ----- PRINT PRINT "For " + PRIV_DESC(SEARCH_INDEX) + ":" PRINT " Do you want to test if this" + & " privilege is SET or CLEAR?" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE LINPUT #4%, " (Enter S or C) ==> "; & TEMP_STRING ! ----- CONVERT TO UPPERCASE ----- TEMP_STRING = EDIT$(TEMP_STRING, 38%) SELECT TEMP_STRING CASE "S" IF PRIV_LIST = "DEFAULT" THEN PRIV_TYPE(SEARCH_INDEX) & = "DPRIVS" ELSE PRIV_TYPE(SEARCH_INDEX) & = "PRIVS" END IF CASE "C" IF PRIV_LIST = "DEFAULT" THEN PRIV_TYPE(SEARCH_INDEX) & = "DPRIVC" ELSE PRIV_TYPE(SEARCH_INDEX) & = "PRIVC" END IF CASE ELSE ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END SELECT NEXT ! ----- DEPENDING ON TYPE OF PRIV TO SEARCH: ----- SELECT PRIV_TYPE(SEARCH_INDEX) CASE "PRIVC", "DPRIVC" ! TEST FOR PRIV CLEAR ! ----- INCREMENT NUMBER OF SEARCH ITEMS ----- ! ----- IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SELECT PRIV_TYPE(SEARCH_INDEX) CASE "DPRIVC" SEARCH_DESC(SEARCH_COUNTER) = & "DEFAULT " + & PRIV_DESC(SEARCH_INDEX) & + " clear" CASE "PRIVC" SEARCH_DESC(SEARCH_COUNTER) = & "AUTHORIZED " + & PRIV_DESC(SEARCH_INDEX) & + " clear" END SELECT ! ----- STORE BYTE OFFSET TO DATA ----- ! ----- (ASSUME AUTHORIZED PRIVILEGES) ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & PRIV_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = 1% ! ----- STORE BIT OFFSET TO DATA ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & PRIV_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR CLEAR BIT SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 2% CASE "PRIVS", "DPRIVS" ! TEST FOR PRIV SET ! ----- INCREMENT NUMBER OF SEARCH ITEMS ----- ! ----- IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SELECT PRIV_TYPE(SEARCH_INDEX) CASE "DPRIVS" SEARCH_DESC(SEARCH_COUNTER) = & "DEFAULT " + & PRIV_DESC(SEARCH_INDEX) + " set" CASE "PRIVS" SEARCH_DESC(SEARCH_COUNTER) = & "AUTHORIZED " + & PRIV_DESC(SEARCH_INDEX) + " set" END SELECT ! ----- STORE BYTE OFFSET TO DATA ----- ! ----- (ASSUME AUTHORIZED PRIVILEGES) ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & PRIV_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = 1% ! ----- STORE BIT OFFSET TO DATA ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & PRIV_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR SET BIT SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 3% CASE ELSE PRINT PRINT "Invalid PRIV_TYPE(" + & NUM1$(SEARCH_INDEX) + "): " + & PRIV_TYPE(SEARCH_INDEX) + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END SELECT NEXT GET_PRIV_MENU = FALSE ! RETURN "VALID RESPONSE" STATUS EXIT DEF GET_PRIV_MENU_ERROR: RESUME GET_PRIV_MENU_EXIT IF ERR = END_OF_FILE ON ERROR GO BACK GET_PRIV_MENU_EXIT: END DEF ! ----- LOCAL FUNCTION TO PRINT AUTHORIZED OR DEFAULT PRIVILEGES ----- DEF WORD DO_PRIVS(WORD AUTH_OR_DEFAULT) DO_PRIVS = TRUE ! ASSUME PROGRAM TO BE ENDED ! ----- START PRINTING THE FIRST LINE OF PRIVILEGES ----- EXIT DEF IF CHECK_FOR_HEADINGS IF AUTH_OR_DEFAULT = 0% THEN PRINT #10%, TAB(13%); "Authorized Privileges:"; & TAB(36%); ELSE PRINT #10%, TAB(13%); "Default Privileges:"; TAB(36%); END IF CHARS_WRITTEN = 36% FOR FLAG = 1% TO MAX_PRIV ! ----- MAP TO REQUIRED BYTE ----- IF AUTH_OR_DEFAULT = 0% THEN FILL_OFFSET = PRIV_BYTE_OFF(FLAG) ELSE FILL_OFFSET = PRIV_BYTE_OFF(FLAG) + 8% END IF REMAP (UAF) STRING FILL = FILL_OFFSET, & A_BYTE MY_LONGWORD = A_BYTE ! MOVE BYTE TO LONGWORD ! ----- SEE IF PRIVILEGE BIT IS CLEAR ----- ITERATE IF (MY_LONGWORD AND 2% ^ & PRIV_BIT_OFF(FLAG)) = 0% IF CHARS_WRITTEN + LEN(PRIV_DESC(FLAG)) + 1% > & REPORT_WIDTH THEN PRINT #10% ! END DETAIL LINE LINE_COUNTER = LINE_COUNTER + 1% EXIT DEF IF CHECK_FOR_HEADINGS PRINT #10%, TAB(36%); CHARS_WRITTEN = 36% END IF PRINT #10%, " " + PRIV_DESC(FLAG); CHARS_WRITTEN = CHARS_WRITTEN + & LEN(PRIV_DESC(FLAG)) + 1% NEXT FLAG PRINT #10% ! END DETAIL LINE LINE_COUNTER = LINE_COUNTER + 1% EXIT DEF IF CHECK_FOR_HEADINGS DO_PRIVS = FALSE ! RETURN SUCCESS STATUS END DEF ! ----- LOCAL FUNCTION TO PRINT AUTHORIZED OR DEFAULT PRIVILEGES ----- ! ----- TO A COMMAND FILE ----- DEF WORD DO_PRIVS_CMD(WORD AUTH_OR_DEFAULT) DO_PRIVS_CMD = 0% ! ALWAYS RETURN ZERO IF AUTH_OR_DEFAULT = 0% THEN BIT_PRINT_CODE = 2% ELSE BIT_PRINT_CODE = 3% END IF TEMP1 = FALSE FOR FLAG = 1% TO MAX_PRIV ! ----- MAP TO REQUIRED BYTE ----- IF AUTH_OR_DEFAULT = 0% THEN FILL_OFFSET = PRIV_BYTE_OFF(FLAG) ELSE FILL_OFFSET = PRIV_BYTE_OFF(FLAG) + 8% END IF REMAP (UAF) STRING FILL = FILL_OFFSET, & A_BYTE MY_LONGWORD = A_BYTE ! MOVE BYTE TO LONGWORD ! ----- SEE IF PRIVILEGE BIT IS CLEAR ----- ITERATE IF (MY_LONGWORD AND 2% ^ & PRIV_BIT_OFF(FLAG)) = 0% IF TEMP1 THEN TEMP = PRINT_MOD("," + PRIV_DESC(FLAG)) ELSE IF AUTH_OR_DEFAULT = 0% THEN TEMP = PRINT_MOD("/PRIV=(" + & PRIV_DESC(FLAG)) ELSE TEMP = PRINT_MOD("/DEFPRIV=(" + & PRIV_DESC(FLAG)) END IF TEMP1 = TRUE END IF NEXT FLAG TEMP = PRINT_MOD(")") IF TEMP1 BIT_PRINT_CODE = 0% END DEF ! ----- INIT FLAGS AND COUNTERS ----- REPORT_RECORD_WRITTEN = FALSE ! INIT FLAG ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ERROR_LINE = "INIT" ! INIT ERROR FLAG LINE_COUNTER = 99% ! TO FORCE PAGE HEADINGS LINPUT_FLAG = FALSE ! INIT LINPUT FLAG PAGE_COUNTER = 0% ! INIT PAGE COUNTER TERMINAL_WIDTH_CHANGED = FALSE ! ASSUME TT WIDTH UNCHANGED ! ----- READ IN DATA ELEMENTS FOR ALL POSSIBLE SEARCH FIELDS ----- ERROR_LINE = "READING SEARCH" FOR TEMP = 1% TO MAX_SEARCH ! FOR ALL SEARCH FIELDS: READ FIELD_TYPE(TEMP), ! TYPE OF FIELD & FIELD_DESC(TEMP), ! FIELD DESCRIPTION & FIELD_BYTE_OFF(TEMP), ! BYTE OFFSET TO FIELD & FIELD_LENGTH(TEMP), ! LENGTH OF FIELD & ! (NEGATIVE IF ONLY FOR & ! NON-COMMAND FILE & ! OUTPUT) & FIELD_BIT_OFF(TEMP), ! FLAGS: BIT OFFSET & ! FLAGC: BIT OFFSET & ! ACCESS: 1: BIT ON & ! TEXT: >0: CNT STR POS& ! -99: ONLY SEARCH MENU & FIELD_WIDTH(TEMP), ! FULL PRINTED WIDTH & FIELD_WIDTH_TRUNCATED(TEMP), & ! TRUNCATED FIELD WIDTH & FIELD_HEADER(TEMP), ! FIELD PRINT HEADER & FIELD_CMD_FILE(TEMP) ! FIELD COMMAND FILE PARAM NAMES NEXT TEMP DATA ACCESSMENU,Access Restrictions,0,0,0,29,29,Access Restrictions,"" DATA DATE,Account Expiration Date,364,8,0,16,16,Acct Expiration DATA EXPIRATION DATA TEXT,Account Name,52,32,0,33,10,Acct Name,ACCOUNT DATA VALUE,Base Priority,516,1,0,5,5,Prio,PRIORITY DATA TEXT,CLI Name,277,31,276,32,9,CLI Name,CLI DATA TEXT,CLI Table,309,31,308,32,10,CLI Table,CLITABLES DATA TEXT,Default Device,117,31,116,32,17,Default Device,DEVICE DATA TEXT,Default Directory,149,63,148,64,18,Default Directory,DIRECTORY DATA TEXT,Login Command filespec,213,63,212,64,14,Login command,LGICMD DATA FLAGMENU,Login Flags,0,0,0,17,17,Login Flags,"" DATA VALUE,Minimum Password Length,362,1,0,12,12,Min Pwd Len,PWDMINIMUM DATA TEXT,Owner Name,85,31,84,32,21,Owner Name,OWNER DATA DELTA,Password Lifetime,372,8,0,9,9,Pwd Life,"" DATA PRIME,Primary/Secondary Days,514,1,0,29,29,Primary Days,"" DATA AUTHPRIVMENU,Privileges - Authorized,412,0,0,14,14,Auth Privs,"" DATA DEFPRIVMENU,Privileges - Default,420,0,0,14,14,Default Privs,"" DATA UIC,UIC,36,4,0,15,15,UIC,"" DATA QUOTA,ASTLM,532,2,0,6,6,ASTLM,"" DATA QUOTA,BIOLM,526,2,0,6,6,BIOLM,"" DATA QUOTA,BYTLM,560,4,0,11,11,BYTLM,"" DATA CPUTIME,CPUTIME,556,4,0,13,13,CPUTIME,"" DATA QUOTA,DIOLM,528,2,0,6,6,DIOLM,"" DATA QUOTA,ENQLM,534,2,0,6,6,ENQLM,"" DATA QUOTA,FILLM,536,2,0,6,6,FILLM,"" DATA QUOTA,JTQUOTA,568,4,0,11,11,JTQUOTA,"" DATA QUOTA,MAXACCTJOBS,520,2,0,12,12,MAXACCTJOBS,"" DATA QUOTA,MAXDETACH,522,2,0,10,10,MAXDETACH,"" DATA QUOTA,MAXJOBS,518,2,0,8,8,MAXJOBS,"" DATA QUOTA,PBYTLM,564,4,0,11,11,PBYTLM,"" DATA QUOTA,PGFLQUOTA,552,4,0,11,11,PGFLQUOTA,"" DATA QUOTA,PRCLM,524,2,0,6,6,PRCLM,"" DATA QUOTA,SHRFILLM,538,2,0,9,9,SHRFILLM,"" DATA QUOTA,TQELM,530,2,0,6,6,TQELM,"" DATA QUOTA,WSDEFAULT,544,4,0,11,11,WSDEFAULT,"" DATA QUOTA,WSEXTENT,548,4,0,11,11,WSEXTENT,"" DATA QUOTA,WSQUOTA,540,4,0,11,11,WSQUOTA,"" DATA DATEP1,Last Password #1 Change Date,380,-8,0,16,16,Last Pwd #1 Chg DATA "" DATA DATEP2,Last Password #2 Change Date,388,-8,0,16,16,Last Pwd #2 Chg DATA "" DATA DATE,Last Interactive Login Date,396,-8,0,17,17,Last Inter Login,"" DATA DATE,Last Non-Interactive Login Date,404,-8,0,21,21 DATA Last Non-Inter Login,"" DATA VALUE,Number of Login Failures,356,-2,0,15,15,Login Failures,"" DATA USERDATA,Any Existing Userdata,644,-768,0,9,9,Userdata,"" DATA TEXT,Customer-site-specific data,502,-12,0,14,14,Site-specific,"" DATA IDENT,Held Identifiers,0,-1,0,0,0,Held Identifiers,"" DATA NIDENT,Un-Held Identifiers,0,-1,-99,0,0,Un-Held Identifiers,"" ! ----- READ IN DATA ELEMENTS FOR ALL POSSIBLE ACCESS FIELDS ----- ! ----- (NOTE THAT MAX_ACCESS MUST BE AN EVEN NUMBER, SINCE ALL OF ----- ! ----- FOLLOWING ACCESS ITEMS MUST OCCUR IN A ALLOWED/NOTALLOWED ----- ! ----- PAIR) ----- ERROR_LINE = "READING ACCESS" FOR TEMP = 1% TO MAX_ACCESS ! FOR ALL ACCESS FIELDS: READ ACCESS_TYPE(TEMP), ! TYPE OF ACCESS FIELD & ACCESS_DESC(TEMP), ! ACCESS DESCRIPTION & ACCESS_BYTE_OFF(TEMP), ! BYTE OFFSET TO ACCESS & ACCESS_LENGTH(TEMP), ! LENGTH OF ACCESS & ACCESS_BIT_OFF(TEMP) ! BIT OFF/CNTD STR POS/QUAD MTCH NEXT TEMP DATA ACCESS,NETWORK access allowed,472,6,0 DATA ACCESS,NETWORK access NOT allowed,472,6,1 DATA ACCESS,BATCH access allowed,478,6,0 DATA ACCESS,BATCH access NOT allowed,478,6,1 DATA ACCESS,LOCAL access allowed,484,6,0 DATA ACCESS,LOCAL access NOT allowed,484,6,1 DATA ACCESS,DIALUP access allowed,490,6,0 DATA ACCESS,DIALUP access NOT allowed,490,6,1 DATA ACCESS,REMOTE access allowed,496,6,0 DATA ACCESS,REMOTE access NOT allowed,496,6,1 DATA ACCESSR,Any Access Restriction,472,30,0 DATA "","",0,0,0 ! ----- READ IN DATA ELEMENTS FOR ALL POSSIBLE FLAG REPORT FIELDS ----- ERROR_LINE = "READING FLAG" LONGEST_FLAG_DESC = 0% ! INIT LENGTH OF LONGEST FLAG FOR TEMP = 1% TO MAX_FLAG ! FOR ALL LOGIN FLAG FIELDS: READ FLAG_TYPE(TEMP), ! TYPE OF FLAG FIELD & FLAG_DESC(TEMP), ! FLAG DESCRIPTION & FLAG_BYTE_OFF(TEMP), ! BYTE OFFSET TO FLAG & FLAG_BIT_OFF(TEMP) ! BIT OFF/CNTD STR POS/QUAD MTCH IF LEN(FLAG_DESC(TEMP)) > LONGEST_FLAG_DESC THEN LONGEST_FLAG_DESC = LEN(FLAG_DESC(TEMP)) END IF NEXT TEMP DATA FLAG,AUDIT,1,3 DATA FLAG,AUTOLOGIN,1,6 DATA FLAG,CAPTIVE,2,0 DATA FLAG,DEFCLI,0,1 DATA FLAG,DISCTLY,0,0 DATA FLAG,DISIMAGE,2,1 DATA FLAG,DISMAIL,0,7 DATA FLAG,DISNEWMAIL,0,6 DATA FLAG,DISREPORT,1,4 DATA FLAG,DISUSER,0,4 DATA FLAG,DISWELCOME,0,5 DATA FLAG,FORCEEXPPWDCHG,1,7 DATA FLAG,GENPWD,1,0 DATA FLAG,LOCKPWD,0,2 DATA FLAG,NODISRECONNECT,1,5 DATA FLAG,RESTRICTED,0,3 DATA FLAG,PWD_EXPIRED,1,1 DATA FLAG,PWD2_EXPIRED,1,2 ! ----- READ IN DATA ELEMENTS FOR ALL POSSIBLE FLAG SEARCH FIELDS ----- ! ----- (NOTE THAT MAX_FLAGS MUST BE AN EVEN NUMBER, SINCE ALL OF ----- ! ----- FOLLOWING FLAG ITEMS MUST OCCUR IN A SET/CLEAR PAIR) ----- ERROR_LINE = "READING FLAG SEARCH" FOR TEMP = 1% TO MAX_FLAGS ! FOR ALL SEARCH FLAGS: READ FLAGS_TYPE(TEMP), ! TYPE OF FLAG FIELD & FLAGS_DESC(TEMP), ! FLAG DESCRIPTION & FLAGS_BYTE_OFF(TEMP), ! BYTE OFFSET TO FLAG & FLAGS_LENGTH(TEMP), ! LENGTH OF FLAG & FLAGS_BIT_OFF(TEMP) ! BIT OFF/CNTD STR POS/QUAD MTCH NEXT TEMP DATA FLAGS,CAPTIVE flag set,470,1,0 DATA FLAGC,CAPTIVE flag NOT set,470,1,0 DATA FLAGS,DISCTLY flag set,468,1,0 DATA FLAGC,DISCTLY flag NOT set,468,1,0 DATA FLAGS,DISIMAGE flag set,470,1,1 DATA FLAGC,DISIMAGE flag NOT set,470,1,1 DATA FLAGS,DISMAIL flag set,468,1,7 DATA FLAGC,DISMAIL flag NOT set,468,1,7 DATA FLAGS,DISNEWMAIL flag set,468,1,6 DATA FLAGC,DISNEWMAIL flag NOT set,468,1,6 DATA FLAGS,DISUSER flag set,468,1,4 DATA "","",0,0,0 DATA FLAGS,GENPWD flag set,469,1,0 DATA FLAGC,GENPWD flag NOT set,469,1,0 DATA FLAGS,LOCKPWD flag set,468,1,2 DATA FLAGC,LOCKPWD flag NOT set,468,1,2 DATA FLAGS,PWD_EXPIRED flag set,469,1,1 DATA FLAGC,PWD_EXPIRED flag NOT set,469,1,1 DATA FLAGS,PWD_EXPIRED2 flag set,469,1,2 DATA FLAGC,PWD_EXPIRED2 flag NOT set,469,1,2 DATA FLAGS,RESTRICTED flag set,468,1,3 DATA FLAGC,RESTRICTED flag NOT set,468,1,3 ! ----- READ IN DATA ELEMENTS FOR ALL POSSIBLE PRIVILEGE FIELDS ----- ERROR_LINE = "READING PRIV" LONGEST_PRIV_DESC = 0% ! INIT LENGTH OF LONGEST PRIV FOR TEMP = 1% TO MAX_PRIV ! FOR ALL PRIVILEGE FIELDS: READ PRIV_TYPE(TEMP), ! TYPE OF PRIV FIELD & PRIV_DESC(TEMP), ! PRIVILEGE DESCRIPTION & PRIV_BYTE_OFF(TEMP), ! BYTE OFFSET TO AUTHPRV& PRIV_BIT_OFF(TEMP) ! BIT OFFSET (0-7) IF LEN(PRIV_DESC(TEMP)) > LONGEST_PRIV_DESC THEN LONGEST_PRIV_DESC = LEN(PRIV_DESC(TEMP)) END IF NEXT TEMP DATA PRIV,ACNT,413,1 DATA PRIV,ALLSPOOL,412,4 DATA PRIV,ALTPRI,413,5 DATA PRIV,BUGCHK,414,7 DATA PRIV,BYPASS,415,5 DATA PRIV,CMEXEC,412,1 DATA PRIV,CMKRNL,412,0 DATA PRIV,DETACH,412,5 DATA PRIV,DIAGNOSE,412,6 DATA PRIV,DOWNGRADE,416,1 DATA PRIV,EXQUOTA,414,3 DATA PRIV,GROUP,413,0 DATA PRIV,GRPNAM,412,3 DATA PRIV,GRPPRV,416,2 DATA PRIV,LOG_IO,412,7 DATA PRIV,MOUNT,414,1 DATA PRIV,NETMBX,414,4 DATA PRIV,OPER,414,2 DATA PRIV,PFNMAP,415,2 DATA PRIV,PHY_IO,414,6 DATA PRIV,PRMCEB,413,2 DATA PRIV,PRMGBL,415,0 DATA PRIV,PRMJNL,416,5 DATA PRIV,PRMMBX,413,3 DATA PRIV,PSWAPM,413,4 DATA PRIV,READALL,416,3 DATA PRIV,SECURITY,416,6 DATA PRIV,SETPRV,413,6 DATA PRIV,SHARE,415,7 DATA PRIV,SHMEM,415,3 DATA PRIV,SYSGBL,415,1 DATA PRIV,SYSLCK,415,6 DATA PRIV,SYSNAM,412,2 DATA PRIV,SYSPRV,415,4 DATA PRIV,TMPJNL,416,4 DATA PRIV,TMPMBX,413,7 DATA PRIV,UPGRADE,416,0 DATA PRIV,VOLPRO,414,5 DATA PRIV,WORLD,414,0 ERROR_LINE = "INIT DVI" DVIITEM::BUFFER_LENGTH1 = 4% ! STORE DATA FOR $GETDVIW DVIITEM::ITEM_CODE1 = DVI$_TT_DECCRT DVIITEM::BUFFER_ADDRESS1 = LOC(DECCRT) DVIITEM::RETURN_LENGTH_ADDRESS1 = LOC(DECCRT_LENGTH) DVIITEM::LIST_TERMINATOR = 0% JPIITEM::BUFFER_LENGTH1 = 12% ! STORE DATA FOR $GETJPIW JPIITEM::ITEM_CODE1 = JPI$_USERNAME JPIITEM::BUFFER_ADDRESS1 = LOC(JPI_USERNAME) JPIITEM::RETURN_LENGTH_ADDRESS1 = LOC(USERNAME_LENGTH) JPIITEM::LIST_TERMINATOR = 0% TRNITEM::BUFFER_LENGTH1 = 255% ! STORE DATA FOR $TRNLNM TRNITEM::ITEM_CODE1 = LNM$_STRING TRNITEM::BUFFER_ADDRESS1 = LOC(LOG_NAME) TRNITEM::RETURN_LENGTH_ADDRESS1 = LOC(LOG_LENGTH) TRNITEM::LIST_TERMINATOR = 0% ! ----- GET THE VICTIM'S USERNAME AND PRIVS SO THAT WE CAN SWEAR ----- ! ----- AT HIM/HER IF HE/SHE IS NOT SUFFICIENTLY PRIVILEGED ----- SYS_STATUS = SYS$GETJPIW(, , , JPIITEM, , , ) CALL LIB$STOP(SYS_STATUS BY VALUE) IF SYS_STATUS <> SS$_NORMAL IF JPI_USERNAME = STRING$(12%, 0%) THEN RETURNED_USERNAME = "Turkey" ELSE ! ----- RETURN USERNAME (WITH NO TRAILING BLANKS) ----- RETURNED_USERNAME = LEFT(JPI_USERNAME, USERNAME_LENGTH) ! ----- ENSURE FIRST (AND ONLY FIRST) LETTER OF THE ----- ! ----- USERNAME IS CAPITALIZED ----- RETURNED_USERNAME = CAPITALIZE_FIRST(RETURNED_USERNAME) END IF ! ----- TRANSLATE ANY SYSUAF LOGICAL NAME ----- SYS_STATUS = SYS$TRNLNM(, "LNM$DCL_LOGICAL", "SYSUAF", , TRNITEM) SELECT SYS_STATUS CASE SS$_NOLOGNAM ! IF NO LOGICAL EQUIVALENT: SYS_STATUS = SS$_NORMAL ! CLEAR SYS_STATUS ERROR CONDITION SYSUAF_FILE_SPEC = "SYS$SYSTEM:SYSUAF.DAT" CASE SS$_NORMAL ! ----- EXTRACT LOGICAL NAME ----- IF LOG_LENGTH > 1% THEN SYSUAF_FILE_SPEC = LEFT(LOG_NAME, LOG_LENGTH) ELSE SYSUAF_FILE_SPEC = "SYS$SYSTEM:SYSUAF.DAT" END IF END SELECT ERROR_LINE = " trying to open " + SYSUAF_FILE_SPEC OPEN SYSUAF_FILE_SPEC FOR INPUT AS FILE #1%, & RECORDSIZE 1412%, & ACCESS READ, & ALLOW MODIFY, & INDEXED VARIABLE, & MAP UAF, & RECORDTYPE ANY ! ----- TRY TO TRANSLATE ANY NETPROXY LOGICAL NAME ----- SYS_STATUS = SYS$TRNLNM(, "LNM$DCL_LOGICAL", "NETPROXY", , TRNITEM) SELECT SYS_STATUS CASE SS$_NOLOGNAM ! IF NO LOGICAL EQUIVALENT: ! ----- TRY TO TRANSLATE NETUAF LOGICAL NAME ----- SYS_STATUS = SYS$TRNLNM(, "LNM$DCL_LOGICAL", & "NETUAF", , TRNITEM) SELECT SYS_STATUS CASE SS$_NOLOGNAM ! IF NO LOGICAL EQUIVALENT: ! ----- CLEAR SYS_STATUS ERROR CONDITION ----- SYS_STATUS = SS$_NORMAL SYSUAF_FILE_SPEC = "SYS$SYSTEM:NETPROXY.DAT" CASE SS$_NORMAL ! ----- EXTRACT LOGICAL NAME ----- IF LOG_LENGTH > 1% THEN SYSUAF_FILE_SPEC = LEFT(LOG_NAME, LOG_LENGTH) ELSE SYSUAF_FILE_SPEC = "SYS$SYSTEM:NETPROXY.DAT" END IF END SELECT CASE SS$_NORMAL ! ----- EXTRACT LOGICAL NAME ----- IF LOG_LENGTH > 1% THEN SYSUAF_FILE_SPEC = LEFT(LOG_NAME, LOG_LENGTH) ELSE SYSUAF_FILE_SPEC = "SYS$SYSTEM:NETPROXY.DAT" END IF END SELECT TRY_TO_OPEN_NETUAF: ERROR_LINE = "trying to open " + SYSUAF_FILE_SPEC OPENING_NETUAF_FLAG = 1% IF POS(SYSUAF_FILE_SPEC, "NETPROXY", 1%) <> 0% THEN OPEN SYSUAF_FILE_SPEC FOR INPUT AS FILE #2%, & RECORDSIZE 656%, & ACCESS READ, & ALLOW MODIFY, & INDEXED VARIABLE, & MAP NUAF2, & RECORDTYPE ANY ELSE OPEN SYSUAF_FILE_SPEC FOR INPUT AS FILE #2%, & RECORDSIZE 100%, & ACCESS READ, & ALLOW MODIFY, & INDEXED FIXED, & MAP NUAF, & RECORDTYPE ANY END IF OPENING_NETUAF_FLAG = 0% ! ----- SEE IF A SCREEN CLEARING ESCAPE SEQUENCE SHOULD BE USED ----- ! ----- GET DEVICE INFO FOR THE TERMINAL ----- SYS_STATUS = SYS$GETDVIW(, , "TT", DVIITEM, , , , ) SELECT SYS_STATUS CASE SS$_NORMAL IF DECCRT = 1% THEN ! IS TERMINAL A DEC CRT? ! ----- SPECIFY SCREEN-CLEARING SEQUENCE FOR A DEC ----- ! ----- CRT ----- CLEAR_VT100_SCREEN = ESC + "[H" + ESC + "[2J" ELSE CLEAR_VT100_SCREEN = "" ! NO ESCAPE SEQ IF NON-VTnnn END IF CASE ELSE PRINT "Error from SYS$GETDVIW: " + NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END SELECT ! ----- GET THE CURRENT TERMINAL WIDTH ----- ! ----- ASSIGN AN I/O CHANNEL TO THE TERMINAL ----- SYS_STATUS = SYS$ASSIGN("TT", CHANNEL, , ) IF SYS_STATUS <> SS$_NORMAL THEN PRINT "Error from SYS$ASSIGN: " + NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF IF CHANNEL = 0% THEN ! SAFETY NET PRINT "Error - No available I/O channel" + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END IF ! ----- GET CURRENT TERMINAL STATUS ----- SYS_STATUS = SYS$QIOW(, ! EVENT FLAG & CHANNEL BY VALUE, ! I/O CHANNEL & IO$_SENSEMODE BY VALUE, ! FUNCTION CODE & IOSB() BY REF, ! I/O STATUS BLOCK & , ! AST ADDRESS & , ! AST PARAMETER & DATA_BUF() BY REF, ! TERMINAL DRIVER BUFFER& 12% BY VALUE, ! LENGTH OF TTDRV BUFF & , ! SPEED (N/A) & , ! FILL (N/A) & , ! PARITY (N/A) & ) ! (N/A) SYS_STATUS = IOSB(0%) IF SYS_STATUS = SS$_NORMAL IF (SYS_STATUS AND 1%) = 0% THEN PRINT "Error from SYS$QIOW: " + NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF ! ----- DEASSIGN THE I/O CHANNEL ----- SYS_STATUS = SYS$DASSGN(CHANNEL BY VALUE) IF SYS_STATUS <> SS$_NORMAL THEN PRINT "Error from SYS$DASSGN: " + NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF TERMINAL_WIDTH = DATA_BUF(1%) ! STORE THE TERMINAL WIDTH OPEN "SYS$INPUT:" AS FILE #4% GET_REPORT_TYPE: COMMAND_FILE = FALSE ! ASSUME REPORT TO SCREEN REPORT_OUTPUT = "S" ! ASSUME REPORT TO SCREEN PRINT CLEAR_VT100_SCREEN + "SYSUAF REPORT PROGRAM " + & PROG_VERSION + " --- Select Report Type:" PRINT PRINT "Screen Output:" PRINT " A) Normal Report" PRINT PRINT "List File Output:" PRINT " B) Normal Report" PRINT " C) UAF Flags" PRINT " D) Privileges Report (Default AND Authorized) (132-columns)" PRINT " E) Users who have ever logged in" PRINT " F) Users who have never logged in" PRINT ' G) Users who have not logged in within the past "n" days' PRINT " H) Highly-privileged users, privileges, UICs, and" + & " privileged proxies" PRINT PRINT "Command File Output:" PRINT " I) MODIFY username/" PRINT " J) REVOKE/IDENTIFIER identifier(s) username" PRINT " K) To duplicate a user's account and identifiers" + & " (less Password)" PRINT " L) To duplicate a user's encrypted password info" + & " onto another node" PRINT VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY LINPUT #4%, & "Enter the letter of the desired option (or CTRL/Z to exit): "; & REPORT_TYPE REPORT_TYPE = EDIT$(REPORT_TYPE, 38%) ! CONVERT TO UPPERCASE REPORT_TYPE = "XX" IF REPORT_TYPE = "" OR LEN(REPORT_TYPE) = 0% SELECT REPORT_TYPE CASE "A" ! SCREEN OUTPUT VALID_ENTRY = TRUE COMMAND_FILE = FALSE REPORT_OUTPUT = "S" IF TERMINAL_WIDTH = 132% THEN REPORT_WIDTH = 132% ELSE REPORT_WIDTH = 80% END IF LINES_PER_PAGE = 20% CASE "B" TO "H" ! LIST FILE OUTPUT VALID_ENTRY = TRUE COMMAND_FILE = FALSE REPORT_OUTPUT = "F" REPORT_WIDTH = 132% LINES_PER_PAGE = 60% CASE "I" TO "L" ! COMMAND FILE OUTPUT VALID_ENTRY = TRUE COMMAND_FILE = TRUE REPORT_OUTPUT = "F" REPORT_WIDTH = 132% LINES_PER_PAGE = 60% CASE ELSE PRINT PRINT "Invalid Response - Try Again" + BEL PRINT END SELECT NEXT SELECT REPORT_TYPE CASE "G" ! HAVEN'T LOGGED IN IN "N" DAYS VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY ERROR_CODE = 1% ! STORE ERROR POSITION VALUE PRINT PRINT "Enter the number of days before today" + & " to go back while checking for users who" LINPUT #4%, & " have not logged in : "; & TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE TEMP_STRING = EDIT$(TEMP_STRING, 2%) TEMP_STRING = "180" IF TEMP_STRING = "" IF LEN(TEMP_STRING) > 0% AND LEN(TEMP_STRING) < 4% THEN DAY_LIMIT = INTEGER(TEMP_STRING, LONG) IF DAY_LIMIT > 0% AND DAY_LIMIT < 9000% THEN VALID_ENTRY = TRUE END IF END IF IF NOT VALID_ENTRY THEN PRINT PRINT "Invalid Response - Try Again" + BEL PRINT END IF NEXT END SELECT GET_REPORT_OPTIONS: IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF PRINT TAB(9%); "**** Select none or more of the following" + & " report options: ****" PRINT PRINT " 1) Sort by UIC (instead of normal Username sorting)" PRINT " 2) Skip usernames which have existing accounts on" + & " another node" PRINT " 3) Skip usernames which do not have existing" + & " accounts on another node" PRINT " 4) When multiple search fields are specified," + & " search for user records" PRINT " which match ANY of the search criteria (rather" + & " than the default of" PRINT " searching only for user records which match" + & " ALL of the search criteria)" IF NOT COMMAND_FILE THEN SELECT REPORT_TYPE CASE "C", "D", "F", "H" CASE "E", "G" PRINT " 5) Print no headings and print" + & " only the usernames" CASE ELSE PRINT " 5) Do not print any report" + & " headings (Default=Print Headings)" END SELECT PRINT ' 6) Truncate "too-long" fields so' + & ' that most of them fit on the report' END IF PRINT PRINT "Enter none or more of the above options (concatenated" + & " as one string of chars):" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT ERROR_CODE = 1% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; REPORT_OPTIONS ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- CONVERT TO UPPERCASE ----- REPORT_OPTIONS = EDIT$(REPORT_OPTIONS, 38%) TEMP = 0% WHILE TEMP < LEN(REPORT_OPTIONS) TEMP = TEMP + 1% IF POS("123456", MID(REPORT_OPTIONS, TEMP, 1%), 1%) = 0% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(REPORT_OPTIONS) PRINT PRINT "Invalid Response - Try Again" + BEL PRINT ITERATE END IF IF COMMAND_FILE AND (POS(REPORT_OPTIONS, "5", & 1%) <> 0% OR POS(REPORT_OPTIONS, "6", 1%) <> 0%) THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(REPORT_OPTIONS) PRINT PRINT "Invalid Response - Try Again" + BEL PRINT END IF SELECT REPORT_TYPE CASE "C", "D", "F", "H" IF POS(REPORT_OPTIONS, "5", 1%) <> 0% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(REPORT_OPTIONS) PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF END SELECT NEXT NEXT ! ----- SEE IF USERNAMES ON ANOTHER NODE ARE TO BE [NOT] SKIPPED ----- IF POS(REPORT_OPTIONS, "2", 1%) <> 0% OR & POS(REPORT_OPTIONS, "3", 1%) <> 0% THEN VALID_NODE_NAME = FALSE UNTIL VALID_NODE_NAME PRINT ERROR_CODE = 1% ! STORE ERROR POSITION VALUE LINPUT #4%, & "Enter remote node name (as node::) ==> "; & REMOTE_NODE_NAME ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- CONVERT TO UPPERCASE ----- REMOTE_NODE_NAME = EDIT$(REMOTE_NODE_NAME, 38%) ITERATE IF LEN(REMOTE_NODE_NAME) < 3% ITERATE IF LEN(REMOTE_NODE_NAME) > 8% ITERATE IF RIGHT(REMOTE_NODE_NAME, & LEN(REMOTE_NODE_NAME) - 1%) <> "::" SYSUAF_FILE_SPEC = REMOTE_NODE_NAME + & "SYS$SYSTEM:SYSUAF.DAT" ITERATE IF TRY_TO_OPEN_NODE ERROR_LINE = "VALID REMOTE_NODE_NAME" VALID_NODE_NAME = TRUE NEXT END IF GET_FIELD_SELECTION: LOGIN_FLAGS_WANTED = FALSE ! ASSUME NO LOGIN FLAGS WANTED PRINT_IDENTIFIERS_WANTED = FALSE ! ASSUME NO IDENTIFIERS WANTED PRINT_IDENTIFIER_ATTRIBUTES = FALSE ! ASSUME NO IDENTIFIER ATTRIBUTE REPORT_COUNTER = 0% ! INIT REPORT ITEMS IN MEMORY SEARCH_FOR_HELD_IDENTS = FALSE ! ASSUME NO HELD IDENT SEARCH SKIP_DISUSERED_ACCTS = TRUE ! ASSUME DISUSER'S ARE SKIPPED SEARCH_COUNTER = 0% ! INIT MAX SEARCH ARRAY INDEX SELECT REPORT_TYPE CASE "C" TO "H", "J" TO "L" ! NON-USER-DEFINED REPORT? GOTO GET_SEARCH_FIELDS ! GET FIELDS TO SEARCH FOR END SELECT IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF IF COMMAND_FILE THEN PRINT " Besides the Username, select the data" + & " item(s) to appear in the command file:" ELSE PRINT "**** Besides the Username, select the data" + & " item(s) to appear on the report: ****" END IF ! ----- DISPLAY ALL OF THE FIELDS THAT CAN APPEAR IN THE REPORT ----- MAX_ROW = 2% ROW = 2% COL = 1% POSSIBLE_CHOICES = "" SEARCH_FOR_QUOTA = TRUE FOR TEMP = 1% TO MAX_SEARCH ! FOR ALL POSSIBLE PRINT FIELDS: ! ----- SEE IF FIELD IS TO BE SKIPPED ON PRINT FIELDS MENU ----- ITERATE IF FIELD_BIT_OFF(TEMP) = -99% IF CLEAR_VT100_SCREEN <> "" THEN IF SEARCH_FOR_QUOTA THEN SELECT FIELD_TYPE(TEMP) CASE "CPUTIME", "QUOTA" PRINT ESC + "[2;34HQuotas:" ROW = 3% COL = 32% SEARCH_FOR_QUOTA = FALSE END SELECT ELSE SELECT FIELD_TYPE(TEMP) CASE "CPUTIME", "QUOTA" CASE ELSE ROW = 2% COL = 47% SEARCH_FOR_QUOTA = TRUE END SELECT END IF END IF ! ----- CHANGE USERDATA DESCRIPTION ONLY FOR THE FIELDS ----- ! ----- MENU ----- IF FIELD_DESC(TEMP) = "USERDATA" THEN TEMP_STRING = "Userdata" ELSE TEMP_STRING = FIELD_DESC(TEMP) END IF ! ----- DISPLAY EACH FIELD DESCRIPTION WITH ITS MENU CHAR ----- IF COMMAND_FILE THEN ! ----- SKIP FIELD IF ONLY VALID WHEN CREATING A ----- ! ----- NORMAL REPORT FILE ----- IF FIELD_LENGTH(TEMP) >= 0% THEN IF CLEAR_VT100_SCREEN <> "" THEN PRINT ESC + "[" + NUM1$(ROW) + & ";" + NUM1$(COL) + "H" & + MID(MENU_STRING, & TEMP, 1%) + ") " + TEMP_STRING; ELSE PRINT MID(MENU_STRING, TEMP, & 1%) + ") " + TEMP_STRING END IF POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP, 1%) END IF ELSE ! ----- SKIP FIELD IF ONLY VALID WHEN CREATING A ----- ! ----- COMMAND FILE ----- IF FIELD_BYTE_OFF(TEMP) >= 0% THEN IF CLEAR_VT100_SCREEN <> "" THEN PRINT ESC + "[" + NUM1$(ROW) + & ";" + NUM1$(COL) + "H" & + MID(MENU_STRING, & TEMP, 1%) + ") " + TEMP_STRING; ELSE PRINT MID(MENU_STRING, TEMP, & 1%) + ") " + TEMP_STRING END IF POSSIBLE_CHOICES = POSSIBLE_CHOICES + & MID(MENU_STRING, TEMP, 1%) END IF END IF ROW = ROW + 1% MAX_ROW = ROW IF ROW > MAX_ROW NEXT TEMP PRINT ESC + "[" + NUM1$(MAX_ROW) + ";1H" IF CLEAR_VT100_SCREEN <> "" PRINT "Enter none or more of the above items (concatenated" + & " as one string of chars):" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT ERROR_CODE = 2% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE TEMP_STRING = EDIT$(TEMP_STRING, 38%) ! CONVERT TO UPPERCASE LINE_LENGTH = 13% ! INIT TOTAL LINE LENGTH COUNT REPORT_COUNTER = 0% ! INIT REPORT ITEMS IN MEMORY PRINT_IDENTIFIERS_WANTED = FALSE! ASSUME NO IDENTIFIERS WANTED PRINT_IDENTIFIER_ATTRIBUTES = FALSE ! OR IDENTIFIER ATTRIBUTES TEMP = 0% WHILE TEMP < LEN(TEMP_STRING) TEMP = TEMP + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(TEMP_STRING, TEMP, 1%), 1%) IF SEARCH_INDEX = 0% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(TEMP_STRING) PRINT PRINT "Invalid Response - Try Again" + BEL PRINT ITERATE END IF ! ----- INCREMENT NUMBER OF REPORT ITEMS IN MEMORY ----- REPORT_COUNTER = REPORT_COUNTER + 1% ! ----- STORE ARRAY INDEX FOR EACH REPORT FIELD ----- REPORT_INDEX(REPORT_COUNTER) = SEARCH_INDEX ! ----- STORE REPORT FIELD WIDTH FOR EACH FIELD ----- IF POS(REPORT_OPTIONS, "6", 1%) <> 0% THEN ! ----- TRUNCATE EXTRA-LONG FIELDS ----- REPORT_WIDTHS(REPORT_COUNTER) = & FIELD_WIDTH_TRUNCATED(SEARCH_INDEX) ELSE REPORT_WIDTHS(REPORT_COUNTER) = & FIELD_WIDTH(SEARCH_INDEX) END IF ! ----- COMPUTE LENGTH OF DETAIL LINE ----- LINE_LENGTH = LINE_LENGTH + & REPORT_WIDTHS(REPORT_COUNTER) ! ----- SEE IF HELD IDENTIFIERS WANTED ----- IF FIELD_TYPE(SEARCH_INDEX) = "IDENT" THEN PRINT_IDENTIFIERS_WANTED = TRUE ! ----- SEE WHETHER TO ALSO INCLUDE ----- ! ----- IDENTIFIER ATTRIBUTES ----- PRINT PRINT " When printing held" + & " identifiers, do you also" + & " want to print their attributes?" ! ----- SO LOOP WILL EXECUTE ----- VALID_ENTRY = FALSE UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE ! ----- STORE ERROR POSITION VALUE ----- ERROR_CODE = 3% LINPUT #4%, & " (Enter Y or N) ==> "; & TEMP_STRING2 ! ----- INIT ERROR POSITION VALUE ----- ERROR_CODE = 0% ! ----- CONVERT TO UPPERCASE ----- TEMP_STRING2 = EDIT$(TEMP_STRING2, 38%) SELECT TEMP_STRING2 CASE "Y" PRINT_IDENTIFIER_ATTRIBUTES = & TRUE CASE "N" CASE ELSE ! ----- SET TO ITERATE ----- ! ----- OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid" + & " Response" + & " - Try Again" + BEL PRINT ITERATE END SELECT NEXT END IF ! ----- SEE IF LOGIN FLAGS WANTED ----- IF FIELD_TYPE(SEARCH_INDEX) = "FLAGMENU" THEN LOGIN_FLAGS_WANTED = TRUE END IF NEXT NEXT IF LINE_LENGTH > REPORT_WIDTH THEN ! DISPLAY WARNING IF TOO BIG PRINT PRINT PRINT "> > > Warning: The options that you've" + & " picked will require at least " + & NUM1$(LINE_LENGTH) + " < < <" PRINT "> > > report columns! " + & " < < <" PRINT BEL IF TERMINAL_WIDTH = 80% AND CLEAR_VT100_SCREEN <> "" THEN VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE ELSE VALID_ENTRY = TRUE ! SO LOOP WILL BE SKIPPED TEMP_STRING = "N" ! SO AS NOT TO CHANGE WIDTH END IF UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT PRINT "Do you want me to switch the terminal" + & " into 132-column mode? (Y or N, Default=Y)" ERROR_CODE = 3% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- CONVERT TO UPPERCASE ----- TEMP_STRING = EDIT$(TEMP_STRING, 38%) TEMP_STRING = "Y" IF TEMP_STRING = "" IF TEMP_STRING <> "Y" AND TEMP_STRING <> "N" THEN PRINT PRINT "Invalid Response - Try Again" + BEL PRINT ! ----- SET TO ITERATE LOOP ----- VALID_ENTRY = FALSE ITERATE END IF NEXT IF TEMP_STRING = "Y" THEN TERMINAL_WIDTH_CHANGED = TRUE VALID_ENTRY = TRUE ! SO LOOP WILL BE SKIPPED ELSE VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE END IF UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT PRINT "Do you want to re-enter your field" + & " selection? (Y or N, Default=Y)" ERROR_CODE = 3% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- CONVERT TO UPPERCASE ----- TEMP_STRING = EDIT$(TEMP_STRING, 38%) TEMP_STRING = "Y" IF TEMP_STRING = "" GOTO GET_FIELD_SELECTION IF TEMP_STRING = "Y" IF TEMP_STRING <> "N" THEN PRINT PRINT "Invalid Response - Try Again" + BEL PRINT ! ----- SET TO ITERATE LOOP ----- VALID_ENTRY = FALSE ITERATE END IF NEXT END IF GET_SEARCH_FIELDS: IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF PRINT TAB(12%); & "**** Select none or more data items to SEARCH for: ****" ! ----- DISPLAY ALL OF THE SEARCH FIELD DESCRIPTIONS ----- MAX_ROW = 2% ROW = 2% COL = 1% POSSIBLE_CHOICES = "" SEARCH_FOR_QUOTA = TRUE FOR TEMP = 1% TO MAX_SEARCH ! FOR ALL SEARCH FIELDS: IF CLEAR_VT100_SCREEN <> "" THEN IF SEARCH_FOR_QUOTA THEN SELECT FIELD_TYPE(TEMP) CASE "CPUTIME", "QUOTA" PRINT ESC + "[2;34HQuotas:" ROW = 3% COL = 32% SEARCH_FOR_QUOTA = FALSE END SELECT ELSE SELECT FIELD_TYPE(TEMP) CASE "CPUTIME", "QUOTA" CASE ELSE ROW = 2% COL = 47% SEARCH_FOR_QUOTA = TRUE END SELECT END IF END IF ! ----- CHANGE UIC DESCRIPTION ONLY FOR SEARCH MENU ----- IF FIELD_DESC(TEMP) = "UIC" THEN TEMP_STRING = "UIC Group" ELSE ! ----- CHANGE LOGIN FLAGS DESCRIPTION ONLY FOR ----- ! ----- SEARCH MENU ----- IF FIELD_DESC(TEMP) = "FLAGMENU" THEN TEMP_STRING = "Login Flags (set or clear)" ELSE TEMP_STRING = FIELD_DESC(TEMP) END IF END IF ! ----- DISPLAY EACH FIELD DESCRIPTION WITH ITS MENU CHAR ----- IF CLEAR_VT100_SCREEN <> "" THEN PRINT ESC + "[" + NUM1$(ROW) + ";" + NUM1$(COL) & + "H" + MID(MENU_STRING, TEMP, 1%) + & ") " + TEMP_STRING; ELSE PRINT MID(MENU_STRING, TEMP, 1%) + ") " + TEMP_STRING END IF POSSIBLE_CHOICES = POSSIBLE_CHOICES + MID(MENU_STRING, TEMP, 1%) ROW = ROW + 1% MAX_ROW = ROW IF ROW > MAX_ROW NEXT TEMP PRINT ESC + "[" + NUM1$(MAX_ROW) + ";1H" IF CLEAR_VT100_SCREEN <> "" PRINT "Enter none or more of the above items (concatenated" + & " as one string of chars):" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY VALID_ENTRY = TRUE ! ASSUME VALID INPUT ERROR_CODE = 3% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; USER_SEARCH_INP ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- CONVERT TO UPPERCASE ----- USER_SEARCH_INP = EDIT$(USER_SEARCH_INP, 38%) TEMP = 0% WHILE TEMP < LEN(USER_SEARCH_INP) TEMP = TEMP + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(USER_SEARCH_INP, TEMP, 1%), 1%) IF SEARCH_INDEX = 0% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER LOOP ----- TEMP = LEN(USER_SEARCH_INP) PRINT PRINT "Invalid Response - Try Again" + BEL PRINT ITERATE END IF NEXT NEXT ! ----- PROMPT FOR SEARCH CRITERIA FOR ALL SEARCH FIELDS ----- SKIP_DISUSERED_ACCTS = TRUE ! ASSUME DISUSER'S ARE SKIPPED SEARCH_FOR_HELD_IDENTS = FALSE ! ASSUME NO HELD IDENT SEARCH SEARCH_COUNTER = 0% ! INIT MAX SEARCH ARRAY INDEX SEARCH_ELEMENT = 0% ! INIT SEARCH ELEMENT POSITION WHILE SEARCH_ELEMENT < LEN(USER_SEARCH_INP) SEARCH_ELEMENT = SEARCH_ELEMENT + 1% SEARCH_INDEX = POS(POSSIBLE_CHOICES, & MID(USER_SEARCH_INP, SEARCH_ELEMENT, 1%), 1%) SELECT FIELD_TYPE(SEARCH_INDEX) ! TYPE OF FIELD TO SEARCH: CASE "ACCESSMENU" ! ACCESS RESTRICTION MENU GOTO GET_SEARCH_FIELDS IF GET_ACCESS_MENU CASE "AUTHPRIVMENU" ! AUTHORIZED PRIVILEGES MENU GOTO GET_SEARCH_FIELDS IF GET_PRIV_MENU("AUTHORIZED") CASE "DEFPRIVMENU" ! DEFAULT PRIVILEGES MENU GOTO GET_SEARCH_FIELDS IF GET_PRIV_MENU("DEFAULT") CASE "FLAGMENU" ! LOGIN FLAGS MENU GOTO GET_SEARCH_FIELDS IF GET_FLAG_MENU CASE "DATE", "DATEP1", "DATEP2" ! QUADWORD ABSOLUTE DATE/TIME ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER + 1%) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER + 1%) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- ASSUME NO PRE-EXPIRED FLAG SEARCH ----- PRE_EXPIRED_RESPONSE = 0% SELECT FIELD_TYPE(SEARCH_INDEX) CASE "DATEP1" ! POSSIBLE PRE-EXPIRED DATE ! ----- SO LOOP WILL EXECUTE ----- VALID_ENTRY = FALSE UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE PRINT PRINT "Do you want to search" + & " only for users" + & " having a PRE-EXPIRED" PRINT FIELD_DESC(SEARCH_INDEX) + "?"; ! ----- STORE ERROR POSITION VALUE ----- ERROR_CODE = 4% LINPUT #4%, & " Enter Y or N (Default of N) ==> "; & TEMP_STRING ! ----- INIT ERROR POSITION VALUE ----- ERROR_CODE = 0% ! ----- CONVERT TO UPPERCASE - ----- ! ----- REMOVE SPACES/TABS ----- TEMP_STRING = EDIT$(TEMP_STRING, 38%) TEMP_STRING = "N" IF TEMP_STRING = "" SELECT TEMP_STRING CASE "Y" ! ----- SEARCH ONLY FOR ----- ! ----- PRE-EXPIRED FLAG ----- ! ----- SET ----- PRE_EXPIRED_RESPONSE = 1% CASE <> "N" ! ----- SET TO ITERATE ----- ! ----- OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid" + & " Response" + & " - Try Again" + BEL PRINT ITERATE END SELECT NEXT IF PRE_EXPIRED_RESPONSE = 0% THEN ! ----- SO LOOP WILL EXECUTE ----- VALID_ENTRY = FALSE PRINT END IF UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE PRINT PRINT "Do you want to search" + & " only for users" + & " *NOT* having a PRE-EXPIRED" PRINT FIELD_DESC(SEARCH_INDEX) + "?"; ! ----- STORE ERROR POSITION VALUE ----- ERROR_CODE = 4% LINPUT #4%, & " Enter Y or N (Default of N) ==> "; & TEMP_STRING ! ----- INIT ERROR POSITION VALUE ----- ERROR_CODE = 0% ! ----- CONVERT TO UPPERCASE - ----- ! ----- REMOVE SPACES/TABS ----- TEMP_STRING = EDIT$(TEMP_STRING, 38%) TEMP_STRING = "N" IF TEMP_STRING = "" SELECT TEMP_STRING CASE "Y" ! ----- SEARCH ONLY FOR ----- ! ----- PRE-EXPIRED FLAG ----- ! ----- NOT SET ----- PRE_EXPIRED_RESPONSE = 2% CASE <> "N" ! ----- SET TO ITERATE ----- ! ----- OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid" + & " Response" + & " - Try Again" + BEL PRINT ITERATE END SELECT NEXT SELECT PRE_EXPIRED_RESPONSE CASE 1% ! SEARCH ONLY FOR PRE-EXPIRED ! ----- INCREMENT NUMBER OF ----- ! ----- SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = & "Pre-Expired flag set" ! ----- STORE CODE FOR QUADWORD ----- ! ----- FLAG SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 16% ! ----- STORE SPECIAL QUADWORD ----- ! ----- CODE VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = -1% CASE 2% ! SEARCH ONLY FOR NOT PRE-EXPIRE ! ----- INCREMENT NUMBER OF ----- ! ----- SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = & "Pre-Expired flag NOT set" ! ----- STORE CODE FOR QUADWORD ----- ! ----- FLAG SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 16% ! ----- STORE SPECIAL QUADWORD ----- ! ----- CODE VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = -2% CASE ELSE ! NORMAL DATE SEARCH ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER + & 1%) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE CODE FOR QUADWORD ----- ! ----- DATE/TIME SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER + 1%) = 0% ! ----- STORE BIT OFFSET TO ----- ! ----- DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE ----- ! ----- TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER + & 1%) = & FIELD_BIT_OFF(SEARCH_INDEX) END SELECT CASE ELSE ! NORMAL DATE SEARCH ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER + 1%) = & FIELD_DESC(SEARCH_INDEX) ! ----- STORE CODE FOR QUADWORD DATE/TIME ----- ! ----- SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER + 1%) = 0% ! ----- STORE BIT OFFSET TO DATA ----- SEARCH_BIT_OFF(SEARCH_COUNTER + 1%) = & FIELD_BIT_OFF(SEARCH_INDEX) END SELECT IF PRE_EXPIRED_RESPONSE = 0% THEN ! ----- SO LOOP WILL EXECUTE ----- VALID_ENTRY = FALSE PRINT END IF UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE PRINT PRINT "Enter Low "; SEARCH_DESC( & SEARCH_COUNTER + 1%); & " date to search for as MM/DD/YY," ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, & "Or press to start with earliest date: "; & SEARCH_TEXT(SEARCH_COUNTER + 1%) ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- CONVERT TO UPPERCASE - REMOVE ----- ! ----- SPACES/TABS ----- SEARCH_TEXT(SEARCH_COUNTER + 1%) = & EDIT$(SEARCH_TEXT( & SEARCH_COUNTER + 1%), 38%) IF LEN(SEARCH_TEXT(SEARCH_COUNTER + 1%))& <> 0% AND & LEN(SEARCH_TEXT(SEARCH_COUNTER & + 1%)) <> 8% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END IF ! ----- CONVERT FROM MM/DD/YY TO YYMMDD ----- ! ----- IF ANY TEXT WAS ENTERED ----- SEARCH_TEXT(SEARCH_COUNTER + 1%) = & RIGHT(SEARCH_TEXT(SEARCH_COUNTER& + 1%), 7%) + LEFT(SEARCH_TEXT( & SEARCH_COUNTER + 1%), 2%) + & MID(SEARCH_TEXT( & SEARCH_COUNTER + 1%), 4%, 2%) & IF SEARCH_TEXT(SEARCH_COUNTER + & 1%) <> "" NEXT IF PRE_EXPIRED_RESPONSE = 0% THEN ! ----- SO LOOP WILL EXECUTE ----- VALID_ENTRY = FALSE END IF UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE PRINT PRINT "Enter High "; SEARCH_DESC( & SEARCH_COUNTER + 1%); & " date to search for as MM/DD/YY," ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, & "Or press to end with latest date: ";& SEARCH_TEXT2(SEARCH_COUNTER + 1%) ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- CONVERT TO UPPERCASE - REMOVE ----- ! ----- SPACES/TABS ----- SEARCH_TEXT2(SEARCH_COUNTER + 1%) = & EDIT$(SEARCH_TEXT2( & SEARCH_COUNTER + 1%), 38%) IF LEN(SEARCH_TEXT2(SEARCH_COUNTER + & 1%)) <> 0% AND & LEN(SEARCH_TEXT2(SEARCH_COUNTER & + 1%)) <> 8% THEN ! ----- SET TO ITERATE OUTER LOOP ----- VALID_ENTRY = FALSE PRINT PRINT "Invalid Response" + & " - Try Again" + BEL PRINT ITERATE END IF ! ----- CONVERT FROM MM/DD/YY TO YYMMDD ----- ! ----- IF ANY TEXT WAS ENTERED ----- SEARCH_TEXT2(SEARCH_COUNTER + 1%) = & RIGHT(SEARCH_TEXT2( & SEARCH_COUNTER + 1%), 7%) + & LEFT(SEARCH_TEXT2( & SEARCH_COUNTER + 1%), 2%) + & MID(SEARCH_TEXT2( & SEARCH_COUNTER + 1%), 4%, 2%) & IF SEARCH_TEXT2(SEARCH_COUNTER & + 1%) <> "" NEXT SELECT PRE_EXPIRED_RESPONSE CASE 0% ! SEARCH FOR NORMAL DATES ! ----- INCREMENT NUMBER OF SEARCH ITEMS ----- ! ----- IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% END SELECT CASE "DELTA" ! DELTA TIME SEARCH_LONG(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG(SEARCH_COUNTER + 1%) <> -987123% PRINT PRINT "Enter " + SEARCH_DESC( & SEARCH_COUNTER + 1%) + & " Low days to search for" + & " (Default=0)" ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- DISCARD ANY CONTROL CHARACTERS ----- ! ----- AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = "0" IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 10% THEN SEARCH_LONG(SEARCH_COUNTER + & 1%) = INTEGER(TEMP_STRING, LONG) END IF IF SEARCH_LONG(SEARCH_COUNTER + 1%) = -987123% THEN PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF NEXT SEARCH_LONG2(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG2(SEARCH_COUNTER + 1%) <> -987123% PRINT PRINT "Enter " + SEARCH_DESC( & SEARCH_COUNTER + 1%) + & " High days to search for" + & " (Default=" + NUM1$( & SEARCH_LONG(SEARCH_COUNTER + 1%)) + ")" ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- DISCARD ANY CONTROL CHARACTERS ----- ! ----- AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = NUM1$(SEARCH_LONG( & SEARCH_COUNTER + 1%)) & IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 10% THEN SEARCH_LONG2(SEARCH_COUNTER + & 1%) = INTEGER(TEMP_STRING, LONG) END IF IF SEARCH_LONG2(SEARCH_COUNTER + 1%) < & SEARCH_LONG(SEARCH_COUNTER + 1%) THEN SEARCH_LONG2(SEARCH_COUNTER + & 1%) = -987123% PRINT PRINT "ERROR - Value is low" + & "er than the Low" + & " days - Try Again" + BEL PRINT ITERATE END IF IF SEARCH_LONG2(SEARCH_COUNTER + 1%) = -987123% THEN PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF NEXT ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FIELD_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR DELTA TIME SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 1% CASE "IDENT", "NIDENT" ! TEST FOR [UN]HELD IDENTIFIERS SELECT FIELD_TYPE(SEARCH_INDEX) CASE "IDENT" ! TEST FOR HELD IDENTIFIERS ! ----- STORE CODE FOR HELD IDENTIFIER ----- ! ----- SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER + 1%) = 4% ! ----- SET FLAG FOR USE WHEN REVOKING ----- ! ----- IDENTIFIERS IN A COMMAND FILE ----- SEARCH_FOR_HELD_IDENTS = TRUE PRINT ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, & "Enter the exact held IDENTIFIER to search for: "; & SEARCH_TEXT(SEARCH_COUNTER + 1%) ERROR_CODE = 0% ! INIT ERROR POSITION VALUE CASE "NIDENT" ! TEST FOR UN-HELD IDENTIFIERS ! ----- STORE CODE FOR UN-HELD IDENTIFIER ----- ! ----- SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER + 1%) = 9% PRINT ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, & "Enter the exact UN-held IDENTIFIER to search for: "; & SEARCH_TEXT(SEARCH_COUNTER + 1%) ERROR_CODE = 0% ! INIT ERROR POSITION VALUE END SELECT ! ----- SEE IF ATTRIBUTES ARE TO BE CHECKED ----- PRINT SELECT FIELD_TYPE(SEARCH_INDEX) CASE "IDENT" ! TEST FOR HELD IDENTIFIERS PRINT " Search for users holding the " & + SEARCH_TEXT(SEARCH_COUNTER + & 1%) + " identifier:" CASE "NIDENT" ! TEST FOR UN-HELD IDENTIFIERS PRINT " Search for users NOT holding" & + " the " + & SEARCH_TEXT(SEARCH_COUNTER + 1%)& + " identifier:" END SELECT PRINT " 1) Regardless of any attributes" PRINT " 2) With the RESOURCE attribute set" PRINT " 3) With the DYNAMIC attribute set" PRINT " 4) With the RESOURCE attribute NOT set" PRINT " 5) With the DYNAMIC attribute NOT set" VALID_ENTRY = FALSE ! SO LOOP WILL EXECUTE UNTIL VALID_ENTRY ! ----- ASSUME VALID INPUT ----- VALID_ENTRY = TRUE PRINT "Enter one or more of the" + & " above digits (concatenated" + & " as one string)" LINPUT #4%, & " (Default of 1) ==> "; & REPORT_SEARCH ! ----- REMOVE GARBAGE ----- REPORT_SEARCH = EDIT$(REPORT_SEARCH, 38%) REPORT_SEARCH = "*" IF REPORT_SEARCH = "" TEMP = 0% WHILE TEMP < LEN(REPORT_SEARCH) TEMP = TEMP + 1% SELECT MID(REPORT_SEARCH, TEMP, 1%) CASE "1" ! ANY ATTRIBUTE ! ----- STORE ATTRIBUTE ----- ! ----- SEARCH CODE ----- SEARCH_LONG( & SEARCH_COUNTER & + 1%) = 0% ! ----- SET TO EXIT INNER ----- ! ----- LOOP ----- TEMP = LEN(REPORT_SEARCH) CASE "2" ! RESOURCE ATTRIBUTE SET ! ----- STORE ATTRIBUTE ----- ! ----- SEARCH CODE ----- SEARCH_LONG( & SEARCH_COUNTER & + 1%) = & SEARCH_LONG( & SEARCH_COUNTER & + 1%) OR 1% CASE "3" ! DYNAMIC ATTRIBUTE SET ! ----- STORE ATTRIBUTE ----- ! ----- SEARCH CODE ----- SEARCH_LONG( & SEARCH_COUNTER & + 1%) = & SEARCH_LONG( & SEARCH_COUNTER & + 1%) OR 2% CASE "4" ! RESOURCE ATTRIBUTE CLR ! ----- STORE ATTRIBUTE ----- ! ----- SEARCH CODE ----- SEARCH_LONG( & SEARCH_COUNTER & + 1%) = & SEARCH_LONG( & SEARCH_COUNTER & + 1%) OR 4% CASE "5" ! DYNAMIC ATTRIBUTE CLR ! ----- STORE ATTRIBUTE ----- ! ----- SEARCH CODE ----- SEARCH_LONG( & SEARCH_COUNTER & + 1%) = & SEARCH_LONG( & SEARCH_COUNTER & + 1%) OR 8% CASE ELSE ! ----- SET TO ITERATE ----- ! ----- OUTER LOOP ----- VALID_ENTRY = FALSE ! ----- SET TO EXIT INNER ----- ! ----- LOOP ----- TEMP = LEN(REPORT_SEARCH) PRINT PRINT "Invalid" + & " Response" + & " - Try Again" + BEL PRINT END SELECT NEXT NEXT ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FIELD_BIT_OFF(SEARCH_INDEX) ! ----- CONVERT TO UPPERCASE - REMOVE SPACES/TABS ----- SEARCH_TEXT(SEARCH_COUNTER) = & EDIT$(SEARCH_TEXT(SEARCH_COUNTER), 38%) CASE "PRIME" ! PRIMARY/SECONDARY DAYS MENU GOTO GET_SEARCH_FIELDS IF GET_PRIMARY_MENU CASE "QUOTA", "VALUE" ! QUOTA OR VALUE RANGE SEARCH_LONG(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG(SEARCH_COUNTER + 1%) <> -987123% PRINT PRINT "Enter " + SEARCH_DESC( & SEARCH_COUNTER + 1%) + & " Low value to search for" + & " (Default=0)" ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- DISCARD ANY CONTROL CHARACTERS ----- ! ----- AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = "0" IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 10% THEN SEARCH_LONG(SEARCH_COUNTER + & 1%) = INTEGER(TEMP_STRING, LONG) END IF IF SEARCH_LONG(SEARCH_COUNTER + 1%) = -987123% THEN PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF NEXT SEARCH_LONG2(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG2(SEARCH_COUNTER + 1%) <> -987123% PRINT PRINT "Enter " + SEARCH_DESC( & SEARCH_COUNTER + 1%) + & " High value to search for" + & " (Default=" + NUM1$( & SEARCH_LONG(SEARCH_COUNTER + 1%)) + ")" ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- DISCARD ANY CONTROL CHARACTERS ----- ! ----- AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = NUM1$(SEARCH_LONG( & SEARCH_COUNTER + 1%)) & IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 10% THEN SEARCH_LONG2(SEARCH_COUNTER + & 1%) = INTEGER(TEMP_STRING, LONG) END IF IF SEARCH_LONG2(SEARCH_COUNTER + 1%) < & SEARCH_LONG(SEARCH_COUNTER + 1%) THEN SEARCH_LONG2(SEARCH_COUNTER + & 1%) = -987123% PRINT PRINT "ERROR - Value is low" + & "er than the Low" + & " value - Try Again" + BEL PRINT ITERATE END IF IF SEARCH_LONG2(SEARCH_COUNTER + 1%) = -987123% THEN PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF NEXT ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FIELD_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR VALUE SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 8% CASE "CPUTIME" ! CPUTIME RANGE SEARCH_LONG(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG(SEARCH_COUNTER + 1%) <> -987123% PRINT PRINT "Enter " + SEARCH_DESC( & SEARCH_COUNTER + 1%) + & " Low seconds to search for" + & " (Default=0)" ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- DISCARD ANY CONTROL CHARACTERS ----- ! ----- AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = "0" IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 10% THEN SEARCH_LONG(SEARCH_COUNTER + & 1%) = INTEGER(TEMP_STRING, LONG) END IF IF SEARCH_LONG(SEARCH_COUNTER + 1%) = -987123% THEN PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF NEXT SEARCH_LONG2(SEARCH_COUNTER + 1%) = -987123% UNTIL SEARCH_LONG2(SEARCH_COUNTER + 1%) <> -987123% PRINT PRINT "Enter " + SEARCH_DESC( & SEARCH_COUNTER + 1%) + & " High seconds to search for" + & " (Default=" + NUM1$( & SEARCH_LONG(SEARCH_COUNTER + 1%)) + ")" ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- DISCARD ANY CONTROL CHARACTERS ----- ! ----- AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) TEMP_STRING = NUM1$(SEARCH_LONG( & SEARCH_COUNTER + 1%)) & IF TEMP_STRING = "" IF LEN(TEMP_STRING) < 10% THEN SEARCH_LONG2(SEARCH_COUNTER + & 1%) = INTEGER(TEMP_STRING, LONG) END IF IF SEARCH_LONG2(SEARCH_COUNTER + 1%) < & SEARCH_LONG(SEARCH_COUNTER + 1%) THEN SEARCH_LONG2(SEARCH_COUNTER + & 1%) = -987123% PRINT PRINT "ERROR - Value is low" + & "er than the Low" + & " value - Try Again" + BEL PRINT ITERATE END IF IF SEARCH_LONG2(SEARCH_COUNTER + 1%) = -987123% THEN PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF NEXT ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FIELD_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR CPUTIME SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 15% CASE "TEXT" ! SEARCH FOR CONTAINING TEXT PRINT PRINT "Enter " + SEARCH_DESC(SEARCH_COUNTER + & 1%) + " substring to search for" ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, "==> "; SEARCH_TEXT(SEARCH_COUNTER + 1%) ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- CONVERT TO UPPERCASE - REMOVE SPACES/TABS ----- SEARCH_TEXT(SEARCH_COUNTER) = & EDIT$(SEARCH_TEXT(SEARCH_COUNTER), 38%) ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FIELD_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR TEXT SUBSTRING SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 5% CASE "UIC" ! UIC GROUP SEARCH_LONG(SEARCH_COUNTER + 1%) = -1% UNTIL SEARCH_LONG(SEARCH_COUNTER + 1%) <> -1% PRINT ERROR_CODE = 4% ! STORE ERROR POSITION VALUE LINPUT #4%, & "Enter Octal UIC Group to search for: ";& TEMP_STRING ERROR_CODE = 0% ! INIT ERROR POSITION VALUE ! ----- DISCARD ANY CONTROL CHARACTERS ----- ! ----- AND SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 6%) IF TEMP_STRING <> "" AND LEN(TEMP_STRING) < 10% THEN ! ----- SET TO SEARCH FOR ----- ! ----- SPECIFIC UIC GRP ----- SEARCH_LONG(SEARCH_COUNTER + & 1%) = INTEGER(TEMP_STRING, LONG) IF SEARCH_LONG(SEARCH_COUNTER + & 1%) < 1% THEN SEARCH_LONG( & SEARCH_COUNTER & + 1%) = -1% END IF END IF IF SEARCH_LONG(SEARCH_COUNTER + 1%) = -1% THEN PRINT PRINT "Invalid Response -" + & " Try Again" + BEL PRINT END IF NEXT ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FIELD_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR UIC GROUP SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 6% CASE "USERDATA" ! ANY EXISTING USER DATA ! ----- INCREMENT NUMBER OF SEARCH ITEMS IN MEMORY ----- SEARCH_COUNTER = SEARCH_COUNTER + 1% ! ----- STORE DATA DESCRIPTION ----- SEARCH_DESC(SEARCH_COUNTER) = FIELD_DESC(SEARCH_INDEX) ! ----- STORE BYTE OFFSET TO DATA ----- SEARCH_BYTE_OFF(SEARCH_COUNTER) = & FIELD_BYTE_OFF(SEARCH_INDEX) ! ----- STORE DATA LENGTH ----- SEARCH_LENGTH(SEARCH_COUNTER) = & ABS%(FIELD_LENGTH(SEARCH_INDEX)) ! ----- STORE BIT OFFSET TO DATA/COUNTED STRING ----- ! ----- POSITION/QUADWORD VALUE TO MATCH ----- SEARCH_BIT_OFF(SEARCH_COUNTER) = & FIELD_BIT_OFF(SEARCH_INDEX) ! ----- STORE CODE FOR EXISTING USER DATA SEARCH ----- SEARCH_TYPE(SEARCH_COUNTER) = 7% CASE ELSE PRINT PRINT "Invalid FIELD_TYPE(" + & NUM1$(SEARCH_INDEX) + "): " + & FIELD_TYPE(SEARCH_INDEX) + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END SELECT NEXT DO_REPORT: CLOSE #4% ! ----- SEE IF USER WANTS TO CHANGE THE TERMINAL WIDTH ----- IF TERMINAL_WIDTH_CHANGED THEN ! ----- SET THE TERMINAL WIDTH TO 132 ----- ! ----- ASSIGN AN I/O CHANNEL TO THE TERMINAL ----- SYS_STATUS = SYS$ASSIGN("TT", CHANNEL, , ) IF SYS_STATUS <> SS$_NORMAL THEN PRINT "Error from SYS$ASSIGN(2): " + & NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF IF CHANNEL = 0% THEN ! SAFETY NET PRINT "Error - No available I/O channel" + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END IF ! ----- CHANGE SETUP MODE TO 132 COLS ----- PRINT PRINT ESC + "[?3h" DATA_BUF(1%) = 132% ! STORE THE NEW TERMINAL WIDTH ! ----- SET TERMINAL STATUS ----- SYS_STATUS = SYS$QIOW(, ! EVENT FLAG & CHANNEL BY VALUE, ! I/O CHANNEL & IO$_SETMODE BY VALUE, ! FUNCTION CODE & IOSB() BY REF, ! I/O STATUS BLOCK & , ! AST ADDRESS & , ! AST PARAMETER & DATA_BUF() BY REF, ! TERMINAL DRIVER BUFFER& 12% BY VALUE, ! LENGTH OF TTDRV BUFF & , ! SPEED (N/A) & , ! FILL (N/A) & , ! PARITY (N/A) & ) ! (N/A) SYS_STATUS = IOSB(0%) IF SYS_STATUS = SS$_NORMAL IF (SYS_STATUS AND 1%) = 0% THEN PRINT "Error from SYS$QIOW(2): " + & NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF ! ----- DEASSIGN THE I/O CHANNEL ----- SYS_STATUS = SYS$DASSGN(CHANNEL BY VALUE) IF SYS_STATUS <> SS$_NORMAL THEN PRINT "Error from SYS$DASSGN(2): " + & NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF ! ----- TERMINAL WIDTH WAS CHANGED ----- TERMINAL_WIDTH = 132% REPORT_WIDTH = 132% END IF PRINT IF CLEAR_VT100_SCREEN = "" THEN PRINT CLEAR_VT100_SCREEN ELSE PRINT CLEAR_VT100_SCREEN; END IF PRINT "Working..." IF REPORT_OUTPUT = "F" ! ----- GET TODAY'S JULIAN DATE ----- SYS_STATUS = LIB$DAY(TODAYS_DATE, , ) CALL LIB$STOP(SYS_STATUS BY VALUE) IF (SYS_STATUS AND 1%) <> SS$_NORMAL IF REPORT_OUTPUT <> "F" THEN ERROR_LINE = "trying to open TT:" OPEN "TT" FOR OUTPUT AS FILE #10%, RECORDSIZE 80% ELSE IF COMMAND_FILE THEN ERROR_LINE = "trying to open SYSUAF.COM" OPEN "SYSUAF.COM" FOR OUTPUT AS FILE #10%, & SEQUENTIAL, & RECORDSIZE 132% SELECT REPORT_TYPE CASE "L" ! DUPLICATE PWD INFO ON NODE PRINT #10%, '$SAVE_PRIV=F$SETPRV("BYPASS")' PRINT #10%, "$ON ERROR THEN GOTO DONE" PRINT #10%, "$RUN TOOLS:TRANSFER_PWD_TO_NODE" CASE ELSE PRINT #10%, '$SAVE_PRIV=F$SETPRV(' + & '"SYSPRV,BYPASS,CMKRNL")' PRINT #10%, '$SAVE_UIC=F$USER()' PRINT #10%, '$IF F$EXTRACT(0, 1,' + & ' SAVE_UIC) .NES. "[" THEN' + & ' SAVE_UIC = "[' + "''SAVE_UIC']" + '"' PRINT #10%, "$ON ERROR THEN GOTO DONE" PRINT #10%, "$SET UIC [SYSTEM]" PRINT #10%, "$IF F$TRNLNM(" + CHR$(34%) & + "SYSUAF" + CHR$(34%) + & ") .EQS. " + CHR$(34%) + & CHR$(34%) + " THEN DEFINE" + & "/USER SYSUAF SYS$SYSTEM:SYSUAF.DAT" PRINT #10%, "$IF F$TRNLNM(" + CHR$(34%) & + "NETUAF" + CHR$(34%) + & ") .EQS. " + CHR$(34%) + & CHR$(34%) + " THEN DEFINE" + & "/USER NETUAF SYS$SYSTEM:NETUAF.DAT" PRINT #10%, "$IF F$TRNLNM(" + CHR$(34%) & + "NETPROXY" + CHR$(34%) + & ") .EQS. " + CHR$(34%) + & CHR$(34%) + " THEN -" PRINT #10%, " DEFINE/USER NETPROXY"; & " SYS$SYSTEM:NETPROXY.DAT" PRINT #10%, "$RUN SYS$SYSTEM:AUTHORIZE" END SELECT ELSE ERROR_LINE = "trying to open SYSUAF.LIS" OPEN "SYSUAF.LIS" FOR OUTPUT AS FILE #10%, & SEQUENTIAL, & RECORDSIZE 132% END IF END IF GOTO END_PROGRAM IF CHECK_FOR_HEADINGS ! PRINT INITIAL HEADINGS ! ----- SEE IF UIC SORT WANTED ----- IF POS(REPORT_OPTIONS, "1", 1%) <> 0% THEN RESET #1%, KEY #1% END IF ! ----- READ IN IDENTIFIER HOLDERS FOR EACH [UN]HELD IDENTIFIER ----- ! ----- WHICH IS BEING SEARCHED FOR ----- SEARCH_INDEX = 0% ! SET SO LOOP WILL EXECUTE WHILE SEARCH_INDEX < SEARCH_COUNTER SEARCH_INDEX = SEARCH_INDEX + 1% SELECT SEARCH_TYPE(SEARCH_INDEX) CASE 4%, 9% ! SEARCH FOR [UN]HELD IDENTIFIER ! ----- CREATE LIST OF ALL IDENTIFIER HOLDERS ----- ! ----- FOR THIS SPECIFIC IDENTIFIER (WITH THE ----- ! ----- SELECTED ATTRIBUTES) ----- SYS_STATUS = LOCATE_HOLDER( & SEARCH_TEXT(SEARCH_INDEX), & SEARCH_LONG(SEARCH_INDEX)) SELECT SYS_STATUS CASE SS$_NORMAL SEARCH_HOLDERS(SEARCH_INDEX) = HOLDER_LIST %IF %DEBUG = 1% %THEN PRINT "DEBUG>HOLDERS OF " + & SEARCH_TEXT(SEARCH_INDEX) + ":" PRINT HOLDER_LIST %END %IF CASE SS$_NOSUCHID SELECT SEARCH_TYPE(SEARCH_INDEX) CASE 4% ! SEARCH FOR HELD IDENTIFIER PRINT "No users hold" + & " the identifier: " + & SEARCH_TEXT(SEARCH_INDEX) ! ----- DONE WITH REPORT ----- GOTO END_OF_FILE CASE 9% ! SEARCH FOR UN-HELD IDENTIFIER SEARCH_HOLDERS(SEARCH_INDEX) = "~" END SELECT CASE ELSE PRINT "LOCATE_HOLDER Error:" + & " SYS_STATUS="; SYS_STATUS; & " while searching for" + & " identifier: " + & SEARCH_TEXT(SEARCH_INDEX) GOTO END_PROGRAM END SELECT END SELECT NEXT ERROR_LINE = " reading SYSUAF records" WHILE TRUE 20 GET #1%, REGARDLESS ! ----- SEE IF DISUSER'ED ACCOUNTS ARE TO BE SKIPPED ----- ITERATE IF (FLAGS(0%) AND 16%) <> 0% IF SKIP_DISUSERED_ACCTS UIC_GROUP = DEC_TO_OCT(OCT_UIC_GROUP) CPUTIME_HOURS = INT(CPUTIME / 360000%) CPUTIME = CPUTIME - CPUTIME_HOURS * 360000% CPUTIME_MINUTES = INT(CPUTIME / 6000%) CPUTIME = CPUTIME - CPUTIME_MINUTES * 6000% CPUTIME_SECONDS = INT(CPUTIME / 100%) CPUTIME = CPUTIME - CPUTIME_SECONDS * 100% SKIP_THIS_USER = FALSE ! ASSUME USER IS NOT SKIPPED IF SEARCH_COUNTER = 0% THEN ALL_SEARCHES_FAIL = FALSE ELSE ALL_SEARCHES_FAIL = TRUE! ASSUME ALL SEARCHES FAIL END IF ! ----- SKIP RECORDS NOT MATCHING ALL SEARCH CRITERIA ----- SEARCH_INDEX = 0% ! SET SO LOOP WILL EXECUTE WHILE SEARCH_INDEX < SEARCH_COUNTER SEARCH_INDEX = SEARCH_INDEX + 1% SEARCH_FAILS = FALSE ! ASSUME SEARCH SUCCEEDS SELECT SEARCH_TYPE(SEARCH_INDEX) CASE 0%, 1% ! QUADWORD ABSOLUTE/DELTA TIME ! ----- MAP TO QUADWORD DATE/TIME ----- REMAP (UAF) & STRING FILL = SEARCH_BYTE_OFF( & SEARCH_INDEX), & CLUNK_DATE1, & CLUNK_DATE2 ! ----- SKIP IF NO DATE ----- IF CLUNK_DATE1 = 0% AND CLUNK_DATE2 = 0% THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE ELSE SELECT SEARCH_TYPE(SEARCH_INDEX) CASE 1% ! QUADWORD DELTA TIME SYS_STATUS = SYS$NUMTIM(& TIME_BUFFER() & BY REF, & CLUNK_DATE1 BY REF) CALL LIB$STOP( & SYS_STATUS BY & VALUE) IF & (SYS_STATUS & AND 1%) <> SS$_NORMAL ! ----- SKIP IF DAYS IS ----- ! ----- TOO EARLY OR LATE ----- IF TIME_BUFFER(2%) < & SEARCH_LONG( & SEARCH_INDEX) & OR & TIME_BUFFER(2%) & > SEARCH_LONG2( & SEARCH_INDEX) THEN ! ----- SET SEARCH ----- ! ----- FAILURE ----- ! ----- FLAG ----- SEARCH_FAILS = TRUE END IF CASE ELSE ! ----- CONVERT CLUNKS TO ----- ! ----- YYMMDD ----- TEMP_STRING = FROM_CLUNKS ! ----- SKIP IF DATE IS ----- ! ----- TOO EARLY OR TOO ----- ! ----- LATE ----- IF TEMP_STRING < & SEARCH_TEXT( & SEARCH_INDEX) & OR TEMP_STRING >& SEARCH_TEXT2( & SEARCH_INDEX) & AND & SEARCH_TEXT2( & SEARCH_INDEX) <> "" THEN ! ----- SET SEARCH ----- ! ----- FAILURE ----- ! ----- FLAG ----- SEARCH_FAILS = TRUE END IF END SELECT END IF CASE 2%, 3% ! SKIP IF FLAG BIT IS SET/CLEAR SELECT SEARCH_LENGTH(SEARCH_INDEX) CASE 1% ! BYTE ! ----- MAP TO FLAGS BYTE ----- REMAP (UAF) & STRING FILL = & SEARCH_BYTE_OFF(& SEARCH_INDEX), & A_BYTE ! ----- MOVE BYTE TO LONGWORD ----- MY_LONGWORD = A_BYTE CASE 2% ! WORD ! ----- MAP TO FLAGS WORD ----- REMAP (UAF) & STRING FILL = & SEARCH_BYTE_OFF(& SEARCH_INDEX), & A_WORD ! ----- MOVE WORD TO LONGWORD ----- MY_LONGWORD = A_WORD CASE 4% ! LONGWORD ! ----- MAP TO FLAGS LONGWORD ----- REMAP (UAF) & STRING FILL = & SEARCH_BYTE_OFF(& SEARCH_INDEX), & A_LONGWORD ! ----- MOVE LONGWORD TO LONGWORD ----- MY_LONGWORD = A_LONGWORD CASE ELSE PRINT PRINT "Invalid SEARCH_LENGTH(" & + NUM1$(SEARCH_INDEX) + & "): " + NUM1$( & SEARCH_LENGTH( & SEARCH_INDEX)) + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END SELECT SELECT SEARCH_TYPE(SEARCH_INDEX) CASE 2% ! SKIP IF FLAG BIT IS SET ! ----- SKIP IF FLAG IS SET ----- IF (MY_LONGWORD AND 2% ^ & SEARCH_BIT_OFF( & SEARCH_INDEX)) <> 0% THEN ! ----- SET SEARCH ----- ! ----- FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 3% ! SKIP IF FLAG BIT IS CLEAR ! ----- SKIP IF FLAG IS CLEAR ----- IF (MY_LONGWORD AND 2% ^ & SEARCH_BIT_OFF( & SEARCH_INDEX)) = 0% THEN ! ----- SET SEARCH ----- ! ----- FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF END SELECT CASE 4% ! SKIP IF NO MATCHING IDENTIFIER ! ----- SKIP IF THIS USER DOES NOT HOLD ----- ! ----- THIS IDENTIFIER ----- IF POS(SEARCH_HOLDERS(SEARCH_INDEX), & "~" + TRM$(USER_NAME), 1%) = 0% THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 5% ! SEARCH FOR CONTAINING TEXT ! ----- SEE IF COUNTED TEXT STRING ----- IF SEARCH_BIT_OFF(SEARCH_INDEX) <> 0% THEN ! ----- MAP TO COUNTED TEXT STRING ----- REMAP (UAF) & STRING FILL = & SEARCH_BIT_OFF & (SEARCH_INDEX), & A_BYTE, & A_TEXT = A_BYTE ELSE ! ----- MAP TO STATIC TEXT STRING ----- REMAP (UAF) & STRING FILL = & SEARCH_BYTE_OFF & (SEARCH_INDEX), & A_TEXT = SEARCH_LENGTH( & SEARCH_INDEX) END IF TEMP_STRING = EDIT$(A_TEXT, 168%) ! ----- SKIP IF NO MATCHING TEXT SUBSTRING ----- IF POS(TEMP_STRING, & SEARCH_TEXT(SEARCH_INDEX), 1%) = 0% THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 6% ! SEARCH FOR UIC GROUP ! ----- SKIP IF NON-MATCHING UIC GROUP ----- IF SEARCH_LONG(SEARCH_INDEX) <> UIC_GROUP THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 7% ! ANY EXISTING USER DATA ! ----- SKIP IF NO USER DATA EXISTS ----- IF USER_DATA_LENGTH = 0% THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 8%, 15% ! QUOTA / VALUE / CPUTIME RANGE SELECT SEARCH_LENGTH(SEARCH_INDEX) CASE 1% ! BYTE ! ----- MAP TO BYTE VALUE ----- REMAP (UAF) & STRING FILL = & SEARCH_BYTE_OFF(& SEARCH_INDEX), & A_BYTE ! ----- MOVE BYTE TO LONGWORD ----- MY_LONGWORD = A_BYTE CASE 2% ! WORD ! ----- MAP TO WORD VALUE ----- REMAP (UAF) & STRING FILL = & SEARCH_BYTE_OFF(& SEARCH_INDEX), & A_WORD ! ----- MOVE WORD TO LONGWORD ----- MY_LONGWORD = A_WORD CASE 4% ! LONGWORD ! ----- MAP TO LONGWORD VALUE ----- REMAP (UAF) & STRING FILL = & SEARCH_BYTE_OFF(& SEARCH_INDEX), & A_LONGWORD ! ----- MOVE LONGWORD TO LONGWORD ----- MY_LONGWORD = A_LONGWORD CASE ELSE PRINT PRINT "Invalid SEARCH_LENGTH(" & + NUM1$(SEARCH_INDEX) + & "): " + NUM1$( & SEARCH_LENGTH( & SEARCH_INDEX)) + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END SELECT ! ----- SKIP IF VALUE TOO LOW ----- IF MY_LONGWORD < SEARCH_LONG(SEARCH_INDEX) THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE ELSE ! ----- SKIP IF VALUE TOO HIGH ----- IF MY_LONGWORD > & SEARCH_LONG2(SEARCH_INDEX) THEN ! ----- SET SEARCH FAILURE ----- ! ----- FLAG ----- SEARCH_FAILS = TRUE END IF END IF CASE 9% ! SKIP IF MATCHING IDENTIFIER ! ----- SKIP IF THIS USER HOLDS THIS ----- ! ----- IDENTIFIER ----- IF POS(SEARCH_HOLDERS(SEARCH_INDEX), & "~" + TRM$(USER_NAME), 1%) <> 0% THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 10% ! ANY ACCESS RESTRICTION RESTRICTED_ACCESS = FALSE TEMP1 = SEARCH_BYTE_OFF(SEARCH_INDEX) - 2% WHILE TEMP1 < SEARCH_BYTE_OFF( & SEARCH_INDEX) + & SEARCH_LENGTH(SEARCH_INDEX) - 2% TEMP1 = TEMP1 + 2% ! ----- MAP TO WORD VALUE ----- REMAP (UAF) & STRING FILL = TEMP1, & A_WORD IF A_WORD <> 0% THEN ! ----- USER HAS AT LEAST ----- ! ----- ONE ACCESS ----- ! ----- RESTRICTION ----- RESTRICTED_ACCESS = TRUE ! ----- SET TO EXIT LOOP ----- TEMP1 = TEMP1 + 9% END IF NEXT IF NOT RESTRICTED_ACCESS THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 11%, 14% ! PRIMARY/SECONDARY ACCESS PREV_BYTE_OFFSET = -1% ! ----- SEARCH FOR ENTIRE TIME RANGE ----- TEMP2 = SEARCH_LONG(SEARCH_INDEX) - 1% WHILE TEMP2 < SEARCH_LONG2(SEARCH_INDEX) TEMP2 = TEMP2 + 1% ! ----- CALCULATE REQUIRED BYTE ----- ! ----- AND BIT OFFSET WHICH ----- ! ----- CONTAINS THIS SPECIFIC ----- ! ----- TIME ----- SELECT TEMP2 CASE 0% TO 7% BYTE_OFF = & SEARCH_BYTE_OFF(& SEARCH_INDEX) BIT_OFF = TEMP2 CASE 8% TO 15% BYTE_OFF = & SEARCH_BYTE_OFF(& SEARCH_INDEX) + 1% BIT_OFF = TEMP2 - 8% CASE ELSE BYTE_OFF = & SEARCH_BYTE_OFF(& SEARCH_INDEX) + 2% BIT_OFF = TEMP2 - 16% END SELECT ! ----- REMAP REQUIRED IF DIFF ----- ! ----- BYTE OFFSET REQUIRED ----- IF BYTE_OFF <> PREV_BYTE_OFFSET THEN ! ----- MAP TO WORD VALUE ----- REMAP (UAF) & STRING FILL = & BYTE_OFF, & A_WORD PREV_BYTE_OFFSET = BYTE_OFF END IF IF SEARCH_BIT_OFF(SEARCH_INDEX) = 0% THEN ! ----- SKIP IF USER DOES ----- ! ----- NOT HAVE ACCESS ----- ! ----- FOR THIS GIVEN ----- ! ----- TIME ----- IF (A_WORD AND 2% ^ & BIT_OFF) <> 0% THEN ! ----- SET SEARCH ----- ! ----- FAILURE ----- ! ----- FLAG ----- SEARCH_FAILS = TRUE ! ----- SET TO ----- ! ----- EXIT LOOP ----- TEMP2 = 99% END IF ELSE ! ----- SKIP IF USER DOES ----- ! ----- HAVE ACCESS FOR ----- ! ----- THIS GIVEN TIME ----- IF (A_WORD AND 2% ^ & BIT_OFF) = 0% THEN ! ----- SET SEARCH ----- ! ----- FAILURE ----- ! ----- FLAG ----- SEARCH_FAILS = TRUE ! ----- SET TO ----- ! ----- EXIT LOOP ----- TEMP2 = 99% END IF END IF NEXT CASE 12% ! SEARCH FOR PRIMARY DAY ! ----- SKIP IF SECONDARY DAY BIT IS SET ----- IF (PRIMEDAYS AND 2% ^ SEARCH_BIT_OFF( & SEARCH_INDEX)) <> 0% THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 13% ! SEARCH FOR SECONDARY DAY ! ----- SKIP IF PRIMARY DAY BIT IS SET ----- IF (PRIMEDAYS AND 2% ^ SEARCH_BIT_OFF( & SEARCH_INDEX)) = 0% THEN ! ----- SET SEARCH FAILURE FLAG ----- SEARCH_FAILS = TRUE END IF CASE 16% ! QUADWORD PASSWORD FLAG SEARCH ! ----- MAP TO QUADWORD DATE/TIME ----- REMAP (UAF) & STRING FILL = SEARCH_BYTE_OFF( & SEARCH_INDEX), & CLUNK_DATE1, & CLUNK_DATE2 ! ----- SEE IF PRE-EXPIRED PASSWORD ----- IF CLUNK_DATE1 = -1% AND CLUNK_DATE2 = -1% THEN ! ----- SKIP THIS USER IF NOT ----- ! ----- SEARCHING FOR A ----- ! ----- PRE-EXPIRED PASSWORD ----- IF SEARCH_BIT_OFF(SEARCH_INDEX) = -2% THEN ! ----- SET SEARCH FAILURE ----- ! ----- FLAG ----- SEARCH_FAILS = TRUE END IF ELSE ! ----- SKIP THIS USER IF ----- ! ----- SEARCHING FOR A ----- ! ----- PRE-EXPIRED PASSWORD ----- IF SEARCH_BIT_OFF(SEARCH_INDEX) = -1% THEN ! ----- SET SEARCH FAILURE ----- ! ----- FLAG ----- SEARCH_FAILS = TRUE END IF END IF CASE ELSE PRINT PRINT "Invalid SEARCH_TYPE(" + & NUM1$(SEARCH_INDEX) + "): " + & NUM1$(SEARCH_TYPE(SEARCH_INDEX)) + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END SELECT ! ----- SEE IF THIS SEARCH FAILED ----- IF SEARCH_FAILS THEN ! ----- SEE IF SEARCHING FOR ALL MATCHING ----- ! ----- SEARCH CRITERIA ----- IF POS(REPORT_OPTIONS, "4", 1%) = 0% THEN ! ----- SET COUNTER TO EXIT LOOP ----- SEARCH_INDEX = SEARCH_COUNTER ! ----- SEE FLAG SO AS TO SKIP ----- ! ----- THIS USER ----- SKIP_THIS_USER = TRUE END IF ELSE ! ----- AT LEAST ONE SEARCH IS SUCCESSFUL ----- ALL_SEARCHES_FAIL = FALSE ! ----- SEE IF SEARCHING FOR ANY MATCHING ----- ! ----- SEARCH CRITERIA (RATHER THAN FOR ----- ! ----- ALL MATCHING SEARCH CRITERIA) ----- IF POS(REPORT_OPTIONS, "4", 1%) <> 0% THEN ! ----- SET COUNTER TO EXIT LOOP ----- SEARCH_INDEX = SEARCH_COUNTER END IF END IF NEXT ! ----- SEE IF THIS USER IS TO BE SKIPPED OR IF ALL ----- ! ----- SEARCHES FAIL ----- ITERATE IF SKIP_THIS_USER OR ALL_SEARCHES_FAIL ! ----- SEE IF USERNAMES ON ANOTHER NODE ARE TO BE SKIPPED ----- IF POS(REPORT_OPTIONS, "2", 1%) <> 0% THEN IF REMOTE_NODE_NAME <> "" THEN ITERATE IF REMOTE_NODE_LOOKUP END IF END IF ! ----- SEE IF USERNAMES NOT ON ANOTHER NODE ARE TO BE ----- ! ----- SKIPPED ----- IF POS(REPORT_OPTIONS, "3", 1%) <> 0% THEN IF REMOTE_NODE_NAME <> "" THEN ITERATE IF NOT REMOTE_NODE_LOOKUP END IF END IF ! ----- SEE IF REPORT ALWAYS REQUIRE A LOOKUP OF THE HELD ----- ! ----- IDENTIFIERS ----- IF REPORT_TYPE = "J" OR REPORT_TYPE = "K" OR & PRINT_IDENTIFIERS_WANTED THEN ! ----- CREATE LIST OF ALL HELD IDENTIFIERS ----- GOTO END_PROGRAM IF LOCATE_IDENTIFIER END IF ERROR_LINE = " processing SYSUAF" UIC_MEMBER = DEC_TO_OCT(OCT_UIC_MEMBER) ! ----- CHECK FOR TYPE OF REPORT TO BE PRINTED ----- SELECT REPORT_TYPE CASE "A", "B" ! NORMAL SCREEN/FILE REPORT GOTO END_PROGRAM IF CHECK_FOR_HEADINGS REPORT_RECORD_WRITTEN = TRUE ! ----- ALWAYS PRINT USERNAME ----- PRINT #10%, LEFT(USER_NAME, 13%); SEARCH_INDEX = 0% ! SO LOOP WILL WORK ! ----- FOR EACH FIELD TO ALSO PRINT ON THE REPORT ----- WHILE SEARCH_INDEX < REPORT_COUNTER SEARCH_INDEX = SEARCH_INDEX + 1% FIELD_INDEX = REPORT_INDEX(SEARCH_INDEX) FIELD_LEN = ABS%(FIELD_LENGTH(FIELD_INDEX)) ! ----- SEE IF FIELD SHOULD BE LEFT OR ----- ! ----- RIGHT JUSTIFIED WITHIN THE FIELD ----- ! ----- WIDTH ----- SELECT FIELD_TYPE(FIELD_INDEX) CASE "FLAGMENU" ! LOGIN FLAGS (VARIABLE LENGTH) ! ----- SKIP FLAGS TILL END OF ----- ! ----- REPORT DETAIL LINE ----- CASE "ACCESSMENU" ! ACCESS RESTRICTIONS (VAR LEN) ! ----- SKIP SINCE THEY PRINT ON ----- ! ----- SUBSEQUENT LINES ----- CASE "IDENT" ! HELD IDENTIFIERS ! ----- SKIP SINCE THEY PRINT ON ----- ! ----- SUBSEQUENT LINES ----- CASE "USERDATA" ! USERDATA ! ----- SKIP SINCE THIS PRINTS ON ----- ! ----- SUBSEQUENT LINES ----- CASE "AUTHPRIVMENU", "DEFPRIVMENU" ! AUTHORIZED OR DEFAULT PRIVS ! ----- SKIP SINCE THIS PRINTS ON ----- ! ----- SUBSEQUENT LINES ----- CASE "QUOTA", "VALUE" ! ----- PRINT RIGHT-JUSTIFIED DATA ----- SELECT FIELD_LEN CASE 1% ! BYTE ! ----- MAP TO BYTE VALUE ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_BYTE ! ----- MOVE BYTE TO ----- ! ----- LONGWORD ----- MY_LONGWORD = A_BYTE CASE 2% ! WORD ! ----- MAP TO WORD VALUE ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_WORD ! ----- MOVE WORD TO ----- ! ----- LONGWORD ----- MY_LONGWORD = A_WORD CASE 4% ! LONGWORD ! ----- MAP TO LONGWORD ----- ! ----- VALUE ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_LONGWORD ! ----- MOVE LONGWORD TO ----- ! ----- LONGWORD ----- MY_LONGWORD = A_LONGWORD CASE ELSE PRINT PRINT "Invalid" + & " FIELD_LENGTH("& + NUM1$( & FIELD_INDEX) + & "): " + NUM1$( & FIELD_LENGTH( & FIELD_INDEX)) + BEL CALL SYS$EXIT( & ERROR_NO_PUTMSG & BY VALUE) END SELECT PRINT #10%, RJLB(MY_LONGWORD, & REPORT_WIDTHS(SEARCH_INDEX)); CASE "CPUTIME" ! CPUTIME LIMIT TEMP_STRING = & RJLB(CPUTIME_HOURS, 3%) & + ":" + & RJL0(CPUTIME_MINUTES, & 2%) + ":" + & RJL0(CPUTIME_SECONDS, & 2%) + "." + RJL0(CPUTIME, 2%) IF TEMP_STRING = " 0:00:00.00" THEN PRINT #10%, " (infinite)"; ELSE PRINT #10%, " " + TEMP_STRING; END IF CASE "DATE", "DATEP1", "DATEP2" ! DATE OR PRE-EXPIRED DATE ! ----- MAP TO QUADWORD DATE FIELD ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF( & FIELD_INDEX), & CLUNK_DATE1, & CLUNK_DATE2 ! ----- SEE IF NO DATE EXISTS ----- IF CLUNK_DATE1 = 0% AND CLUNK_DATE2 = 0% THEN TEMP_STRING = "(none)" ELSE ! ----- SEE IF ----- ! ----- PRE-EXPIRED ----- ! ----- PASSWORD ----- IF FIELD_TYPE( & FIELD_INDEX) = & "DATEP1" AND & CLUNK_DATE1 = & -1% AND & CLUNK_DATE2 = -1% THEN TEMP_STRING = & "(pre"+ & "-expired)" ELSE ! ----- CONVERT ----- ! ----- CLUNKS TO ----- ! ----- DATE ----- CLUNK_DATE(0%) & = CLUNK_DATE1 CLUNK_DATE(1%) & = CLUNK_DATE2 TEMP_STRING = & FROM_CLUNKS_MDY END IF END IF ! ----- PRINT RIGHT-JUSTIFIED DATE ----- PRINT #10%, RJLBS(TEMP_STRING, & REPORT_WIDTHS(SEARCH_INDEX)); CASE "UIC" ! UIC PRINT #10%, LJTBS(" [" + & NUM1$(UIC_GROUP) + "," & + NUM1$(UIC_MEMBER) + "]", 15%); CASE "DELTA" ! DELTA PASSWORD LIFETIME SYS_STATUS = SYS$NUMTIM( & TIME_BUFFER() BY REF, & PASSWORD_LIFETIME() BY REF) CALL LIB$STOP(SYS_STATUS BY & VALUE) IF (SYS_STATUS & AND 1%) = 0% IF PASSWORD_LIFETIME(0%) = 0% & AND PASSWORD_LIFETIME(1%) = 0% THEN TEMP_STRING = "none" ELSE TEMP_STRING = NUM1$( & TIME_BUFFER(2%)) END IF ! ----- PRINT RIGHT-JUSTIFIED DATA ----- PRINT #10%, RJLBS(TEMP_STRING, & REPORT_WIDTHS(SEARCH_INDEX)); CASE "PRIME" ! PRIMARY DAYS TEMP_STRING = "" TEMP_STRING = TEMP_STRING + & ",Mon" IF (PRIMEDAYS & AND 1%) = 0% TEMP_STRING = TEMP_STRING + & ",Tue" IF (PRIMEDAYS & AND 2%) = 0% TEMP_STRING = TEMP_STRING + & ",Wed" IF (PRIMEDAYS & AND 4%) = 0% TEMP_STRING = TEMP_STRING + & ",Thu" IF (PRIMEDAYS & AND 8%) = 0% TEMP_STRING = TEMP_STRING + & ",Fri" IF (PRIMEDAYS & AND 16%) = 0% TEMP_STRING = TEMP_STRING + & ",Sat" IF (PRIMEDAYS & AND 32%) = 0% TEMP_STRING = TEMP_STRING + & ",Sun" IF (PRIMEDAYS & AND 64%) = 0% IF TEMP_STRING <> "" THEN TEMP_STRING = RIGHT( & TEMP_STRING, 2%) ELSE TEMP_STRING = "" END IF ! ----- PRINT LEFT-JUSTIFIED DATA ----- PRINT #10%, LJTBS(" " + & TEMP_STRING, & REPORT_WIDTHS(SEARCH_INDEX)); CASE ELSE ! TEXT FIELDS ! ----- SEE IF COUNTED TEXT STRING ----- IF FIELD_BIT_OFF(FIELD_INDEX) <> 0% THEN ! ----- MAP TO COUNTED ----- ! ----- TEXT STRING ----- REMAP (UAF) & STRING FILL = & FIELD_BIT_OFF(& FIELD_INDEX), & A_BYTE, & A_TEXT = A_BYTE ELSE ! ----- MAP TO STATIC ----- ! ----- TEXT STRING ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_TEXT = FIELD_LEN END IF TEMP_STRING = EDIT$(A_TEXT, 136%) ! ----- PRINT LEFT-JUSTIFIED DATA ----- PRINT #10%, LJTBS(" " + & CIFLONG(TEMP_STRING, & REPORT_WIDTHS(SEARCH_INDEX) & - 1%), & REPORT_WIDTHS(SEARCH_INDEX)); END SELECT NEXT ! ----- ALL LOGIN FLAGS WILL PRINT AT THE END ----- IF LOGIN_FLAGS_WANTED THEN FOR FLAG = 1% TO MAX_FLAG PRINT #10%, " " + & FLAG_DESC(FLAG); IF & FLAGS(FLAG_BYTE_OFF( & FLAG)) AND & 2% ^ FLAG_BIT_OFF(FLAG) NEXT FLAG END IF PRINT #10% ! END DETAIL LINE LINE_COUNTER = LINE_COUNTER + 1% ! ----- PROCESS ALL MULTI-LINE ITEMS ----- SEARCH_INDEX = 0% ! SO LOOP WILL WORK ! ----- FOR EACH FIELD TO ALSO PRINT ON THE REPORT ----- WHILE SEARCH_INDEX < REPORT_COUNTER SEARCH_INDEX = SEARCH_INDEX + 1% FIELD_INDEX = REPORT_INDEX(SEARCH_INDEX) ! ----- SEE IF FIELD SHOULD BE LEFT OR ----- ! ----- RIGHT JUSTIFIED WITHIN THE FIELD ----- ! ----- WIDTH ----- SELECT FIELD_TYPE(FIELD_INDEX) CASE "ACCESSMENU" ! ACCESS RESTRICTIONS GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TAB(13%); & "Network Access: " + & DO_ACCESS(472) LINE_COUNTER = LINE_COUNTER + 1% GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TAB(13%); & "Batch Access: " + & DO_ACCESS(478) LINE_COUNTER = LINE_COUNTER + 1% GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TAB(13%); & "Local Access: " + & DO_ACCESS(484) LINE_COUNTER = LINE_COUNTER + 1% GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TAB(13%); & "Dialup Access: " + & DO_ACCESS(490) LINE_COUNTER = LINE_COUNTER + 1% GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TAB(13%); & "Remote Access: " + & DO_ACCESS(496) LINE_COUNTER = LINE_COUNTER + 1% CASE "IDENT" ! HELD IDENTIFIERS ! ----- PRINT ALL HELD IDENTIFIERS ----- GOTO END_PROGRAM IF PRINT_IDENTIFIERS CASE "USERDATA" ! USERDATA ! ----- SKIP IF NO USERDATA ----- ITERATE IF USER_DATA_LENGTH = 0% USER_DATA_STRING = TRM$(LEFT( & USER_DATA_AREA, & USER_DATA_LENGTH)) PRINT #10%, TAB(13%); "Userdata: "; CHARS_WRITTEN = 23% FOR TEMP = 1% TO USER_DATA_LENGTH TEMP_STRING = MID( & USER_DATA_STRING& , TEMP, 1%) SELECT ASCII(TEMP_STRING) CASE 32% TO 126%! PRINTABLE? STRING_TO_PRINT & = TEMP_STRING CASE ELSE ! NON-PRINTABLE STRING_TO_PRINT & = "<" + & NUM1$( & ASCII( & TEMP_STRING)) & + ">" END SELECT IF CHARS_WRITTEN + & LEN(STRING_TO_PRINT) & > REPORT_WIDTH THEN PRINT #10% CHARS_WRITTEN = 0% LINE_COUNTER = & LINE_COUNTER & + 1% GOTO END_PROGRAM& IF & CHECK_FOR_HEADINGS END IF PRINT #10%, STRING_TO_PRINT; CHARS_WRITTEN = & CHARS_WRITTEN + & LEN(STRING_TO_PRINT) NEXT TEMP PRINT #10% ! END DETAIL LINE LINE_COUNTER = LINE_COUNTER + 1% GOTO END_PROGRAM IF CHECK_FOR_HEADINGS CASE "AUTHPRIVMENU" ! AUTHORIZED PRIVILEGES GOTO END_PROGRAM IF DO_PRIVS(0%) CASE "DEFPRIVMENU" ! DEFAULT PRIVILEGES GOTO END_PROGRAM IF DO_PRIVS(1%) END SELECT NEXT CASE "C" ! FLAGS REPORT GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TRM$(USER_NAME); TAB(33%); FOR FLAG = 1% TO MAX_FLAG IF FLAGS(FLAG_BYTE_OFF(FLAG)) AND & 2% ^ FLAG_BIT_OFF(FLAG) THEN PRINT #10%, MID(PRINT_STRING, & FLAG, 1%) + " "; ELSE PRINT #10%, " "; END IF NEXT FLAG PRINT #10% ! END DETAIL LINE LINE_COUNTER = LINE_COUNTER + 1% REPORT_RECORD_WRITTEN = TRUE CASE "D" ! PRIVILEGE REPORT GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TRM$(USER_NAME); TAB(33%); FOR FLAG = 1% TO MAX_PRIV ! ----- MAP TO REQUIRED BYTES ----- REMAP (UAF) & STRING FILL=PRIV_BYTE_OFF(FLAG),& A_BYTE, & STRING FILL=7%, & A_BYTE2 ! ----- MOVE BYTES TO LONGWORDS ----- MY_LONGWORD = A_BYTE MY_LONGWORD2 = A_BYTE2 ! ----- SEE IF BOTH AUTHORIZED AND DEFAULT ----- ! ----- PRIVILEGE BITS ARE CLEAR ----- IF ((MY_LONGWORD OR MY_LONGWORD2) AND & 2% ^ PRIV_BIT_OFF(FLAG)) = 0% THEN PRINT #10%, " "; ELSE PRINT #10%, MID(PRINT_STRING, & FLAG, 1%) + " "; END IF NEXT FLAG PRINT #10% ! END DETAIL LINE LINE_COUNTER = LINE_COUNTER + 1% REPORT_RECORD_WRITTEN = TRUE CASE "E" ! USERS WHO HAVE LOGGED IN CLUNK_DATE(0%) = LAST_INTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_INTER_LOGIN_DATE(1%) IF CLUNK_DATE(0%) = 0% AND CLUNK_DATE(1%) = 0% THEN CLUNK_DATE(0%) = LAST_NINTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_NINTER_LOGIN_DATE(1%) ITERATE IF CLUNK_DATE(0%) = 0% AND & CLUNK_DATE(1%) = 0% END IF ! ----- PRINT ONLY THE USERNAME IF NO HEADINGS ARE ----- ! ----- SUPPOSED TO BE PRINTED ----- IF POS(REPORT_OPTIONS, "5", 1%) <> 0% THEN PRINT #10%, TRM$(USER_NAME) ELSE GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TRM$(USER_NAME); TAB(37%); CLUNK_DATE(0%) = LAST_INTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_INTER_LOGIN_DATE(1%) IF CLUNK_DATE(0%) = 0% AND CLUNK_DATE(1%) = 0% THEN PRINT #10%, " (none)"; TAB(59%); ELSE PRINT #10%, FROM_CLUNKS_MDY; TAB(59%); END IF CLUNK_DATE(0%) = LAST_NINTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_NINTER_LOGIN_DATE(1%) IF CLUNK_DATE(0%) = 0% AND CLUNK_DATE(1%) = 0% THEN PRINT #10%, " (none)" ELSE PRINT #10%, FROM_CLUNKS_MDY END IF END IF LINE_COUNTER = LINE_COUNTER + 1% REPORT_RECORD_WRITTEN = TRUE CASE "F" ! USERS WHO HAVE NEVER LOGGED IN CLUNK_DATE(0%) = LAST_INTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_INTER_LOGIN_DATE(1%) ITERATE IF CLUNK_DATE(0%) <> 0% OR CLUNK_DATE(1%) <> 0% CLUNK_DATE(0%) = LAST_NINTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_NINTER_LOGIN_DATE(1%) ITERATE IF CLUNK_DATE(0%) <> 0% OR CLUNK_DATE(1%) <> 0% GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TRM$(USER_NAME) LINE_COUNTER = LINE_COUNTER + 1% REPORT_RECORD_WRITTEN = TRUE CASE "G" ! "N" DAYS NOT LOGGED IN ! ----- CALCULATE TEMP=TRUE IF LOGGED IN WITHIN ----- ! ----- THE PAST "N" DAYS ----- TEMP = FALSE ! ----- CHECK FOR INTERACTIVE LOGINS ----- IF LAST_INTER_LOGIN_DATE(0%) <> 0% OR & LAST_INTER_LOGIN_DATE(1%) <> 0% THEN FIRST_BINTIM(0%) = LAST_INTER_LOGIN_DATE(0%) FIRST_BINTIM(1%) = LAST_INTER_LOGIN_DATE(1%) IF DELTA_DATES < DAY_LIMIT THEN TEMP = TRUE END IF END IF ! ----- CHECK FOR NON-INTERACTIVE LOGINS ----- IF NOT TEMP THEN IF LAST_NINTER_LOGIN_DATE(0%) <> 0% OR & LAST_NINTER_LOGIN_DATE(1%) <> 0% THEN FIRST_BINTIM(0%) = & LAST_NINTER_LOGIN_DATE(0%) FIRST_BINTIM(1%) = & LAST_NINTER_LOGIN_DATE(1%) IF DELTA_DATES < DAY_LIMIT THEN TEMP = TRUE END IF END IF END IF ITERATE IF TEMP ! ----- PRINT ONLY THE USERNAME IF NO HEADINGS ARE ----- ! ----- SUPPOSED TO BE PRINTED ----- IF POS(REPORT_OPTIONS, "5", 1%) <> 0% THEN PRINT #10%, TRM$(USER_NAME) ELSE GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TRM$(USER_NAME); TAB(37%); CLUNK_DATE(0%) = LAST_INTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_INTER_LOGIN_DATE(1%) IF CLUNK_DATE(0%) = 0% AND CLUNK_DATE(1%) = 0% THEN PRINT #10%, " (none)"; TAB(59%); ELSE PRINT #10%, FROM_CLUNKS_MDY; TAB(59%); END IF CLUNK_DATE(0%) = LAST_NINTER_LOGIN_DATE(0%) CLUNK_DATE(1%) = LAST_NINTER_LOGIN_DATE(1%) IF CLUNK_DATE(0%) = 0% AND CLUNK_DATE(1%) = 0% THEN PRINT #10%, " (none)" ELSE PRINT #10%, FROM_CLUNKS_MDY END IF END IF LINE_COUNTER = LINE_COUNTER + 1% REPORT_RECORD_WRITTEN = TRUE CASE "H" ! SPECIAL PRIVILEGE REPORT IF UIC_GROUP <= 10% THEN! IF PRIVILEGED UIC GROUP: ! ----- DO NOT SKIP THIS USER ----- SKIP_THIS_USER = FALSE ELSE ! ----- ASSUME THIS USER IS SKIPPED ----- SKIP_THIS_USER = TRUE END IF ! ----- SKIP IF USER HAS NO PRIVS OTHER THAN ----- ! ----- GROUP, MOUNT, NETMBX, AND TMPMBX ----- FLAG = 0% ! SO LOOP WILL EXECUTE WHILE FLAG < MAX_PRIV AND SKIP_THIS_USER FLAG = FLAG + 1% ! ----- SKIP GROUP, MOUNT, NETMBX, AND ----- ! ----- TMPMBX PRIVILEGES ----- SELECT PRIV_DESC(FLAG) CASE "GROUP", "MOUNT", "NETMBX", "TMPMBX" ITERATE END SELECT ! ----- MAP TO REQUIRED BYTES ----- REMAP (UAF) & STRING FILL=PRIV_BYTE_OFF(FLAG),& A_BYTE, & STRING FILL=7%, & A_BYTE2 ! ----- MOVE BYTES TO LONGWORDS ----- MY_LONGWORD = A_BYTE MY_LONGWORD2 = A_BYTE2 ! ----- SEE IF EITHER AUTHORIZED OR ----- ! ----- DEFAULT PRIVILEGE BITS ARE SET ----- IF ((MY_LONGWORD OR MY_LONGWORD2) AND & 2% ^ PRIV_BIT_OFF(FLAG)) <> 0% THEN SKIP_THIS_USER = FALSE END IF NEXT ITERATE IF SKIP_THIS_USER GOTO END_PROGRAM IF CHECK_FOR_HEADINGS PRINT #10%, TRM$(USER_NAME); TAB(33%); FOR FLAG = 1% TO MAX_PRIV ! ----- MAP TO REQUIRED BYTES ----- REMAP (UAF) & STRING FILL=PRIV_BYTE_OFF(FLAG),& A_BYTE, & STRING FILL=7%, & A_BYTE2 ! ----- MOVE BYTES TO LONGWORDS ----- MY_LONGWORD = A_BYTE MY_LONGWORD2 = A_BYTE2 ! ----- SEE IF BOTH AUTHORIZED AND DEFAULT ----- ! ----- PRIVILEGE BITS ARE CLEAR ----- IF ((MY_LONGWORD OR MY_LONGWORD2) AND & 2% ^ PRIV_BIT_OFF(FLAG)) = 0% THEN PRINT #10%, " "; ELSE PRINT #10%, MID(PRINT_STRING, & FLAG, 1%) + " "; END IF NEXT FLAG ! ----- SEE IF THIS USERNAME HAS ANY PROXIES ----- IF READ_NETUAF(USER_NAME) = SUCCESS THEN PROXY_DESC = "*" ! USER HAS > 0 PROXIES ELSE PROXY_DESC = " " ! USER HAS NO PROXIES END IF IF UIC_GROUP <= 10% THEN! IF PRIVILEGED UIC GROUP: PRINT #10%, TAB(113%); "[" + & NUM1$(UIC_GROUP) + "," + & NUM1$(UIC_MEMBER) + "]"; & TAB(130%); PROXY_DESC ELSE PRINT #10%, TAB(130%); PROXY_DESC END IF LINE_COUNTER = LINE_COUNTER + 1% REPORT_RECORD_WRITTEN = TRUE CASE "I" ! NORMAL COMMAND FILE REPORT ! ----- INIT PRINT FLAGS ----- BIT_PRINT_CODE = 0% CHARS_WRITTEN = 0% USER_NAME_PRINTED = FALSE SEARCH_INDEX = 0% ! SO LOOP WILL WORK ! ----- FOR EACH FIELD TO ALSO PRINT ON THE REPORT ----- WHILE SEARCH_INDEX < REPORT_COUNTER SEARCH_INDEX = SEARCH_INDEX + 1% FIELD_INDEX = REPORT_INDEX(SEARCH_INDEX) ! ----- SKIP FIELD IF THIS FIELD SHOULD ----- ! ----- NOT APPEAR IN A COMMAND FILE ----- ITERATE IF FIELD_LENGTH(FIELD_INDEX) < 0% FIELD_LEN = FIELD_LENGTH(FIELD_INDEX) SELECT FIELD_TYPE(FIELD_INDEX) CASE "FLAGMENU" TEMP1 = FALSE BIT_PRINT_CODE = 1% FOR FLAG = 1% TO MAX_FLAG ITERATE IF (FLAGS( & FLAG_BYTE_OFF( & FLAG)) AND 2% ^ & FLAG_BIT_OFF(FLAG)) = 0% IF TEMP1 THEN TEMP = PRINT_MOD( & "," + & FLAG_DESC(FLAG)) ELSE TEMP = PRINT_MOD( & "/FLAG=(" & + & FLAG_DESC(FLAG)) TEMP1 = TRUE END IF NEXT FLAG TEMP = PRINT_MOD(")") IF TEMP1 BIT_PRINT_CODE = 0% CASE "ACCESSMENU" TEMP_STRING = DO_ACCESS(472) IF TEMP_STRING <> "" THEN TEMP = PRINT_MOD( & "/NETWORK=(" + & TEMP_STRING + ")") ELSE TEMP = PRINT_MOD("/NONETWORK") END IF TEMP_STRING = DO_ACCESS(478) IF TEMP_STRING <> "" THEN TEMP = PRINT_MOD( & "/BATCH=(" + & TEMP_STRING + ")") ELSE TEMP = PRINT_MOD("/NOBATCH") END IF TEMP_STRING = DO_ACCESS(484) IF TEMP_STRING <> "" THEN TEMP = PRINT_MOD( & "/LOCAL=(" + & TEMP_STRING + ")") ELSE TEMP = PRINT_MOD("/NOLOCAL") END IF TEMP_STRING = DO_ACCESS(490) IF TEMP_STRING <> "" THEN TEMP = PRINT_MOD( & "/DIALUP=(" + & TEMP_STRING + ")") ELSE TEMP = PRINT_MOD("/NODIALUP") END IF TEMP_STRING = DO_ACCESS(496) IF TEMP_STRING <> "" THEN TEMP = PRINT_MOD( & "/REMOTE=(" + & TEMP_STRING + ")") ELSE TEMP = PRINT_MOD("/NOREMOTE") END IF CASE "AUTHPRIVMENU" TEMP = DO_PRIVS_CMD(0%) CASE "DEFPRIVMENU" TEMP = DO_PRIVS_CMD(1%) CASE "QUOTA", "VALUE" SELECT FIELD_LEN CASE 1% ! BYTE ! ----- MAP TO BYTE VALUE ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_BYTE ! ----- MOVE BYTE TO ----- ! ----- LONGWORD ----- MY_LONGWORD = A_BYTE CASE 2% ! WORD ! ----- MAP TO WORD VALUE ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_WORD ! ----- MOVE WORD TO ----- ! ----- LONGWORD ----- MY_LONGWORD = A_WORD CASE 4% ! LONGWORD ! ----- MAP TO LONGWORD ----- ! ----- VALUE ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_LONGWORD ! ----- MOVE LONGWORD TO ----- ! ----- LONGWORD ----- MY_LONGWORD = A_LONGWORD CASE ELSE PRINT PRINT "Invalid" + & " FIELD_LENGTH("& + NUM1$( & FIELD_INDEX) + & "): " + NUM1$( & FIELD_LENGTH( & FIELD_INDEX)) + BEL CALL SYS$EXIT( & ERROR_NO_PUTMSG & BY VALUE) END SELECT SELECT FIELD_TYPE(FIELD_INDEX) CASE "QUOTA" TEMP = PRINT_MOD("/" + & FIELD_DESC( & FIELD_INDEX) + & "=" + NUM1$( & MY_LONGWORD)) CASE "VALUE" TEMP = PRINT_MOD( & "/" + & FIELD_CMD_FILE( & FIELD_INDEX) + & "=" + & NUM1$(MY_LONGWORD)) END SELECT CASE "CPUTIME" ! CPUTIME LIMIT TEMP_STRING = & NUM1$(CPUTIME_HOURS) + & ":" + & RJL0(CPUTIME_MINUTES, & 2%) + ":" + & RJL0(CPUTIME_SECONDS, & 2%) + "." + RJL0(CPUTIME, 2%) TEMP = PRINT_MOD("/CPUTIME=" + & TEMP_STRING) CASE "DATE" ! DATE ! ----- MAP TO QUADWORD DATE FIELD ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF( & FIELD_INDEX), & CLUNK_DATE1, & CLUNK_DATE2 ! ----- MOVE TO QUADWORD ARRAY ----- CLUNK_DATE(0%) = CLUNK_DATE1 CLUNK_DATE(1%) = CLUNK_DATE2 IF CLUNK_DATE(0%) <> 0% OR & CLUNK_DATE(1%) <> 0% THEN TEMP = PRINT_MOD( & "/" + & FIELD_CMD_FILE( & FIELD_INDEX) + & '="' + & FROM_CLUNKS_DMY + '"') END IF CASE "UIC" ! UIC TEMP = PRINT_MOD("/UIC=[" + & NUM1$(UIC_GROUP) + "," & + NUM1$(UIC_MEMBER) + "]") CASE "DELTA" ! DELTA PASSWORD LIFETIME SYS_STATUS = SYS$NUMTIM( & TIME_BUFFER() BY REF, & PASSWORD_LIFETIME() BY REF) CALL LIB$STOP(SYS_STATUS BY & VALUE) IF (SYS_STATUS & AND 1%) <> SS$_NORMAL IF PASSWORD_LIFETIME(0%) <> 0% & OR PASSWORD_LIFETIME(1%) <> 0% THEN TEMP = PRINT_MOD( & "/PWDLIFETIME=" & + NUM1$( & TIME_BUFFER(2%))) END IF CASE "PRIME" ! PRIMARY DAYS IF (PRIMEDAYS AND 1%) = 0% THEN TEMP_STRING = "MON" ELSE TEMP_STRING = "NOMON" END IF IF (PRIMEDAYS AND 2%) = 0% THEN TEMP_STRING = & TEMP_STRING + ",TUE" ELSE TEMP_STRING = & TEMP_STRING + ",NOTUE" END IF IF (PRIMEDAYS AND 4%) = 0% THEN TEMP_STRING = & TEMP_STRING + ",WED" ELSE TEMP_STRING = & TEMP_STRING + ",NOWED" END IF IF (PRIMEDAYS AND 8%) = 0% THEN TEMP_STRING = & TEMP_STRING + ",THU" ELSE TEMP_STRING = & TEMP_STRING + ",NOTHU" END IF IF (PRIMEDAYS AND 16%) = 0% THEN TEMP_STRING = & TEMP_STRING + ",FRI" ELSE TEMP_STRING = & TEMP_STRING + ",NOFRI" END IF IF (PRIMEDAYS AND 32%) = 0% THEN TEMP_STRING = & TEMP_STRING + ",SAT" ELSE TEMP_STRING = & TEMP_STRING + ",NOSAT" END IF IF (PRIMEDAYS AND 64%) = 0% THEN TEMP_STRING = & TEMP_STRING + ",SUN" ELSE TEMP_STRING = & TEMP_STRING + ",NOSUN" END IF ! ----- PRINT QUALIFIER IF ----- ! ----- ANYTHING OTHER THAN THE ----- ! ----- DEFAULT VALUES ----- IF TEMP_STRING <> & "MON,TUE,WED,THU,FRI,NOSAT,NOSUN" THEN TEMP = PRINT_MOD( & "/PRIMEDAYS=(" +& TEMP_STRING + ")") END IF CASE ELSE ! TEXT FIELDS ! ----- SEE IF COUNTED TEXT STRING ----- IF FIELD_BIT_OFF(FIELD_INDEX) <> 0% THEN ! ----- MAP TO COUNTED ----- ! ----- TEXT STRING ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_BYTE, & A_TEXT = A_BYTE ELSE ! ----- MAP TO STATIC ----- ! ----- TEXT STRING ----- REMAP (UAF) & STRING FILL = & FIELD_BYTE_OFF(& FIELD_INDEX), & A_TEXT = FIELD_LEN END IF TEMP_STRING = EDIT$(A_TEXT, 136%) TEMP = PRINT_MOD("/" + & FIELD_CMD_FILE( & FIELD_INDEX) + '="' + & TEMP_STRING + '"') & IF TEMP_STRING <> "" END SELECT NEXT ! ----- SEE IF SPECIAL CASE OF PRINTING NO FIELDS ----- IF REPORT_COUNTER = 0% THEN PRINT #10%, "MODIFY " + TRM$(USER_NAME) + "/" REPORT_RECORD_WRITTEN = TRUE END IF IF USER_NAME_PRINTED THEN REPORT_RECORD_WRITTEN = TRUE PRINT #10% ! END DETAIL LINE IF ANY OUTPUT END IF CASE "J" ! REVOKE/IDENTIFIER ident usern ! ----- REVOKE DESIRED HELD IDENTIFIERS ----- GOTO END_PROGRAM IF PRINT_IDENTIFIERS CASE "K" ! AUTHORIZE DUPLICATE COMMAND ! ----- USERNAME, UIC, OWNER ----- PRINT #10%, "ADD " + TRM$(USER_NAME) + "/UIC=[" & + NUM1$(UIC_GROUP) + "," + & NUM1$(UIC_MEMBER) + ']/OWNER="' + & TRM$(LEFT(OWNER_NAME, OWNER_NAME_LENGTH)) + '"' ! ----- DEFAULT DEVICE, DIRECTORY, MINIMUM ----- ! ----- PASSWORD LENGTH ----- DEVICE_SPEC = TRM$(LEFT(THE_DEVICE, DEVICE_LENGTH)) DIRECTORY_SPEC = TRM$(LEFT(DIRECTORY_NAME, & DIRECTORY_NAME_LENGTH)) IF DEVICE_SPEC <> "" THEN IF DIRECTORY_SPEC <> " " THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/DEVICE=" + & DEVICE_SPEC + & "/DIRECTORY=" + & DIRECTORY_SPEC + & "/PWDMINIMUM=" + & NUM1$(MINIMUM_PASSWORD_LENGTH) ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/DEVICE=" + & DEVICE_SPEC + & "/PWDMINIMUM=" + & NUM1$(MINIMUM_PASSWORD_LENGTH) END IF ELSE IF DIRECTORY_SPEC <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/DIRECTORY=" + & DIRECTORY_SPEC + & "/PWDMINIMUM=" + & NUM1$(MINIMUM_PASSWORD_LENGTH) ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/PWDMINIMUM=" + & NUM1$(MINIMUM_PASSWORD_LENGTH) END IF END IF ! ----- LOGIN COMMAND FILE ----- IF LEFT(LOGIN_COMMAND_FILE, & LOGIN_COMMAND_FILE_LENGTH) <> " " THEN PRINT #10%, "MODIFY " + TRM$(USER_NAME) & + "/LGICMD=" + & LEFT(LOGIN_COMMAND_FILE, & LOGIN_COMMAND_FILE_LENGTH) END IF ! ----- WSDEFAULT, WSQUOTA, WSEXTENT, ENQLM, FILLM ----- PRINT #10%, "MODIFY " + TRM$(USER_NAME) + & "/WSDEFAULT=" + NUM1$(WSDEFAULT) + & "/WSQUOTA=" + NUM1$(WSQUOTA) + & "/WSEXTENT=" + NUM1$(WSEXTENT) + & "/ENQLM=" + NUM1$(ENQLM) + & "/FILLM=" + NUM1$(FILLM) ! ----- PGFLQUOTA, BYTLM, ASTLM, BIOLM, DIOLM ----- PRINT #10%, "MODIFY " + TRM$(USER_NAME) + & "/PGFLQUOTA=" + NUM1$(PGFLQUOTA) + & "/BYTLM=" + NUM1$(BYTLM) + & "/ASTLM=" + NUM1$(ASTLM) + & "/BIOLM=" + NUM1$(BIOLM) + & "/DIOLM=" + NUM1$(DIOLM) ! ----- PRCLM, TQELM, MAXACCTJOBS, SHRFILLM, ----- ! ----- PBYTLM ----- PRINT #10%, "MODIFY " + TRM$(USER_NAME) + & "/PRCLM=" + NUM1$(PRCLM) + & "/TQELM=" + NUM1$(TQELM) + & "/MAXACCTJOBS=" + NUM1$(MAXACCTJOBS) + & "/SHRFILLM=" + NUM1$(SHRFILLM) + & "/PBYTLM=" + NUM1$(PBYTLM) ! ----- JTQUOTA, MAXDETACH, MAXJOBS, SHRFILLM ----- PRINT #10%, "MODIFY " + TRM$(USER_NAME) + & "/JTQUOTA=" + NUM1$(JTQUOTA) + & "/MAXDETACH=" + NUM1$(MAXDETACH) + & "/MAXJOBS=" + NUM1$(MAXJOBS) + & "/SHRFILLM=" + NUM1$(SHRFILLM) ! ----- CPUTIME, BASE PRIORITY ----- PRINT #10%, "MODIFY " + TRM$(USER_NAME) + & "/CPUTIME=" + NUM1$(CPUTIME_HOURS) + & ":" + RJL0(CPUTIME_MINUTES, 2%) + ":" + & RJL0(CPUTIME_SECONDS, 2%) + "." + & RJL0(CPUTIME, 2%) + "/PRIORITY=" + & NUM1$(BASE_PRIORITY) ! ----- CLI NAME ----- TEMP_STRING = TRM$(LEFT(CLI, CLI_LENGTH)) IF TEMP_STRING <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/CLI=" + TEMP_STRING END IF ! ----- CLI TABLES ----- TEMP_STRING = TRM$(LEFT(CLI_TABLES, CLI_TABLES_LENGTH)) IF TEMP_STRING <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/CLITABLES=" & + TEMP_STRING END IF ! ----- ACCOUNT NAME ----- IF TRM$(ACCOUNT_NAME) <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + '/ACCOUNT="' & + TRM$(ACCOUNT_NAME) + '"' END IF ! ----- PASSWORD LIFETIME ----- SYS_STATUS = SYS$NUMTIM(TIME_BUFFER() BY REF, & PASSWORD_LIFETIME() BY REF) CALL LIB$STOP(SYS_STATUS BY VALUE) & IF (SYS_STATUS AND 1%) = 0% IF PASSWORD_LIFETIME(0%) <> 0% & OR PASSWORD_LIFETIME(1%) <> 0% THEN PRINT #10%, "MODIFY " + TRM$(USER_NAME) & + "/PWDLIFETIME=" + & NUM1$(TIME_BUFFER(2%)) END IF ! ----- PRIMARY / SECONDARY DAYS ----- IF (PRIMEDAYS AND 1%) = 0% THEN TEMP_STRING = "MON" ELSE TEMP_STRING = "NOMON" END IF IF (PRIMEDAYS AND 2%) = 0% THEN TEMP_STRING = TEMP_STRING + ",TUE" ELSE TEMP_STRING = TEMP_STRING + ",NOTUE" END IF IF (PRIMEDAYS AND 4%) = 0% THEN TEMP_STRING = TEMP_STRING + ",WED" ELSE TEMP_STRING = TEMP_STRING + ",NOWED" END IF IF (PRIMEDAYS AND 8%) = 0% THEN TEMP_STRING = TEMP_STRING + ",THU" ELSE TEMP_STRING = TEMP_STRING + ",NOTHU" END IF IF (PRIMEDAYS AND 16%) = 0% THEN TEMP_STRING = TEMP_STRING + ",FRI" ELSE TEMP_STRING = TEMP_STRING + ",NOFRI" END IF IF (PRIMEDAYS AND 32%) = 0% THEN TEMP_STRING = TEMP_STRING + ",SAT" ELSE TEMP_STRING = TEMP_STRING + ",NOSAT" END IF IF (PRIMEDAYS AND 64%) = 0% THEN TEMP_STRING = TEMP_STRING + ",SUN" ELSE TEMP_STRING = TEMP_STRING + ",NOSUN" END IF ! ----- PRINT QUALIFIER IF ANYTHING OTHER THAN THE ----- ! ----- DEFAULT VALUES ----- IF TEMP_STRING <> "MON,TUE,WED,THU,FRI,NOSAT,NOSUN" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/PRIMEDAYS=(" + TEMP_STRING + ")" END IF ! ----- ACCOUNT EXPIRATION DATE ----- CLUNK_DATE(0%) = ACCOUNT_EXPIRATION_DATE(0%) CLUNK_DATE(1%) = ACCOUNT_EXPIRATION_DATE(1%) IF CLUNK_DATE(0%) <> 0% OR CLUNK_DATE(1%) <> 0% THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & '/EXPIRATION="' + FROM_CLUNKS_DMY + '"' END IF ! ----- ACCESS RESTRICTIONS ----- TEMP_STRING = DO_ACCESS(472) IF TEMP_STRING <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/NETWORK=(" + TEMP_STRING + ")" ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/NONETWORK" END IF TEMP_STRING = DO_ACCESS(478) IF TEMP_STRING <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/BATCH=(" + TEMP_STRING + ")" ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/NOBATCH" END IF TEMP_STRING = DO_ACCESS(484) IF TEMP_STRING <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/LOCAL=(" + TEMP_STRING + ")" ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/NOLOCAL" END IF TEMP_STRING = DO_ACCESS(490) IF TEMP_STRING <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/DIALUP=(" + TEMP_STRING + ")" ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/NODIALUP" END IF TEMP_STRING = DO_ACCESS(496) IF TEMP_STRING <> "" THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + & "/REMOTE=(" + TEMP_STRING + ")" ELSE PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/NOREMOTE" END IF ! ----- LOGIN FLAGS ----- TEMP = TRUE ! FALSE IF USERNAME PRINTED TEMP1 = FALSE ! TRUE IF MULTIPLE KEYWORDS TEMP2 = 0% ! COUNT OF KEYWORDS WRITTEN FOR FLAG = 1% TO MAX_FLAG IF FLAGS(FLAG_BYTE_OFF(FLAG)) AND & 2% ^ FLAG_BIT_OFF(FLAG) THEN ! ----- SEE IF USERNAME NOT YET ----- ! ----- PRINTED ----- IF TEMP THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) & + "/FLAGS=("; TEMP = FALSE END IF PRINT #10%, ","; IF TEMP1 PRINT #10%, FLAG_DESC(FLAG); TEMP1 = TRUE ! ----- INCREMENT COUNT OF ----- ! ----- KEYWORDS WRITTEN ----- TEMP2 = TEMP2 + 1% ! ----- NEW LINE IF 6 KEYWORDS ----- ! ----- WERE WRITTEN ----- IF TEMP2 = 6% THEN PRINT #10%, ")" ! ----- INIT USERNAME ----- ! ----- PRINTED FLAG ----- TEMP = TRUE ! ----- INIT MULTIPLE ----- ! ----- KEYWORDS FLAG ----- TEMP1 = FALSE ! ----- INIT COUNT OF ----- ! ----- KEYWORDS WRITTEN ----- TEMP2 = 0% END IF END IF NEXT FLAG PRINT #10%, ")" IF NOT TEMP ! ----- DEFAULT PRIVILEGES ----- TEMP = TRUE ! FALSE IF USERNAME PRINTED TEMP1 = FALSE ! TRUE IF MULTIPLE KEYWORDS TEMP2 = 0% ! COUNT OF KEYWORDS WRITTEN FOR FLAG = 1% TO MAX_PRIV ! ----- MAP TO REQUIRED BYTE ----- FILL_OFFSET = PRIV_BYTE_OFF(FLAG) + 8% REMAP (UAF) & STRING FILL = FILL_OFFSET, & A_BYTE ! ----- MOVE BYTE TO LONGWORD ----- MY_LONGWORD = A_BYTE ! ----- SEE IF PRIVILEGE BIT IS CLEAR ----- ITERATE IF (MY_LONGWORD AND 2% ^ & PRIV_BIT_OFF(FLAG)) = 0% ! ----- SEE IF USERNAME NOT YET PRINTED ----- IF TEMP THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/DEFPRIV=("; TEMP = FALSE END IF PRINT #10%, ","; IF TEMP1 PRINT #10%, PRIV_DESC(FLAG); TEMP1 = TRUE ! ----- INCREMENT COUNT OF KEYWORDS ----- ! ----- WRITTEN ----- TEMP2 = TEMP2 + 1% ! ----- NEW LINE IF 6 KEYWORDS WERE ----- ! ----- WRITTEN ----- IF TEMP2 = 6% THEN PRINT #10%, ")" ! ----- INIT USERNAME PRINTED FLAG ----- TEMP = TRUE ! ----- INIT MULTIPLE KEYWORDS ----- ! ----- FLAG ----- TEMP1 = FALSE ! ----- INIT COUNT OF KEYWORDS ----- ! ----- WRITTEN ----- TEMP2 = 0% END IF NEXT FLAG PRINT #10%, ")" IF NOT TEMP ! ----- AUTHORIZED PRIVILEGES ----- TEMP = TRUE ! FALSE IF USERNAME PRINTED TEMP1 = FALSE ! TRUE IF MULTIPLE KEYWORDS TEMP2 = 0% ! COUNT OF KEYWORDS WRITTEN FOR FLAG = 1% TO MAX_PRIV ! ----- MAP TO REQUIRED BYTE ----- FILL_OFFSET = PRIV_BYTE_OFF(FLAG) REMAP (UAF) & STRING FILL = FILL_OFFSET, & A_BYTE ! ----- MOVE BYTE TO LONGWORD ----- MY_LONGWORD = A_BYTE ! ----- SEE IF PRIVILEGE BIT IS CLEAR ----- ITERATE IF (MY_LONGWORD AND 2% ^ & PRIV_BIT_OFF(FLAG)) = 0% ! ----- SEE IF USERNAME NOT YET PRINTED ----- IF TEMP THEN PRINT #10%, "MODIFY " + & TRM$(USER_NAME) + "/PRIV=("; TEMP = FALSE END IF PRINT #10%, ","; IF TEMP1 PRINT #10%, PRIV_DESC(FLAG); TEMP1 = TRUE ! ----- INCREMENT COUNT OF KEYWORDS ----- ! ----- WRITTEN ----- TEMP2 = TEMP2 + 1% ! ----- NEW LINE IF 6 KEYWORDS WERE ----- ! ----- WRITTEN ----- IF TEMP2 = 6% THEN PRINT #10%, ")" ! ----- INIT USERNAME PRINTED FLAG ----- TEMP = TRUE ! ----- INIT MULTIPLE KEYWORDS ----- ! ----- FLAG ----- TEMP1 = FALSE ! ----- INIT COUNT OF KEYWORDS ----- ! ----- WRITTEN ----- TEMP2 = 0% END IF NEXT FLAG PRINT #10%, ")" IF NOT TEMP REPORT_RECORD_WRITTEN = TRUE ! ----- CREATE IDENTIFIERS ADD/GRANT COMMANDS ----- GOTO END_PROGRAM IF PRINT_IDENTIFIERS CASE "L" ! AUTHORIZE DUPLICATE PWD CMD PRINT #10%, TRM$(USER_NAME) REPORT_RECORD_WRITTEN = TRUE END SELECT NEXT ! ----- THE PROGRAM WILL BRANCH HERE UPON REACHING THE END OF FILE ----- ! ----- OF THE USER AUTHORIZATION FILE. ----- END_OF_FILE: ! ----- FINISH AUTHORIZE COMMAND FILE IF REQUIRED ----- IF COMMAND_FILE THEN SELECT REPORT_TYPE CASE "L" ! DUPLICATE PWD INFO ON NODE PRINT #10%, "$DONE: SET PROC/PRIV=('SAVE_PRIV')" CASE ELSE PRINT #10%, "$DONE: SET UIC 'SAVE_UIC'" PRINT #10%, "$SET PROC/PRIV=('SAVE_PRIV')" END SELECT END IF GOTO END_PROGRAM NO_UAF_FILE: OPENING_NETUAF_FLAG = 0% IF ERR = FILE_ATTRIBUTES_NOT_MATCHED THEN PRINT "Can't open " + SYSUAF_FILE_SPEC + & " due to non-matching file attributes" GOTO EXIT_PROGRAM END IF IF POS(SYSUAF_FILE_SPEC, "NETPROXY", 1%) <> 0% THEN SYSUAF_FILE_SPEC = "SYS$SYSTEM:NETUAF.DAT" GOTO TRY_TO_OPEN_NETUAF END IF PRINT "Can't find SYS$SYSTEM:NETPROXY.DAT or" + & " SYS$SYSTEM:NETUAF.DAT!" + BEL GOTO EXIT_PROGRAM NO_FILE: IF SAVE_ERROR = NO_SUCH_FILE THEN PRINT "Can't find SYS$SYSTEM:SYSUAF.DAT!" + BEL ELSE IF SAVE_ERROR = PROTECTION_VIOLATION THEN %IF %SWEAR = 1% %THEN PRINT RETURNED_USERNAME + & " - You ignorant slut!" + BEL PRINT SPACE$(LEN(RETURNED_USERNAME)) + & " You do not have privilege" & + " to open the SYSUAF Data File." %ELSE PRINT "You do not have privilege to" + & " open the SYSUAF Data File." %END %IF END IF END IF GOTO EXIT_PROGRAM ERROR_ROUTINE: SAVE_ERROR = ERR ! SAVE THE ERROR VALUE RESUME IF ERR = BUCKET_LOCKED ! TRAP IF BUCKET IS LOCKED IF ERR = END_OF_FILE THEN SELECT ERROR_CODE CASE 1% ERROR_CODE = 0% ! INIT ERROR POSITION VALUE RESUME GET_REPORT_TYPE CASE 2% ERROR_CODE = 0% ! INIT ERROR POSITION VALUE RESUME GET_REPORT_OPTIONS CASE 3% ERROR_CODE = 0% ! INIT ERROR POSITION VALUE SELECT REPORT_TYPE CASE "C" TO "H", "J" TO "L" ! ----- NON-USER-DEFINED REPORT ----- RESUME GET_REPORT_OPTIONS CASE ELSE RESUME GET_FIELD_SELECTION END SELECT CASE 4% ERROR_CODE = 0% ! INIT ERROR POSITION VALUE RESUME GET_SEARCH_FIELDS END SELECT RESUME END_OF_FILE END IF RESUME END_OF_FILE IF ERR = REC_NOT_FOUND RESUME NO_UAF_FILE IF OPENING_NETUAF_FLAG = 1% AND & SAVE_ERROR = NO_SUCH_FILE OR SAVE_ERROR = & FILE_ATTRIBUTES_NOT_MATCHED IF ERROR_LINE = "KILL SYSUAF.LIS" THEN ERROR_LINE = "AFTER KILL" PRINT "Error - No identifiers found!" + BEL RESUME EXIT_PROGRAM END IF IF ERROR_LINE = "KILL SYSUAF.COM" THEN ERROR_LINE = "AFTER KILL" PRINT "Error - No users were selected!" + BEL RESUME EXIT_PROGRAM END IF CLOSE #1%, 2%, 3%, 4%, 10% RESUME NO_FILE IF LEFT(ERROR_LINE, 15%) = " trying to open" PRINT "Unexpected error"; SAVE_ERROR; " after "; ERROR_LINE PRINT "DEBUG>TEMP="; TEMP PRINT "DEBUG>REPORT_TYPE="; REPORT_TYPE PRINT "DEBUG>REPORT_COUNTER="; REPORT_COUNTER PRINT "DEBUG>SEARCH_COUNTER="; SEARCH_COUNTER PRINT "DEBUG>SEARCH_INDEX="; SEARCH_INDEX PRINT "DEBUG>FIELD_INDEX="; FIELD_INDEX PRINT ERT$(SAVE_ERROR) ON ERROR GOTO 0 END_PROGRAM: ! ----- RESET TERMINAL WIDTH IF IT WAS CHANGED ----- IF TERMINAL_WIDTH_CHANGED THEN ! ----- SET THE TERMINAL WIDTH BACK TO 80 COLS ----- ! ----- ASSIGN AN I/O CHANNEL TO THE TERMINAL ----- SYS_STATUS = SYS$ASSIGN("TT", CHANNEL, , ) IF SYS_STATUS <> SS$_NORMAL THEN PRINT "Error from SYS$ASSIGN(3): " + & NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF IF CHANNEL = 0% THEN ! SAFETY NET PRINT "Error - No available I/O channel" + BEL CALL SYS$EXIT(ERROR_NO_PUTMSG BY VALUE) END IF ! ----- CHANGE SETUP MODE BACK TO 80 COLS ----- PRINT PRINT ESC + "[?3l" DATA_BUF(1%) = 80% ! STORE THE NEW TERMINAL WIDTH ! ----- SET TERMINAL STATUS ----- SYS_STATUS = SYS$QIOW(, ! EVENT FLAG & CHANNEL BY VALUE, ! I/O CHANNEL & IO$_SETMODE BY VALUE, ! FUNCTION CODE & IOSB() BY REF, ! I/O STATUS BLOCK & , ! AST ADDRESS & , ! AST PARAMETER & DATA_BUF() BY REF, ! TERMINAL DRIVER BUFFER& 12% BY VALUE, ! LENGTH OF TTDRV BUFF & , ! SPEED (N/A) & , ! FILL (N/A) & , ! PARITY (N/A) & ) ! (N/A) SYS_STATUS = IOSB(0%) IF SYS_STATUS = SS$_NORMAL IF (SYS_STATUS AND 1%) = 0% THEN PRINT "Error from SYS$QIOW(3): " + & NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF ! ----- DEASSIGN THE I/O CHANNEL ----- SYS_STATUS = SYS$DASSGN(CHANNEL BY VALUE) IF SYS_STATUS <> SS$_NORMAL THEN PRINT "Error from SYS$DASSGN(3): " + & NUM1$(SYS_STATUS) + BEL CALL LIB$STOP(SYS_STATUS BY VALUE) END IF END IF CLOSE #1%, 2%, 3%, 4%, 10% IF REPORT_OUTPUT = "F" THEN IF COMMAND_FILE THEN IF REPORT_RECORD_WRITTEN THEN PRINT "Created SYSUAF.COM" + BEL ELSE ERROR_LINE = "KILL SYSUAF.COM" KILL "SYSUAF.COM" ERROR_LINE = "AFTER KILL" PRINT "Error - No users were selected!" + BEL END IF ELSE IF REPORT_RECORD_WRITTEN THEN PRINT "Created SYSUAF.LIS" + BEL ELSE ERROR_LINE = "KILL SYSUAF.LIS" KILL "SYSUAF.LIS" ERROR_LINE = "AFTER KILL" PRINT "Error - No identifiers found!" + BEL END IF END IF ELSE PRINT PRINT "Done..." END IF EXIT_PROGRAM: END