home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 March
/
CHIPCD_3_98.iso
/
software
/
testsoft
/
exchange
/
webdata
/
usa
/
movcpy
/
root.asp
< prev
Wrap
Text File
|
1997-08-25
|
9KB
|
252 lines
<!--#include file="../constant.inc"-->
<!--#include file="../lib/session.inc"-->
<!--#include file="../lib/getrend.inc"-->
<!--#include file="../lib/jsutil.inc"-->
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE><%=L_MoveCopy_StaticText%></TITLE>
<%
'<!-- Microsoft Outlook Web Access-->
'<!-- Root.asp : movecopy dialog -->
'<!-- Copyright (c) Microsoft Corporation 1993-1997. All rights reserved.-->
'------------------------------------------------------------------
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
'--------------------------------------------------------------------------
%>
<script language=javascript>
//"override" the function in jsroot.inc to redirect
function SetNewFolderPick(folderID) {
self.location="root.asp?store=<%=idestStore%>&process=<%=iProcess%>&folderid=<%=bstrSrcFolderID%>&msgid=<%=bstrSrcMsgID%>&obj="+folderID;
}
//populate the hidden form value depending on button clicked
function submitMe(item,process) {
self.document.mainForm.process.value=process;
self.document.mainForm.item.value=item;
self.document.mainForm.submit();
}
function changeStore(store) {
var rootID=""
if (store==0) rootID="<%=bstrPrivateRootID%>";
else rootID="<%=bstrPublicRootID%>";
self.location="root.asp?store="+store+ "&process=<%=iProcess%>&folderid=<%=bstrSrcFolderID%>&msgid=<%=bstrSrcMsgID%>&obj="+rootID;
}
</script>
</head>
<%If HasFolderPermissions(objSrcFolder)=true Then%>
<BODY bgcolor=#c0c0c0 text=000000 link=000000 vlink=000000 alink=000000 leftmargin=1 topmargin=0 <% If fDeleted = True Then %>onLoad="RedirectToRoot()"<% End If %>>
<form name="mainForm" action="commands.asp" METHOD="POST">
<table width=100%>
<tr>
<td>
<img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
<a href="javascript:changeStore(1);"><img src="<%=bstrVirtRoot%>/images/pubfoldr.gif" width=24 alt='Public Folders' height=24 align=middle border=0></a>
<img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
<a href="javascript:changeStore(0);"><img src="<%=bstrVirtRoot%>/images/prvfoldr.gif" alt='Private Folders' border=0 align=middle width=24 height=24></a>
<img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
<A href="JAVASCRIPT:openNewWindow('<%=bstrVirtRoot%>/help/readmsg.htm','inlineHelpWindow',600,400)"><IMG SRC="<%=bstrVirtRoot%>/images/help.gif" alt="<%=L_Help_ToolTip%>" align="middle" border=0 height=20 width=20></a>
<img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
</td>
<td align=right>
<input type="button" value="Close" onClick="self.close();">
</td>
</tr>
<tr>
<td valign=bottom>Folders:
</td>
</tr>
<tr>
<td width=75% valign=top bgcolor=#ffffff>
<% err.clear
objRenderer.Render AMHTML_FolderHierarchy, 0, 0, Response
%>
</td>
<td align=right valign=top>
<%If iProcess=1 Then 'Message%>
<input type="button" value="Move" onClick="submitMe('message','move');"><br><br>
<input type="button" value="Copy" onClick="submitMe('message','copy');"><br><br>
<%Else 'Folder%>
<input type="button" value="Move" onClick="submitMe('folder','move');"><br><br>
<input type="button" value="Copy" onClick="submitMe('folder','copy');"><br><br>
<%End If%>
</td>
</tr>
</table>
<input type="hidden" name="process" value="">
<input type="hidden" name="item" value="">
<input type="hidden" name="srcfolder" value="<%=bstrSrcFolderID%>">
<input type="hidden" name="destfolder" value="<%=bstrDestFolderID%>">
<input type="hidden" name="srcmsg" value="<%=bstrSrcMsgID%>">
</form>
</body>
</html>
<%Else 'No permissions to move%>
<body bgcolor=ffffff text=000000>
<br><br>
<font size=3><center><h3 align=center>Insufficient Access Permission</h3>
<blockquote>
<p>You don't have the necessary permissions to Move or Copy this item.
Please contact your Exchange Administrator if you feel this is incorrect.
</blockquote>
<br><footnote>
<a href="Javascript:self.close();">Close</a>
</footnote>
</center>
</body>
</html>
<% End If %>