home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 March / CHIPCD_3_98.iso / software / testsoft / exchange / webdata / usa / finduser / fumsg.asp < prev    next >
Text File  |  1997-08-25  |  4KB  |  138 lines

  1. <!--#include file="../constant.inc" -->
  2. <!--#include file="../lib/session.inc" -->
  3. <!--#include file="../lib/getrend.inc" -->
  4. <!--#include file="../lib/jsutil.inc"-->
  5. <%
  6. '<!--Microsoft Outlook Web Access-->
  7. '<!--Find User fumsg.asp : Frame that lists results from find names search. -->
  8. '<!--Copyright (c) Microsoft Corporation 1993-1997. All rights reserved.-->
  9.  
  10. On Error Resume Next
  11.  
  12.  
  13. CheckSession2 bstrVirtRoot + "/finduser/root.asp"
  14. set objRenderApp = Application( bstrRenderApp )
  15. %>
  16. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
  17.  
  18. <HTML>
  19. <HEAD>
  20. </HEAD>
  21. <BODY TEXT=000000 BGCOLOR=ffffff LINK=000000 VLINK=FF0000 ALINK=000000 TOPMARGIN="0">
  22. <BASEFONT <%=bstrFace%> SIZE=2 COLOR=000000>
  23. <%
  24.     On Error Resume Next
  25.  
  26.     nPubLimit = objRenderApp.ConfigParameter("Publish GAL Limit")
  27.              
  28.     ' No limit enforced by DSA
  29.     If CStr(nPubLimit) = "" Then
  30.         nPubLimit = 9999
  31.     End If
  32.  
  33.  
  34.     If nPubLimit > 0 Then
  35.         strDisplayName = Request.Form("DN")
  36.         strFirstName = Request.Form("FN")
  37.         strLastName = Request.Form("LN")
  38.         strTitle = Request.Form("TL")
  39.         strAlias = Request.Form("AN")
  40.         strCompany = Request.Form("CP")
  41.         strDepartment = Request.Form("DP")
  42.         strOffice = Request.Form("OF")
  43.         strCity = Request.Form("CY")
  44.  
  45.         Set Hierarchy = objOMSession.AddressLists 
  46.  
  47.         ' make sure collection is valid 
  48.         If Hierarchy Is Nothing Then 
  49.             ReportError1 L_errAddrBookInvalid_ErrorMessage
  50.         End If 
  51.  
  52.         For i = 1 to  Hierarchy.Count
  53.             Set objAddressList = Hierarchy.Item(i)
  54.             If objAddressList.Fields(ActMsgPR_DISPLAY_TYPE) = ActMsgDT_GLOBAL then
  55.                 Err.Clear
  56.                 Exit For
  57.             End If
  58.         Next
  59.                 
  60.         If objAddressList Is Nothing Then 
  61.             ReportError1 L_errAddrBookInvalid_ErrorMessage
  62.         End If 
  63.  
  64.         
  65.         Set objAddrEntries = objAddressList.AddressEntries
  66.         If objAddrEntries Is Nothing or Err.Number <> 0 Then 
  67.             ReportError1 L_errAddrBookInvalid_ErrorMessage
  68.         End If 
  69.  
  70.         
  71.         Set objAEFilter = objAddrEntries.Filter
  72.         If objAEFilter Is Nothing or Err.Number <> 0 Then 
  73.             ReportError1 L_errAddrBookInvalid_ErrorMessage
  74.         End If 
  75.                 
  76.         
  77.         objAEFilter.Or = False
  78.  
  79.         If strDisplayName <> "" Then
  80.             objAEFilter.Fields.Add ActMsgPR_DISPLAY_NAME, strDisplayName
  81.         End If
  82.  
  83.         If strFirstName <> "" Then
  84.             objAEFilter.Fields.Add ActMsgPR_GIVEN_NAME, strFirstName
  85.         End If
  86.  
  87.         If strLastName <> "" Then
  88.             objAEFilter.Fields.Add ActMsgPR_SURNAME, strLastName
  89.         End If
  90.  
  91.         If strTitle <> "" Then
  92.             objAEFilter.Fields.Add ActMsgPR_TITLE, strTitle
  93.         End If
  94.  
  95.         If strAlias <> "" Then
  96.             objAEFilter.Fields.Add ActMsgPR_ACCOUNT, strAlias
  97.         End If
  98.  
  99.         If strCompany <> "" Then
  100.             objAEFilter.Fields.Add ActMsgPR_COMPANY_NAME, strCompany
  101.         End If
  102.  
  103.         If strDepartment <> "" Then
  104.             objAEFilter.Fields.Add ActMsgPR_DEPARTMENT_NAME, strDepartment
  105.         End If
  106.  
  107.         If strOffice <> "" Then
  108.             objAEFilter.Fields.Add ActMsgPR_OFFICE_LOCATION, strOffice
  109.         End If
  110.  
  111.         If strCity <> "" Then
  112.             objAEFilter.Fields.Add ActMsgPR_LOCALITY, strCity
  113.         End If
  114.  
  115.         If nPubLimit >= objAddrEntries.Count Then
  116.             If 1 > objAddrEntries.Count Then %>
  117. <strong>No entry found for this item!</strong><br><br>
  118. Check the details to your search and click 'Find' again.
  119.             <% Else 
  120.             Set objRender = GetAddressContainerRenderer
  121.             objRender.RowsPerPage = objAddrEntries.Count
  122.             objRender.DataSource = objAddrEntries
  123.             objRender.Render 1, 1, 0, Response
  124.             End If 
  125.         Else %>
  126. <strong>This query would return too many addresses!</strong><br>
  127. Please add more details to narrow your search and click 'Find' again.
  128.         <% End If %>
  129. </table>
  130.     <% Else %>
  131. <strong>No information is available.</strong><br>
  132. Contact your System Adminstrator for more information.
  133.     <% End If %>
  134. </FONT>
  135. </BODY>
  136. </HTML>
  137.  
  138.