<!--#include file="session.inc"-->
<%
' Role Administrator Sample Application
' logon.asp
' Copyright (c) Microsoft Corporation 1993-1998. All rights reserved.
' ******************************************************************************
' This page presents the logon screen requiring the user to enter:
' Organization, Site, and Server information. If OWA is installed on this web
' server, the information from the registry is used.
' ******************************************************************************
On Error Resume Next
Response.Expires = 0
Dim strExchOrg ' Exchnage Organization Name
Dim strExchSite ' Exchange Site Name
Dim strExchServer ' Exchange Server Name
Dim objRenderApp ' AMHTML Rendering Object
Dim objIADs ' ADSI object
strExchServer = ""
' If Outlook Web Access is installed, it will read the Server settings from the registry.
Set objRenderApp = Server.CreateObject("AMHTML.Application")
If Err = 0 Then
' Load Registry Configuration Data
objRenderApp.LoadConfiguration 1, "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSExchangeWeb\Parameters"
If Err = 0 Then
strExchOrg = objRenderApp.ConfigParameter("Enterprise")
strExchSite = objRenderApp.ConfigParameter("Site")
strExchServer = objRenderApp.ConfigParameter("Server")
Else
' Failed to read registry
End If
Else
' Failed to create application object
End If
Err.Clear
' verify ADSI is installed
Set objIADs = GetObject("LDAP:")
If Err.Number <> 0 Then
displayError "Role Administrator will not work because ADSI 2.0 is not installed on this server.", 1, 0
Else
%>
<HTML>
<HEAD>
<TITLE>Role Administrator</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
function highlight(theform,a) {
if (a == 1) {
theform.Server.select();
};
if (a == 2) {
theform.O.select();
};
if (a == 3) {
theform.OU.select();
};
};
function validateLogon(theform) {
var isOK;
isOK = 1;
if (theform.Server.value.length == 0) {
alert("The server field must be non-blank.");
isOK = 0;
theform.Server.focus();
}
else {
if (theform.O.value.length == 0) {
alert("The Organization field must be non-blank.");
isOK = 0;
theform.O.focus();
}
else {
if (theform.OU.value.length == 0) {
alert("The Site field must be non-blank.");
isOK = 0;
theform.OU.focus();
};
};
};
// Did all fields check.
if (isOK == 1) {
window.location = "AMLogon.asp?Server=" + theform.Server.value + "&O=" + theform.O.value + "&OU=" + theform.OU.value;
};
};
</SCRIPT>
<BODY BACKGROUND="back.jpg" BGCOLOR="#FFFF99" TEXT="#000000" LINK="#000000" VLINK="#000000">
<FORM NAME="INFO" OnSubmit="return(false)">
<FONT FACE="Arial, Helvetica" SIZE=5><B>Role Administrator</B></FONT><BR><BR>
<TABLE>
<TR><TD ALIGN=RIGHT><FONT FACE="Arial, Helvetica" SIZE=2>Exchange Organization:</TD>
<TD><INPUT TYPE="text" NAME="O" VALUE="<%=strExchOrg%>" OnFocus="highlight(this.form,2)"></TD></TR>
<TR><TD ALIGN=RIGHT><FONT FACE="Arial, Helvetica" SIZE=2>Exchange Site:</TD>
<TD><INPUT TYPE="text" NAME="OU" VALUE="<%=strExchSite%>" OnFocus="highlight(this.form,3)"></TD></TR>
<TR><TD ALIGN=RIGHT><FONT FACE="Arial, Helvetica" SIZE=2>Exchange Server:</TD>
<TD><INPUT TYPE="text" NAME="Server" VALUE="<%=strExchServer%>" OnFocus="highlight(this.form,1)"></TD></TR>
</TABLE>
<BR>
<INPUT TYPE="button" VALUE="Continue" OnClick="validateLogon(this.form)">
</FORM>
</BODY>
</HTML>
<% End If %>