% ' ' ' '------------------------------------------------------------------ Public Function HasFolderPermissions(objFolder) HasFolderPermissions = True bSrcCanMove=0 bSrcCanCopy=0 nAccess=0 nAccess = objFolder.Fields.Item(ActMsgPR_ACCESS) bSrcCanMove = nAccess And MAPI_ACCESS_DELETE bSrcCanCopy = nAccess And MAPI_ACCESS_READ If bSrcCanMove=0 And bSrcCanCopy=0 Then HasFolderPermissions=False End If End Function '-------------------------------------------------------------------- Public Sub InitThePage(nType) On Error Resume Next idestStore=nType If nType = PRIVATE_AUTHENTICATED Then OpenPrivateStore If bstrDestFolderID="" Then bstrDestFolderID=bstrPrivateRootID End If Set objFolder = OpenFolder(bstrDestFolderID) If objFolder Is Nothing Then ReportErro1 L_errFailOpenFolder_ErrorMessage End If ElseIf nType = PUBLIC_AUTHENTICATED Then OpenPublicStore If bstrDestFolderID="" Then bstrDestFolderID=bstrPublicRootID End If Set objFolder = OpenFolder(bstrDestFolderID) If objFolder Is Nothing Then ReportError1 L_errFailGetPubFolder_ErrorMessage End If End If If objFolder.Messages Is Nothing Then ReportError1 L_errFolderNotReplicated_ErrorMessage Else If nType=PUBLIC_AUTHENTICATED Then Set objRenderer = GetPublicHierarchyRenderer(fNew) Else Set objRenderer = GetPrivateHierarchyRenderer(fNew) End If Set objFolders = objFolder.Folders objRenderer.DataSource = objFolders End If End Sub '-------------------------------------------------------------------- Public Sub GetQueries() iProcess=CInt(Request.QueryString("process")) bstrStore=Request.QueryString("store") bstrSrcFolderID = Request.QueryString("folderid") bstrDestFolderID=Request.QueryString("obj") Set objSrcFolder=Session(CURRENT_FOLDER) If bstrStore<>"" Then idestStore=CInt(bstrStore) Else 'Called for the first time idestStore=PRIVATE_AUTHENTICATED End If InitThePage idestStore If iProcess="1" Then 'move/copy message bstrSrcMsgID = Request.QueryString("msgid") Else 'folder move/copy If IsSpecialFolder(bstrSrcFolderID) Then ReportErrorClose L_errFailMoveFolder_ErrorMessage End If End If End Sub '------------------------------------- Public Function IsSpecialFolder(szObj) IsSpecialFolder = False Set objStore = Session(bstrObjPrivateStore) If Not objStore Is Nothing Then If (szObj = objOMSession.Inbox.ID) Or _ (szObj = objStore.Fields.Item(ActMsgPR_IPM_OUTBOX_ENTRYID).Value) Or _ (szObj = objStore.Fields.Item(ActMsgPR_IPM_WASTEBASKET_ENTRYID).Value) Or _ (szObj = objStore.Fields.Item(ActMsgPR_IPM_SENTMAIL_ENTRYID).Value) Or _ (szObj = objStore.Fields.Item(ActMsgPR_IPM_SUBTREE_ENTRYID).Value) Then IsSpecialFolder = True End If End If End Function '------------------------------------- Public Function getRootID(nType) Dim objInfoStore If nType=PRIVATE_AUTHENTICATED Then szPrivateID = objOMSession.Inbox.StoreID Set objInfoStore = objOMSession.GetInfoStore(szPrivateID) getRootID = objInfoStore.RootFolder.ID Else Set objStores = objOMSession.InfoStores If (Err.Number <> 0) Then ReportError1 L_errFailGetStores_ErrorMessage Else For i = 1 To objStores.Count Set objInfoStore = objStores.Item(i) lMask = objInfoStore.Fields.Item(ActMsgPR_STORE_SUPPORT_MASK) Err.Clear If lMask And ActMsgSTORE_PUBLIC_FOLDERS Then ' STORE_PUBLIC_FOLDERS getRootID=objInfoStore.Fields.Item(ActMsgPR_IPM_PUBLIC_FOLDERS_ENTRYID).Value End If Next End If End If End Function '-------------------------------------------------------------------- 'Main routine '---------------------------------------------------------------------- On Error Resume Next CheckSession2 bstrVirtRoot+"/movcpy/root.asp" Dim objFolder 'Destination Folder Dim objSrcFolder 'Source Folder Dim objRenderer 'Renderer Dim iProcess 'Move or Copy Dim bstrSrcFolderID 'Source folder ID Dim bstrSrcMsgID 'Source message ID Dim idestStore 'Destination store (public or private) Dim bstrDestFolderID 'Destination folder ID Dim bstrPrivateRootID 'Private Root Folder ID Dim bstrPublicRootID 'Public Root Folder ID bstrPrivateRootID=getRootID(PRIVATE_AUTHENTICATED) bstrPublicRootID=getRootID(PUBLIC_AUTHENTICATED) GetQueries '-------------------------------------------------------------------------- %> <%If HasFolderPermissions(objSrcFolder)=true Then%>
onLoad="RedirectToRoot()"<% End If %>>