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

XMUTERM2.m

Go to the documentation of this file.
  1. XMUTERM2 ;ISC-SF/GMB-Delete Mailbox (cont.) ;04/17/2002 12:09
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ;
  1. ; The following are called from CHOOSE^XMUTERM
  1. ;
  1. MMCHOOSE(XMGRACE,XMCUTOFF) ;
  1. N XMI,XMABORT,XMTERM
  1. S (XMI,XMABORT)=0
  1. F S XMI=$O(^XMB(3.7,XMI)) Q:XMI'>0 D Q:XMABORT
  1. . D CHECK1^XMUTERM1(XMI,XMGRACE,XMCUTOFF,.XMTERM) I XMTERM D DELETE(XMI,.XMABORT) Q
  1. . D CHECK2^XMUTERM1(XMI,XMCUTOFF,.XMTERM) I XMTERM D DELETE(XMI,.XMABORT)
  1. Q
  1. ICHOOSE(XMGRACE,XMCUTOFF) ;
  1. F D Q:XMABORT
  1. . N DIC,Y
  1. . S DIC="^XMB(3.7,"
  1. . S DIC(0)="AEQM"
  1. . S DIC("S")="N XMTERM,XMFORGET D CHECK1^XMUTERM1(Y,XMGRACE,XMCUTOFF,.XMTERM),CHECK2^XMUTERM1(Y,XMCUTOFF,.XMFORGET) I XMTERM!XMFORGET"
  1. . W ! D ^DIC I Y=-1 S XMABORT=1 Q
  1. . D DELETE(+Y)
  1. Q
  1. DELETE(XMI,XMABORT) ;
  1. N XMREC1,XMREC2,XMDELETE
  1. S XMREC1=$G(^VA(200,XMI,0))
  1. I XMREC1'="" D Q:'XMDELETE
  1. . N DIR,Y
  1. . W !!,$$NAME^XMXUTIL(XMI)
  1. . W !,$$EZBLD^DIALOG(36336),$$EZBLD^DIALOG($S($P(XMREC1,U,3)="":36334,1:36335)) ; Access Code: NONE / <Hidden>
  1. . W ?25,$$EZBLD^DIALOG(36337),$$EZBLD^DIALOG($S($P($G(^VA(200,XMI,.1)),U,2)="":36334,1:36335)) ; Verify Code: NONE / <hidden>
  1. . W ?50,$$EZBLD^DIALOG(36338),$S($P($G(^VA(200,XMI,201)),U,1)="":$$EZBLD^DIALOG(36334),1:$P($G(^DIC(19,$P(^(201),U),0)),U)) ; Primary Menu: NONE / ...
  1. . W !,$$EZBLD^DIALOG(36339),$S($P($G(^VA(200,XMI,1)),U,7)="":$$EZBLD^DIALOG(36334),1:$$FMTE^XLFDT($P(^(1),U,7),"2D")) ; Date Entered: NONE / date
  1. . W ?25,$$EZBLD^DIALOG(36340),$S($P($G(^VA(200,XMI,1.1)),U,1)="":$$EZBLD^DIALOG(36334),1:$$FMTE^XLFDT($P(^(1.1),U,1),"2D")) ; Last Logon: NONE / date
  1. . W ?50,"DISUSER: ",$$EZBLD^DIALOG($S($P(XMREC1,U,7):39054,1:39053)) ; YES / NO
  1. . W !,$$EZBLD^DIALOG(36341),$S($P(XMREC1,U,11)="":$$EZBLD^DIALOG(36334),1:$$FMTE^XLFDT($P(XMREC1,U,11),"2D")) ; Term Date: NONE / date
  1. . W:$P(XMREC1,U,11) ?25,$$EZBLD^DIALOG(36342),$$EZBLD^DIALOG($S($P(XMREC1,U,5)="y":39054,1:39053)) ; Delete Mail: YES / NO
  1. . S XMREC2=^XMB(3.7,XMI,0)
  1. . W ?50,$$EZBLD^DIALOG(36343),$P(XMREC2,U,6) ; New Messages:
  1. . W !,$$EZBLD^DIALOG(38012),$S($P($G(^XMB(3.7,XMI,"L")),U)="":$$EZBLD^DIALOG(38002),1:$P(^("L"),U)) ; last used mailman: Never / date
  1. . W !,$$EZBLD^DIALOG(38004) ; Forwarding Address:
  1. . I $P(XMREC2,U,2)="" D
  1. . . W $$EZBLD^DIALOG(36334) ; NONE
  1. . E D
  1. . . W $P(XMREC2,U,2),$$EZBLD^DIALOG($S($P(XMREC2,U,8):38005,1:38006)) ; fwding addr, local deliver on/off
  1. . W !
  1. . S DIR(0)="Y"
  1. . S DIR("B")=$$EZBLD^DIALOG(39053) ; NO
  1. . S DIR("A")=$$EZBLD^DIALOG(36344) ; Delete this user's mailbox
  1. . D ^DIR I $D(DIRUT) S XMDELETE=0,XMABORT=1 Q
  1. . I 'Y S XMDELETE=0 Q
  1. . S XMDELETE=1
  1. N XMPARM
  1. S XMPARM(1)=XMI,XMPARM(2)=$S(XMREC1="":$$EZBLD^DIALOG(36346),1:$P(XMREC1,U)) ; * not in NEW PERSON file *
  1. W !,$$EZBLD^DIALOG(36345,.XMPARM) ; Deleting mailbox for user |1| |2|
  1. D TERMINAT^XMUTERM1(XMI)
  1. Q
  1. ;
  1. ; The following are called from TERMINAT^XMUTERM1
  1. ;
  1. GROUP(XMDUZ) ; Remove user from mail groups
  1. N XMI,XMJ,DIK,DA
  1. ; Remove user as member from all mail groups
  1. S XMI=0
  1. F S XMI=$O(^XMB(3.8,"AB",XMDUZ,XMI)) Q:XMI'>0 D
  1. . S DA(1)=XMI,DIK="^XMB(3.8,XMI,1,",XMJ=0
  1. . F S XMJ=$O(^XMB(3.8,"AB",XMDUZ,XMI,XMJ)) Q:XMJ'>0 S DA=XMJ D ^DIK
  1. K ^XMB(3.8,"AB",XMDUZ)
  1. ; Remove user as coordinator from all mail groups
  1. S XMI=0
  1. F S XMI=$O(^XMB(3.8,"AC",XMDUZ,XMI)) Q:XMI'>0 D
  1. . S XMFDA(3.8,XMI_",",5.1)=.5 ; (change coord to postmaster)
  1. . D FILE^DIE("","XMFDA")
  1. K ^XMB(3.8,"AC",XMDUZ)
  1. ; Remove user's personal mail groups, and
  1. ; remove user as organizer or authorized sender from all mail groups.
  1. S XMI=0
  1. F S XMI=$O(^XMB(3.8,XMI)) Q:XMI'>0 D
  1. . I +$G(^XMB(3.8,XMI,3))=XMDUZ D ; user is organizer
  1. . . I $P(^XMB(3.8,XMI,0),U,6)=1 S DA=XMI,DIK="^XMB(3.8," D ^DIK Q ; delete personal group
  1. . . S XMFDA(3.8,XMI_",",5)=.5 ; (change organizer to postmaster)
  1. . . D FILE^DIE("","XMFDA")
  1. . ; Remove user as authorized sender from all mail groups
  1. . Q:'$D(^XMB(3.8,XMI,4,"B",XMDUZ))
  1. . S DA=$O(^XMB(3.8,XMI,4,"B",XMDUZ,0))
  1. . I '$D(^XMB(3.8,XMI,4,DA,0)) K ^XMB(3.8,XMI,4,"B",XMDUZ) Q
  1. . S DA(1)=XMI,DIK="^XMB(3.8,XMI,4," D ^DIK
  1. Q
  1. SURROGAT(XMDUZ) ; Remove as mail surrogate
  1. N XMI,DA,DIK
  1. S XMI=0,DIK="^XMB(3.7,XMI,9,"
  1. F S XMI=$O(^XMB(3.7,"AB",XMDUZ,XMI)) Q:XMI'>0 D
  1. . S DA=$O(^XMB(3.7,"AB",XMDUZ,XMI,0))
  1. . I '$D(^XMB(3.7,XMI,9,DA,0)) K ^XMB(3.7,"AB",XMDUZ,XMI) Q
  1. . S DA(1)=XMI D ^DIK
  1. K ^XMB(3.7,"AB",XMDUZ)
  1. Q
  1. MAILBOX(XMDUZ) ; Remove user's mailbox
  1. Q:'$D(^XMB(3.7,XMDUZ))
  1. N DIK,DA
  1. S DIK="^XMB(3.7,",DA=XMDUZ D ^DIK
  1. K:$D(^XMB(3.7,XMDUZ)) ^XMB(3.7,XMDUZ) ; just in case!
  1. K:$D(^XMB(3.7,"B",XMDUZ)) ^XMB(3.7,"B",XMDUZ)
  1. Q
  1. LATERNEW(XMDUZ) ; Remove the scheduling of any messages slated to become new for this user
  1. N DIK,DA
  1. S DIK="^XMB(3.73,"
  1. S DA=""
  1. F S DA=$O(^XMB(3.73,"C",XMDUZ,DA)) Q:'DA D ^DIK
  1. Q
  1. LATERSND(XMDUZ) ; Remove the scheduling of any messages slated to be sent by this user.
  1. N XMZ,DIK,DA
  1. S XMZ=0
  1. F S XMZ=$O(^XMB(3.9,"AW",XMDUZ,XMZ)) Q:'XMZ D
  1. . S DA(1)=XMZ
  1. . S DIK="^XMB(3.9,"_DA(1)_",7,"
  1. . S DA=0
  1. . F S DA=$O(^XMB(3.9,"AW",XMDUZ,XMZ,DA)) Q:'DA D ^DIK
  1. Q