<!--#Include file="adovbs.inc" -->
<%
Set fp_conn = Server.CreateObject("ADODB.Connection")
fp_conn.Open Application("facultyConnection_ConnectionString")
Dim rsUser, strSQL
Dim bAdmin, lngUserID
'Open a recordset containing the user with the current Logon name
Set rsUser = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tblUser WHERE fldLogonName = '" &
Session("strUserLogon") & "';"
rsUser.Open strSQL, fp_conn, adOpenDynamic, adLockOptimistic, adCmdText
'Check whether the current person logged into the intranet is an application
user
If Not rsUser.EOF Then
'Store useful variables
lngUserID = rsUser("fldUserID")
'Also check whether the current user has Admin priviledges
bAdmin = rsUser("fldAdmin")
Else
'If the user logon is not in the database, redirect to the intranet site
Response.Redirect "http://intranet.oznet.ksu.edu/agronomy/welcome.asp?error=NotFound"
End If
rsUser.Close
%>