XUFILE1 ;SF/XAK - ASSIGN & DELETE FILE ACCESS ;1/25/93 11:42 ;12/2/91 1:17 PM [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
;;8.0;KERNEL;;Jul 10, 1995
DELF ;
S DIC=$S(DUZ(0)="@":"^DIC(",1:"^VA(200,DUZ,""FOF"","),DIC(0)="QEAM"
S DIC("A")="Select FILE to delete all access from: " D ^DIC G KIL:Y<0 K DIC
DF S %=2 W !,"Are you sure you want to delete all access to the "_$P(Y,U,2)_" file"
D YN^DICN G KIL:%<0!(%=2)
I '% W !!?5,"Answer YES to delete all access, or NO to leave things as they are.",! G DF
S ZTRTN="DQ^XUFILE1",ZTSAVE("XUW")=+Y
S ZTDESC="Delete all Access to the "_$P(Y,U,2)_" file.",ZTIO="",ZTDTH=$H
D ^%ZTLOAD W !,"Request Queued" G KIL
DQ F DA(1)=0:0 S DA(1)=$O(^VA(200,"AFOF",XUW,DA(1))) Q:DA(1)'>0 S DA=XUW,DIK="^VA(200,"_DA(1)_",""FOF""," D ^DIK
G KIL
DELI ;
S DIC("A")="Select USER whose Access you want to remove: "
S DIC("S")="I $O(^VA(200,Y,""FOF"",0))>0"
S DIC=200,DIC(0)="QEAM" D ^DIC G KIL:Y<0 S DA(1)=+Y K DIC
D1 S %=2 W !,"Are you sure you want to remove all of "_$P(Y,U,2)_"'s access"
D YN^DICN G KIL:%<0!(%=2)
I '% W !!?5,"Answer YES to delete all access, or NO to leave things as they are.",! G D1
S ZTRTN="D2^XUFILE1",ZTSAVE("DA(")=""
S ZTDESC="Delete all Access to Files for one user",ZTIO="",ZTDTH=$H
D ^%ZTLOAD W !,"Request Queued" G KIL
D2 S DIK="^VA(200,"_DA(1)_",""FOF"","
F DA=0:0 S DA=$O(^VA(200,DA(1),"FOF",DA)) Q:DA'>0 D ^DIK
KIL G KIL^XUFILE
;
ACC D L^DICRW1 Q:X'>0!($D(DTOUT)) S L=0,BY="[XUFILE BY FILE NUMBER]",FR=X,TO=DIB(1),FLDS="[XUFILE ACCESS ABBREVIATED]",DIC="^VA(200," K DIB D EN1^DIP G KIL
XUFILE1 ;SF/XAK - ASSIGN & DELETE FILE ACCESS ;1/25/93 11:42 ;12/2/91 1:17 PM [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
+2 ;;8.0;KERNEL;;Jul 10, 1995
DELF ;
+1 SET DIC=$SELECT(DUZ(0)="@":"^DIC(",1:"^VA(200,DUZ,""FOF"",")
SET DIC(0)="QEAM"
+2 SET DIC("A")="Select FILE to delete all access from: "
DO ^DIC
IF Y<0
GOTO KIL
KILL DIC
DF SET %=2
WRITE !,"Are you sure you want to delete all access to the "_$PIECE(Y,U,2)_" file"
+1 DO YN^DICN
IF %<0!(%=2)
GOTO KIL
+2 IF '%
WRITE !!?5,"Answer YES to delete all access, or NO to leave things as they are.",!
GOTO DF
+3 SET ZTRTN="DQ^XUFILE1"
SET ZTSAVE("XUW")=+Y
+4 SET ZTDESC="Delete all Access to the "_$PIECE(Y,U,2)_" file."
SET ZTIO=""
SET ZTDTH=$HOROLOG
+5 DO ^%ZTLOAD
WRITE !,"Request Queued"
GOTO KIL
DQ FOR DA(1)=0:0
SET DA(1)=$ORDER(^VA(200,"AFOF",XUW,DA(1)))
IF DA(1)'>0
QUIT
SET DA=XUW
SET DIK="^VA(200,"_DA(1)_",""FOF"","
DO ^DIK
+1 GOTO KIL
DELI ;
+1 SET DIC("A")="Select USER whose Access you want to remove: "
+2 SET DIC("S")="I $O(^VA(200,Y,""FOF"",0))>0"
+3 SET DIC=200
SET DIC(0)="QEAM"
DO ^DIC
IF Y<0
GOTO KIL
SET DA(1)=+Y
KILL DIC
D1 SET %=2
WRITE !,"Are you sure you want to remove all of "_$PIECE(Y,U,2)_"'s access"
+1 DO YN^DICN
IF %<0!(%=2)
GOTO KIL
+2 IF '%
WRITE !!?5,"Answer YES to delete all access, or NO to leave things as they are.",!
GOTO D1
+3 SET ZTRTN="D2^XUFILE1"
SET ZTSAVE("DA(")=""
+4 SET ZTDESC="Delete all Access to Files for one user"
SET ZTIO=""
SET ZTDTH=$HOROLOG
+5 DO ^%ZTLOAD
WRITE !,"Request Queued"
GOTO KIL
D2 SET DIK="^VA(200,"_DA(1)_",""FOF"","
+1 FOR DA=0:0
SET DA=$ORDER(^VA(200,DA(1),"FOF",DA))
IF DA'>0
QUIT
DO ^DIK
KIL GOTO KIL^XUFILE
+1 ;
ACC DO L^DICRW1
IF X'>0!($DATA(DTOUT))
QUIT
SET L=0
SET BY="[XUFILE BY FILE NUMBER]"
SET FR=X
SET TO=DIB(1)
SET FLDS="[XUFILE ACCESS ABBREVIATED]"
SET DIC="^VA(200,"
KILL DIB
DO EN1^DIP
GOTO KIL