%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
' Uses free AspTear
' Download AspTear to install on IIS server here:
' http://www.alphasierrapapa.com/iisdev/components/asptear/
' Already installed on IST-Prod6.nacs
' AspTear constants
Const Request_POST = 1
Const Request_GET = 2
' Variables used in this routine:
Dim strRetVal, strUrl
Dim strIDCookieVal
Dim arrRetVal, arrItem, arrGetVals
Dim strUciNetId, strUciNetIdAge, strUciNetICreated, strUciNetIdIdle, strUciNetIdCampus, strUciNetIdAuthFail
Dim strIDCookie
Dim objTear
' Create the AspTear object for getting info from login.uci.edu
Set objTear = Server.CreateObject("SOFTWING.ASPtear")
' Get the login cookie if it's there
strIDCookieVal = request.Cookies("ucinetid_auth")
' Setup the URL to "check" the login
strUrl = "http://login.uci.edu/ucinetid/webauth_check?ucinetid_auth=" & strIDCookieVal
' Actually go to the login page and get the results back
strRetVal = objTear.Retrieve(strUrl, Request_POST, "", "", "")
' Testing output for debugging
'Response.Write("strRetVal=" & strRetVal & "
")
' Parse thru the return string to determine the results
' The return string is a pair value string with line feed separators
arrRetVal = Split(strRetVal, vbLf)
For Each arrItem in arrRetVal
If (arrItem <> "") Then
arrGETVals = Split(arrItem, Chr(61))
If arrGetVals(0) = "ucinetid" Then
strUciNetId = arrGetVals(1)
ElseIf arrGetVals(0) = "age_in_seconds" Then
strUciNetIdAge = arrGetVals(1)
ElseIf arrGetVals(0) = "time_created" Then
strUciNetICreated = arrGetVals(1)
ElseIf arrGetVals(0) = "max_idle_time" Then
strUciNetIdIdle = arrGetVals(1)
ElseIf arrGetVals(0) = "campus_id" Then
strUciNetIdCampus = arrGetVals(1)
ElseIf arrGetVals(0) = "auth_fail" Then
strUciNetIdAuthFail = arrGetVals(1)
End If
End If
Next
' If no UCInetID is returned, then NOT logged in, Make em.
If (strUciNetId = "") Then
' This sends them to the NACS login page, more secure than using your own
Response.Redirect("https://login.uci.edu/ucinetid/webauth?return_url=http://www.campusrec.uci.edu/seantest/login.asp")
'Else
' Falls thru to page below if login was successful
' Or add your own redirect below to send them to the page of your choice
'Response.Redirect("http://www.campusrec.uci.edu/stepup/")
End If
%>
Here is the information about you that I got from Login: