! ----- DELETE_SYSUAF_RECORD.FUN ----- ! ! ----- FUNCTION TO DELETE THE SYSUAF RECORD FROM THE CURRENT ----- ! ----- (AND ALL DUPLICATE) NODE'S SYSUAF FILE ----- ! ! ----- Last Change 02/09/94 by Brian Lomasky ----- ! FUNCTION WORD DELETE_SYSUAF_RECORD %INCLUDE "NUSER.INC" DECLARE STRING CONSTANT SOMEONE_JUST_DELETED = & "Error - Someone just deleted this username from " DECLARE STRING A_NODE ! NODE TO COPY USER TO DECLARE STRING DEFAULT_NODE ! NULL STRING TO ACCESS DEFAULT DECLARE WORD I_O_CHNL_SYSUAF ! SYSUAF I/O CHANNEL TO ACCESS DECLARE WORD NODE_INDEX ! LIST OF NODES TO COPY USER DECLARE WORD RECORD_FOUND ! TRUE IF MATCHING RECORD FOUND DECLARE WORD SYSUAF_CHNL ! SYSUAF.DAT I/O CHANNEL TO USE EXTERNAL WORD FUNCTION CALC_DUPL_NODES( & STRING) ! RETURN LIST OF DUPL NODES DELETE_SYSUAF_RECORD = TRUE ! ASSUME ERROR STATUS ! ----- CALCULATE LIST OF DUPLICATE NODES TO DELETE THIS ----- ! ----- USER'S ACCOUNT FROM ----- DEFAULT_NODE = "" ! NULL STRING TO ACCESS DEFAULT EXIT FUNCTION IF CALC_DUPL_NODES(DEFAULT_NODE) ! ----- FOR EACH DUPLICATE NODE TO BE ACCESSED: ----- NODE_INDEX = 0% ! DELETE FROM LOCAL NODE (+ DUP) WHILE NODE_INDEX < NODES_IN_MEMORY NODE_INDEX = NODE_INDEX + 1% A_NODE = NODE_LISTS(NODE_INDEX) ! ----- FOR EACH POSSIBLE SYSUAF: ----- I_O_CHNL_SYSUAF = 0% ! ----- FOR EACH OPEN SYSUAF FILE: ----- WHILE I_O_CHNL_SYSUAF < SYSUAF_COUNTER I_O_CHNL_SYSUAF = I_O_CHNL_SYSUAF + 1% ! ----- SKIP IF SYSUAF UNAVAILABLE ----- ITERATE IF TRM$(SYSUAF_SPECS( & I_O_CHNL_SYSUAF)) = "" ! ----- SKIP IF UNDESIRED NODE ----- ITERATE IF A_NODE <> & TRM$(SYSUAF_NODES(I_O_CHNL_SYSUAF)) IF DEBUG_MODE THEN PRINT "DEBUG>Call " + & "DELETE_SYSUAF_RECORD" & + " for " + & TRM$(USER_NAME) + & " on node " + A_NODE END IF ! ----- CALCULATE THE REAL I/O CHANNEL ----- SYSUAF_CHNL = I_O_CHNL_SYSUAF + 49% ! ----- SKIP IF USER DOES NOT ALREADY ----- ! ----- EXIST ON THE DESIRED NODE ----- USER_NAME = ENTERED_USERNAME RECORD_FOUND = TRUE WHEN ERROR IN GET #SYSUAF_CHNL, KEY #0% EQ USER_NAME USE IF ERR = BUCKET_LOCKED THEN SLEEP 1% RETRY END IF IF ERR = REC_NOT_FOUND THEN RECORD_FOUND = FALSE CONTINUE END IF EXIT HANDLER END WHEN IF NOT RECORD_FOUND THEN UNLOCK #SYSUAF_CHNL IF NODES_IN_MEMORY = 1% THEN PRINT PRINT SOMEONE_JUST_DELETED + & A_NODE + BEL PRINT EXIT FUNCTION END IF ELSE ! ----- DELETE THIS USERNAME ----- ! ----- RECORD ----- DELETE #SYSUAF_CHNL UNLOCK #SYSUAF_CHNL PRINT "User " + & TRM$(ENTERED_USERNAME) & + " removed from " + & TRM$(A_NODE) + "..." END IF NEXT NEXT DELETE_SYSUAF_RECORD = FALSE ! RETURN SUCCESS STATUS END FUNCTION