XMUTERM ;ISC-SF/GMB-Delete Mailbox/Delete Message ;04/17/2002 12:08
;;8.0;MailMan;;Jun 28, 2002
; Taken from XUSTERM (SEA/AMF/WDE)
; Entry points used by MailMan options (not covered by DBIA):
; ALL1 XMMGR-TERMINATE-MANY
; ALL2 XMMGR-TERMINATE-SUGGEST
; CHOOSE XMMGR-TERMINATE-ONE
; MESSAGE XMMGR-PURGE-MESSAGE
MESSAGE ; Manager chooses messages to purge
N DIR,XMABORT,XMZ,XMKILL,XMPARM
Q:$$NOTAUTH()
W @IOF
D BLD^DIALOG(36301,"","","","F")
D MSG^DIALOG("WM","",IOM)
;This option enables you to purge any message.
;Purge means:
;-delete the message from all user mailboxes
;-delete the message from the MESSAGE file ^XMB(3.9
;-delete all responses from the MESSAGE file ^XMB(3.9
;-delete the message from the MESSAGES TO BE NEW AT A LATER DATE file ^XMB(3.73
;Purge is not reversible. The message is gone forever.
F S XMZ=$O(^XMB(3.9,":"),-1) Q:XMZ?1N.N K ^XMB(3.9,XMZ) ; kill bogus nodes
S (XMABORT,XMKILL)=0
F D Q:XMABORT
. W !
. S DIR(0)="NO^1:"_$O(^XMB(3.9,":"),-1)_":0^D CHKMSG^XMUTERM(Y)",DIR("A")=$$EZBLD^DIALOG(36302) ; Purge MESSAGE
. S DIR("?")=$$EZBLD^DIALOG(36303) ; This response must be a message number
. D ^DIR K DIR I $D(DIRUT) S XMABORT=1 Q
. S XMZ=+Y
. S DIR(0)="Y",DIR("A")=$$EZBLD^DIALOG(36304),DIR("B")=$$EZBLD^DIALOG(39053) ; Are you sure / NO
. D ^DIR K DIR I 'Y!$D(DIRUT) W !,$$EZBLD^DIALOG(36305) Q ;Message not purged.
. S (XMKILL("MSG"),XMKILL("RESP"))=0
. D KILL^XMA32A(XMZ,.XMKILL,XMABORT)
. S XMPARM(1)=XMKILL("MSG"),XMPARM(2)=XMKILL("RESP")
. W !!,$$EZBLD^DIALOG(36306,.XMPARM) ; XMKILL("MSG") message and XMKILL("RESP") response(s) purged.
. S XMKILL=XMKILL+XMKILL("MSG")+XMKILL("RESP")
Q
CHKMSG(XMZ) ;
I '$D(^XMB(3.9,XMZ)) K X Q
W " ",$P($G(^XMB(3.9,XMZ,0)),U,1)
Q
ALL1 ; MailMan chooses users to remove from MailMan
; (Users who shouldn't have mailboxes.)
N XMTEST,DIR,XMABORT,XMCUTOFF,XMGRACE
Q:$$NOTAUTH()
S XMABORT=0
W @IOF
D BLD^DIALOG(36309,"","","","F")
;This option goes through the MailBox global and deletes the user's mailbox if
D HELP1
D BLD^DIALOG(36309.5,"","","","F")
;However, if the user meets one of the last two conditions above, but has a
;forwarding address, the user's mailbox will not be deleted. The fact will be
;noted, and the user should be investigated further.
;
D MSG^DIALOG("WM","",IOM)
D CUTOFF(1,.XMGRACE,.XMCUTOFF,.XMABORT) Q:XMABORT
S DIR(0)="SO^"_$$EZBLD^DIALOG(36321)_";"_$$EZBLD^DIALOG(36322) ; T:Test Mode only;R:Real Mode
S DIR("B")=$P($$EZBLD^DIALOG(36321),":",2) ; Test Mode only
S DIR("A")=$$EZBLD^DIALOG(36323) ; Select Run Option
D BLD^DIALOG(36324,"","","DIR(""?"")","F")
;'Real Mode' will remove qualifying users from MailMan.
;'Test Mode' will not.
;Select 'Test Mode' to see who would be removed.
;Select 'Real Mode' to remove them.
D ^DIR Q:$D(DIRUT)
S XMTEST=$S(X="R":0,1:1)
S (ZTSAVE("XMTEST"),ZTSAVE("XMCUTOFF"),ZTSAVE("XMGRACE"))=""
W !
D BLD^DIALOG(36325,"","","","F")
D MSG^DIALOG("WM","",IOM)
;This report may take a while. You might consider spooling it.
D EN^XUTMDEVQ("ALL1TASK^XMUTERM1",$$EZBLD^DIALOG(36326),.ZTSAVE) ; MailMan: Remove user Mailboxes
Q
ALL2 ; MailMan reports on users who maybe should be removed from MailMan
; (Users who haven't logged on in a while.)
N XMTEST,DIR,XMABORT,XMCUTOFF,XMGRACE
Q:$$NOTAUTH()
S XMABORT=0
W @IOF
D BLD^DIALOG(36312,"","","","F")
;This option goes through the MailBox global and reports if
D HELP2
D BLD^DIALOG(36314,"","","","F")
;This option does not delete any mailboxes. Use the XM-TERMINATE-ONE-USER
;option to delete any user mailboxes identified in this report.
D MSG^DIALOG("WM","",IOM)
D CUTOFF(2,.XMGRACE,.XMCUTOFF,.XMABORT) Q:XMABORT
S ZTSAVE("XMCUTOFF")=""
W !
D BLD^DIALOG(36325,"","","","F")
D MSG^DIALOG("WM","",IOM)
;This report may take a while. You might consider spooling it.
D EN^XUTMDEVQ("ALL2TASK^XMUTERM1",$$EZBLD^DIALOG(36327),.ZTSAVE) ; MailMan: Suggest Remove user Mailboxes
Q
NOTAUTH() ;
Q:$D(^XUSEC("XMMGR",DUZ)) 0
W !,$C(7)
D BLD^DIALOG(36300,"","","","F")
D MSG^DIALOG("WE","",IOM)
;You must hold the XMMGR key to run this option.
Q 1
HELP1 ;
D BLD^DIALOG(36311,"","","","SF")
;- the user is not in the NEW PERSON file.
;- the user has no access code and was not terminated.
;- the user has no access code and was terminated w/o mailbox retention.
;- the user has an access code, but no primary menu.
;- the user has an access code and primary menu, but no verify code AND
; - has never signed on or used mail, since being added before a cutoff date.
; OR
; - last signed on or used mail before a cutoff date.
;'Delete mailbox' includes:
;- Delete user's private mail groups
;- Remove user from membership in any group
;- Remove user as authorized sender from any group
;- Remove user from anyone's list of surrogates
;- Delete user's mailbox
;As a result, the user will not receive any mail.
Q
HELP2 ;
D BLD^DIALOG(36313,"","","","SF")
;- the user was DISUSER'd.
;- the user was terminated before a cutoff date and allowed to keep a mailbox.
;- the user has an access code, verify code, and primary menu, AND
; - has never signed on or used mail, since being added before a cutoff date.
; OR
; - last signed on or used mail before a cutoff date.
Q
CUTOFF(XMWHICH,XMGRACE,XMCUTOFF,XMABORT) ;
N DIR
W !
S XMGRACE=$$FMADD^XLFDT(DT,-30)
S DIR(0)="D^:"_XMGRACE_":EP"
S DIR("A")=$$EZBLD^DIALOG(36315) ; Logon cutoff date
S DIR("B")=$$FMTE^XLFDT(DT-10000)
S DIR("??")="^D HCUTOFF^XMUTERM(XMWHICH)"
D ^DIR I $D(DIRUT) S XMABORT=1 Q
S XMCUTOFF=Y
Q
HCUTOFF(XMWHICH) ;
D BLD^DIALOG(36316,"","","","F")
;The cutoff date must be more than 30 days ago.
;It is used during the check to see if
I XMWHICH="*"!(XMWHICH=1) D
. D BLD^DIALOG(36317,"","","","SF")
. ;- the user has an access code and primary menu, but no verify code, AND
. ; - has never signed on or used mail, since being added before a cutoff date.
. ; OR
. ; - last signed on or used mail before a cutoff date.
I XMWHICH="*"!(XMWHICH=2) D
. D BLD^DIALOG(36318,"","","","SF")
. ;- the user has an access code, verify code, and primary menu, AND
. ; - has never signed on or used mail, since being added before a cutoff date.
. ; OR
. ; - last signed on or used mail before a cutoff date.
D BLD^DIALOG(36319,"","","","F")
;(If you do not wish to check mailboxes based on a cutoff date, enter '1900'.)
;Please enter that cutoff date.
D MSG^DIALOG("WH","",IOM)
Q
CHOOSE ; Manager chooses user to remove from MailMan
N XMCUTOFF,XMABORT,XMI,XMGRACE
S XMABORT=0
Q:$$NOTAUTH()
W @IOF
D BLD^DIALOG(36310,"","","","F")
;This option lets you delete the mailbox of a user if
D HELP2
D HELP1
D MSG^DIALOG("WM","",IOM)
D CUTOFF("*",.XMGRACE,.XMCUTOFF,.XMABORT) Q:XMABORT
N DIR
S DIR(0)="SO^"_$$EZBLD^DIALOG(36330) ; M:MailMan presents;I:I select
D BLD^DIALOG(36332,"","","DIR(""?"")","F")
;Select 'M' if you want MailMan to $order through the MailBox file and
;present to you candidates for mailbox deletion.
;Select 'I' if you want to do the selection directly.
D ^DIR Q:$D(DIRUT)
I Y="M" D MMCHOOSE^XMUTERM2(XMGRACE,XMCUTOFF) Q
D ICHOOSE^XMUTERM2(XMGRACE,XMCUTOFF)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMUTERM 7363 printed Nov 22, 2024@17:23:52 Page 2
XMUTERM ;ISC-SF/GMB-Delete Mailbox/Delete Message ;04/17/2002 12:08
+1 ;;8.0;MailMan;;Jun 28, 2002
+2 ; Taken from XUSTERM (SEA/AMF/WDE)
+3 ; Entry points used by MailMan options (not covered by DBIA):
+4 ; ALL1 XMMGR-TERMINATE-MANY
+5 ; ALL2 XMMGR-TERMINATE-SUGGEST
+6 ; CHOOSE XMMGR-TERMINATE-ONE
+7 ; MESSAGE XMMGR-PURGE-MESSAGE
MESSAGE ; Manager chooses messages to purge
+1 NEW DIR,XMABORT,XMZ,XMKILL,XMPARM
+2 if $$NOTAUTH()
QUIT
+3 WRITE @IOF
+4 DO BLD^DIALOG(36301,"","","","F")
+5 DO MSG^DIALOG("WM","",IOM)
+6 ;This option enables you to purge any message.
+7 ;Purge means:
+8 ;-delete the message from all user mailboxes
+9 ;-delete the message from the MESSAGE file ^XMB(3.9
+10 ;-delete all responses from the MESSAGE file ^XMB(3.9
+11 ;-delete the message from the MESSAGES TO BE NEW AT A LATER DATE file ^XMB(3.73
+12 ;Purge is not reversible. The message is gone forever.
+13 ; kill bogus nodes
FOR
SET XMZ=$ORDER(^XMB(3.9,":"),-1)
if XMZ?1N.N
QUIT
KILL ^XMB(3.9,XMZ)
+14 SET (XMABORT,XMKILL)=0
+15 FOR
Begin DoDot:1
+16 WRITE !
+17 ; Purge MESSAGE
SET DIR(0)="NO^1:"_$ORDER(^XMB(3.9,":"),-1)_":0^D CHKMSG^XMUTERM(Y)"
SET DIR("A")=$$EZBLD^DIALOG(36302)
+18 ; This response must be a message number
SET DIR("?")=$$EZBLD^DIALOG(36303)
+19 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET XMABORT=1
QUIT
+20 SET XMZ=+Y
+21 ; Are you sure / NO
SET DIR(0)="Y"
SET DIR("A")=$$EZBLD^DIALOG(36304)
SET DIR("B")=$$EZBLD^DIALOG(39053)
+22 ;Message not purged.
DO ^DIR
KILL DIR
IF 'Y!$DATA(DIRUT)
WRITE !,$$EZBLD^DIALOG(36305)
QUIT
+23 SET (XMKILL("MSG"),XMKILL("RESP"))=0
+24 DO KILL^XMA32A(XMZ,.XMKILL,XMABORT)
+25 SET XMPARM(1)=XMKILL("MSG")
SET XMPARM(2)=XMKILL("RESP")
+26 ; XMKILL("MSG") message and XMKILL("RESP") response(s) purged.
WRITE !!,$$EZBLD^DIALOG(36306,.XMPARM)
+27 SET XMKILL=XMKILL+XMKILL("MSG")+XMKILL("RESP")
End DoDot:1
if XMABORT
QUIT
+28 QUIT
CHKMSG(XMZ) ;
+1 IF '$DATA(^XMB(3.9,XMZ))
KILL X
QUIT
+2 WRITE " ",$PIECE($GET(^XMB(3.9,XMZ,0)),U,1)
+3 QUIT
ALL1 ; MailMan chooses users to remove from MailMan
+1 ; (Users who shouldn't have mailboxes.)
+2 NEW XMTEST,DIR,XMABORT,XMCUTOFF,XMGRACE
+3 if $$NOTAUTH()
QUIT
+4 SET XMABORT=0
+5 WRITE @IOF
+6 DO BLD^DIALOG(36309,"","","","F")
+7 ;This option goes through the MailBox global and deletes the user's mailbox if
+8 DO HELP1
+9 DO BLD^DIALOG(36309.5,"","","","F")
+10 ;However, if the user meets one of the last two conditions above, but has a
+11 ;forwarding address, the user's mailbox will not be deleted. The fact will be
+12 ;noted, and the user should be investigated further.
+13 ;
+14 DO MSG^DIALOG("WM","",IOM)
+15 DO CUTOFF(1,.XMGRACE,.XMCUTOFF,.XMABORT)
if XMABORT
QUIT
+16 ; T:Test Mode only;R:Real Mode
SET DIR(0)="SO^"_$$EZBLD^DIALOG(36321)_";"_$$EZBLD^DIALOG(36322)
+17 ; Test Mode only
SET DIR("B")=$PIECE($$EZBLD^DIALOG(36321),":",2)
+18 ; Select Run Option
SET DIR("A")=$$EZBLD^DIALOG(36323)
+19 DO BLD^DIALOG(36324,"","","DIR(""?"")","F")
+20 ;'Real Mode' will remove qualifying users from MailMan.
+21 ;'Test Mode' will not.
+22 ;Select 'Test Mode' to see who would be removed.
+23 ;Select 'Real Mode' to remove them.
+24 DO ^DIR
if $DATA(DIRUT)
QUIT
+25 SET XMTEST=$SELECT(X="R":0,1:1)
+26 SET (ZTSAVE("XMTEST"),ZTSAVE("XMCUTOFF"),ZTSAVE("XMGRACE"))=""
+27 WRITE !
+28 DO BLD^DIALOG(36325,"","","","F")
+29 DO MSG^DIALOG("WM","",IOM)
+30 ;This report may take a while. You might consider spooling it.
+31 ; MailMan: Remove user Mailboxes
DO EN^XUTMDEVQ("ALL1TASK^XMUTERM1",$$EZBLD^DIALOG(36326),.ZTSAVE)
+32 QUIT
ALL2 ; MailMan reports on users who maybe should be removed from MailMan
+1 ; (Users who haven't logged on in a while.)
+2 NEW XMTEST,DIR,XMABORT,XMCUTOFF,XMGRACE
+3 if $$NOTAUTH()
QUIT
+4 SET XMABORT=0
+5 WRITE @IOF
+6 DO BLD^DIALOG(36312,"","","","F")
+7 ;This option goes through the MailBox global and reports if
+8 DO HELP2
+9 DO BLD^DIALOG(36314,"","","","F")
+10 ;This option does not delete any mailboxes. Use the XM-TERMINATE-ONE-USER
+11 ;option to delete any user mailboxes identified in this report.
+12 DO MSG^DIALOG("WM","",IOM)
+13 DO CUTOFF(2,.XMGRACE,.XMCUTOFF,.XMABORT)
if XMABORT
QUIT
+14 SET ZTSAVE("XMCUTOFF")=""
+15 WRITE !
+16 DO BLD^DIALOG(36325,"","","","F")
+17 DO MSG^DIALOG("WM","",IOM)
+18 ;This report may take a while. You might consider spooling it.
+19 ; MailMan: Suggest Remove user Mailboxes
DO EN^XUTMDEVQ("ALL2TASK^XMUTERM1",$$EZBLD^DIALOG(36327),.ZTSAVE)
+20 QUIT
NOTAUTH() ;
+1 if $DATA(^XUSEC("XMMGR",DUZ))
QUIT 0
+2 WRITE !,$CHAR(7)
+3 DO BLD^DIALOG(36300,"","","","F")
+4 DO MSG^DIALOG("WE","",IOM)
+5 ;You must hold the XMMGR key to run this option.
+6 QUIT 1
HELP1 ;
+1 DO BLD^DIALOG(36311,"","","","SF")
+2 ;- the user is not in the NEW PERSON file.
+3 ;- the user has no access code and was not terminated.
+4 ;- the user has no access code and was terminated w/o mailbox retention.
+5 ;- the user has an access code, but no primary menu.
+6 ;- the user has an access code and primary menu, but no verify code AND
+7 ; - has never signed on or used mail, since being added before a cutoff date.
+8 ; OR
+9 ; - last signed on or used mail before a cutoff date.
+10 ;'Delete mailbox' includes:
+11 ;- Delete user's private mail groups
+12 ;- Remove user from membership in any group
+13 ;- Remove user as authorized sender from any group
+14 ;- Remove user from anyone's list of surrogates
+15 ;- Delete user's mailbox
+16 ;As a result, the user will not receive any mail.
+17 QUIT
HELP2 ;
+1 DO BLD^DIALOG(36313,"","","","SF")
+2 ;- the user was DISUSER'd.
+3 ;- the user was terminated before a cutoff date and allowed to keep a mailbox.
+4 ;- the user has an access code, verify code, and primary menu, AND
+5 ; - has never signed on or used mail, since being added before a cutoff date.
+6 ; OR
+7 ; - last signed on or used mail before a cutoff date.
+8 QUIT
CUTOFF(XMWHICH,XMGRACE,XMCUTOFF,XMABORT) ;
+1 NEW DIR
+2 WRITE !
+3 SET XMGRACE=$$FMADD^XLFDT(DT,-30)
+4 SET DIR(0)="D^:"_XMGRACE_":EP"
+5 ; Logon cutoff date
SET DIR("A")=$$EZBLD^DIALOG(36315)
+6 SET DIR("B")=$$FMTE^XLFDT(DT-10000)
+7 SET DIR("??")="^D HCUTOFF^XMUTERM(XMWHICH)"
+8 DO ^DIR
IF $DATA(DIRUT)
SET XMABORT=1
QUIT
+9 SET XMCUTOFF=Y
+10 QUIT
HCUTOFF(XMWHICH) ;
+1 DO BLD^DIALOG(36316,"","","","F")
+2 ;The cutoff date must be more than 30 days ago.
+3 ;It is used during the check to see if
+4 IF XMWHICH="*"!(XMWHICH=1)
Begin DoDot:1
+5 DO BLD^DIALOG(36317,"","","","SF")
+6 ;- the user has an access code and primary menu, but no verify code, AND
+7 ; - has never signed on or used mail, since being added before a cutoff date.
+8 ; OR
+9 ; - last signed on or used mail before a cutoff date.
End DoDot:1
+10 IF XMWHICH="*"!(XMWHICH=2)
Begin DoDot:1
+11 DO BLD^DIALOG(36318,"","","","SF")
+12 ;- the user has an access code, verify code, and primary menu, AND
+13 ; - has never signed on or used mail, since being added before a cutoff date.
+14 ; OR
+15 ; - last signed on or used mail before a cutoff date.
End DoDot:1
+16 DO BLD^DIALOG(36319,"","","","F")
+17 ;(If you do not wish to check mailboxes based on a cutoff date, enter '1900'.)
+18 ;Please enter that cutoff date.
+19 DO MSG^DIALOG("WH","",IOM)
+20 QUIT
CHOOSE ; Manager chooses user to remove from MailMan
+1 NEW XMCUTOFF,XMABORT,XMI,XMGRACE
+2 SET XMABORT=0
+3 if $$NOTAUTH()
QUIT
+4 WRITE @IOF
+5 DO BLD^DIALOG(36310,"","","","F")
+6 ;This option lets you delete the mailbox of a user if
+7 DO HELP2
+8 DO HELP1
+9 DO MSG^DIALOG("WM","",IOM)
+10 DO CUTOFF("*",.XMGRACE,.XMCUTOFF,.XMABORT)
if XMABORT
QUIT
+11 NEW DIR
+12 ; M:MailMan presents;I:I select
SET DIR(0)="SO^"_$$EZBLD^DIALOG(36330)
+13 DO BLD^DIALOG(36332,"","","DIR(""?"")","F")
+14 ;Select 'M' if you want MailMan to $order through the MailBox file and
+15 ;present to you candidates for mailbox deletion.
+16 ;Select 'I' if you want to do the selection directly.
+17 DO ^DIR
if $DATA(DIRUT)
QUIT
+18 IF Y="M"
DO MMCHOOSE^XMUTERM2(XMGRACE,XMCUTOFF)
QUIT
+19 DO ICHOOSE^XMUTERM2(XMGRACE,XMCUTOFF)
+20 QUIT