Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMUTERM

XMUTERM.m

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