Back to the Source Listing 

<%
'Developer: Angela Johnston
'Date: January 22, 2002
'
'CheckLogin.asp - This page receives information from welcome.asp on the intranet site.
' This page decides whether the person logged onto the intranet has permission to use
' the faculty database application.
'
'***************************************************************************************************************
'Included pages
' FacConn.inc - Checks whether the user has application priviledges
' formStyle.css - The style sheet for the Faculty Application
' adovbs.inc - A page usually included with ASP to make openning tables and running queries easier.
' It assigns names to numbers, so that you don't have to remember what each number means.
'
'QueryStrings (name - value)
' strUserLogon - the user logon name of the person logged onto the intranet site
'
'Recordsets (name - value)
' rsUser - (FacConn.inc) contains the current user logged on to the intranet (tblUser)
'
'Variables
' strSQL - (FacConn.inc) use to store the sql string for a query
' bAdmin - (FacConn.inc) boolean value, "True" if user is an Administrator, "False" if the user is not
' lngUserID - (FacConn.inc) the ID number for the current user
' strUserLogon - (FacConn.inc) the Logon Name for the current user
'
'Form Fields
' None
'
'***************************************************************************************************************
%>
<%
Session("strUserLogon") = Request("strUserLogon")
%>
<!--#include file="includes/FacConn.inc"-->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" type="text/css" href="includes/formStyle.css">
</head>
<body>
<%
'Open a recordset containing the user with the current Logon name
Set rsUser = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tblUser WHERE fldLogonName = '" & Request("strUserLogon") & "';"
rsUser.Open strSQL, fp_conn, adOpenDynamic, adLockOptimistic, adCmdText
If Not rsUser.EOF Then
 

'Set the users last login to the current date
rsUser("fldLastLogin") = Now
rsUser.Update
rsUser.Close
 
 

If bAdmin = "True" Then
'Redirect page to the Faculty Form Menu
Response.Redirect "facultyMenu.asp"
Else
'Redirect to the editPage
Response.Redirect "editPage.asp"
End If
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
 

%>
</body>
</html>