XMXMBOX ;ISC-SF/GMB-Mailbox APIs ;04/17/2002 14:10
;;8.0;MailMan;;Jun 28, 2002
QMBOX(XMDUZ,XMMSG) ; Message counts for a mailbox
K XMERR,^TMP("XMERR",$J)
S XMMSG=""
I XMDUZ'=DUZ,'$$RPRIV^XMXSEC Q
S XMMSG=$$NEWS^XMXUTIL(XMDUZ)
Q
FLTRMBOX(XMDUZ,XMMSG) ; Filter all the messages in a user's mailbox.
K XMERR,^TMP("XMERR",$J)
S XMMSG=""
I XMDUZ'=DUZ,'$$RPRIV^XMXSEC Q
N XMK
S XMK=.99
F S XMK=$O(^XMB(3.7,XMDUZ,2,XMK)) Q:XMK'>0!(XMDUZ=.5&(XMK>999)) D
. D FLTRBSKT^XMXBSKT(XMDUZ,XMK)
S XMMSG=$$EZBLD^DIALOG(34306.3) ; Mailbox filtered.
Q
CRE8MBOX(XMDUZ,XMDATE) ; Create a Mailbox for a user
; XMDUZ The user's DUZ
; XMDATE The user has been reinstated after not having worked here a
; while. Please note the earliest message date which the user
; may access, and don't let the user access any messages before
; that date, except for any which someone might forward to the
; user.
; =fileman date or any supported date format that FileMan
; recognizes (The date must be exact.)
; The user may not access any before this date.
; =0 - (default) The user may access any old msgs which had
; been addressed to the user.
K XMERR,^TMP("XMERR",$J)
;I DUZ'=.5,'$$POSTPRIV^XMXSEC Q
I '$D(^XMB(3.7,XMDUZ,0)) D
. N XMFDA,XMIEN,XMTRIES
. S XMFDA(3.7,"+1,",.01)=XMDUZ
. S XMIEN(1)=XMDUZ
CTRY . D UPDATE^DIE("S","XMFDA","XMIEN") Q:'$D(DIERR)
. S XMTRIES=$G(XMTRIES)+1
. I $D(^TMP("DIERR",$J,"E",110)) H 1 G CTRY ; Try again if can't lock
D:'$D(^XMB(3.7,XMDUZ,2,.5,0)) MAKEBSKT^XMXBSKT(XMDUZ,.5,$$EZBLD^DIALOG(37004)) ; WASTE
D:'$D(^XMB(3.7,XMDUZ,2,1,0)) MAKEBSKT^XMXBSKT(XMDUZ,1,$$EZBLD^DIALOG(37005)) ; IN
; Limit message access at reinstatement?
Q:$G(XMDATE)=""!($G(XMDATE)=0)
N XMFDA
S XMFDA(3.7,XMDUZ_",",1.2)=XMDATE
D FILE^DIE("E","XMFDA")
Q
TERMMBOX(XMDUZ) ; Terminate a user's Mailbox
; (Delete all traces of a user in MailMan)
; XMDUZ The user's DUZ
K XMERR,^TMP("XMERR",$J)
I DUZ'=.5,'$$POSTPRIV^XMXSEC Q
D TERMINAT^XMUTERM1(XMDUZ)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMXMBOX 2111 printed Dec 13, 2024@02:14:14 Page 2
XMXMBOX ;ISC-SF/GMB-Mailbox APIs ;04/17/2002 14:10
+1 ;;8.0;MailMan;;Jun 28, 2002
QMBOX(XMDUZ,XMMSG) ; Message counts for a mailbox
+1 KILL XMERR,^TMP("XMERR",$JOB)
+2 SET XMMSG=""
+3 IF XMDUZ'=DUZ
IF '$$RPRIV^XMXSEC
QUIT
+4 SET XMMSG=$$NEWS^XMXUTIL(XMDUZ)
+5 QUIT
FLTRMBOX(XMDUZ,XMMSG) ; Filter all the messages in a user's mailbox.
+1 KILL XMERR,^TMP("XMERR",$JOB)
+2 SET XMMSG=""
+3 IF XMDUZ'=DUZ
IF '$$RPRIV^XMXSEC
QUIT
+4 NEW XMK
+5 SET XMK=.99
+6 FOR
SET XMK=$ORDER(^XMB(3.7,XMDUZ,2,XMK))
if XMK'>0!(XMDUZ=.5&(XMK>999))
QUIT
Begin DoDot:1
+7 DO FLTRBSKT^XMXBSKT(XMDUZ,XMK)
End DoDot:1
+8 ; Mailbox filtered.
SET XMMSG=$$EZBLD^DIALOG(34306.3)
+9 QUIT
CRE8MBOX(XMDUZ,XMDATE) ; Create a Mailbox for a user
+1 ; XMDUZ The user's DUZ
+2 ; XMDATE The user has been reinstated after not having worked here a
+3 ; while. Please note the earliest message date which the user
+4 ; may access, and don't let the user access any messages before
+5 ; that date, except for any which someone might forward to the
+6 ; user.
+7 ; =fileman date or any supported date format that FileMan
+8 ; recognizes (The date must be exact.)
+9 ; The user may not access any before this date.
+10 ; =0 - (default) The user may access any old msgs which had
+11 ; been addressed to the user.
+12 KILL XMERR,^TMP("XMERR",$JOB)
+13 ;I DUZ'=.5,'$$POSTPRIV^XMXSEC Q
+14 IF '$DATA(^XMB(3.7,XMDUZ,0))
Begin DoDot:1
+15 NEW XMFDA,XMIEN,XMTRIES
+16 SET XMFDA(3.7,"+1,",.01)=XMDUZ
+17 SET XMIEN(1)=XMDUZ
CTRY DO UPDATE^DIE("S","XMFDA","XMIEN")
if '$DATA(DIERR)
QUIT
+1 SET XMTRIES=$GET(XMTRIES)+1
+2 ; Try again if can't lock
IF $DATA(^TMP("DIERR",$JOB,"E",110))
HANG 1
GOTO CTRY
End DoDot:1
+3 ; WASTE
if '$DATA(^XMB(3.7,XMDUZ,2,.5,0))
DO MAKEBSKT^XMXBSKT(XMDUZ,.5,$$EZBLD^DIALOG(37004))
+4 ; IN
if '$DATA(^XMB(3.7,XMDUZ,2,1,0))
DO MAKEBSKT^XMXBSKT(XMDUZ,1,$$EZBLD^DIALOG(37005))
+5 ; Limit message access at reinstatement?
+6 if $GET(XMDATE)=""!($GET(XMDATE)=0)
QUIT
+7 NEW XMFDA
+8 SET XMFDA(3.7,XMDUZ_",",1.2)=XMDATE
+9 DO FILE^DIE("E","XMFDA")
+10 QUIT
TERMMBOX(XMDUZ) ; Terminate a user's Mailbox
+1 ; (Delete all traces of a user in MailMan)
+2 ; XMDUZ The user's DUZ
+3 KILL XMERR,^TMP("XMERR",$JOB)
+4 IF DUZ'=.5
IF '$$POSTPRIV^XMXSEC
QUIT
+5 DO TERMINAT^XMUTERM1(XMDUZ)
+6 QUIT