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

XMXMBOX.m

Go to the documentation of this file.
  1. XMXMBOX ;ISC-SF/GMB-Mailbox APIs ;04/17/2002 14:10
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. QMBOX(XMDUZ,XMMSG) ; Message counts for a mailbox
  1. K XMERR,^TMP("XMERR",$J)
  1. S XMMSG=""
  1. I XMDUZ'=DUZ,'$$RPRIV^XMXSEC Q
  1. S XMMSG=$$NEWS^XMXUTIL(XMDUZ)
  1. Q
  1. FLTRMBOX(XMDUZ,XMMSG) ; Filter all the messages in a user's mailbox.
  1. K XMERR,^TMP("XMERR",$J)
  1. S XMMSG=""
  1. I XMDUZ'=DUZ,'$$RPRIV^XMXSEC Q
  1. N XMK
  1. S XMK=.99
  1. F S XMK=$O(^XMB(3.7,XMDUZ,2,XMK)) Q:XMK'>0!(XMDUZ=.5&(XMK>999)) D
  1. . D FLTRBSKT^XMXBSKT(XMDUZ,XMK)
  1. S XMMSG=$$EZBLD^DIALOG(34306.3) ; Mailbox filtered.
  1. Q
  1. CRE8MBOX(XMDUZ,XMDATE) ; Create a Mailbox for a user
  1. ; XMDUZ The user's DUZ
  1. ; XMDATE The user has been reinstated after not having worked here a
  1. ; while. Please note the earliest message date which the user
  1. ; may access, and don't let the user access any messages before
  1. ; that date, except for any which someone might forward to the
  1. ; user.
  1. ; =fileman date or any supported date format that FileMan
  1. ; recognizes (The date must be exact.)
  1. ; The user may not access any before this date.
  1. ; =0 - (default) The user may access any old msgs which had
  1. ; been addressed to the user.
  1. K XMERR,^TMP("XMERR",$J)
  1. ;I DUZ'=.5,'$$POSTPRIV^XMXSEC Q
  1. I '$D(^XMB(3.7,XMDUZ,0)) D
  1. . N XMFDA,XMIEN,XMTRIES
  1. . S XMFDA(3.7,"+1,",.01)=XMDUZ
  1. . S XMIEN(1)=XMDUZ
  1. CTRY . D UPDATE^DIE("S","XMFDA","XMIEN") Q:'$D(DIERR)
  1. . S XMTRIES=$G(XMTRIES)+1
  1. . I $D(^TMP("DIERR",$J,"E",110)) H 1 G CTRY ; Try again if can't lock
  1. D:'$D(^XMB(3.7,XMDUZ,2,.5,0)) MAKEBSKT^XMXBSKT(XMDUZ,.5,$$EZBLD^DIALOG(37004)) ; WASTE
  1. D:'$D(^XMB(3.7,XMDUZ,2,1,0)) MAKEBSKT^XMXBSKT(XMDUZ,1,$$EZBLD^DIALOG(37005)) ; IN
  1. ; Limit message access at reinstatement?
  1. Q:$G(XMDATE)=""!($G(XMDATE)=0)
  1. N XMFDA
  1. S XMFDA(3.7,XMDUZ_",",1.2)=XMDATE
  1. D FILE^DIE("E","XMFDA")
  1. Q
  1. TERMMBOX(XMDUZ) ; Terminate a user's Mailbox
  1. ; (Delete all traces of a user in MailMan)
  1. ; XMDUZ The user's DUZ
  1. K XMERR,^TMP("XMERR",$J)
  1. I DUZ'=.5,'$$POSTPRIV^XMXSEC Q
  1. D TERMINAT^XMUTERM1(XMDUZ)
  1. Q