%@language = "vbscript"%>
<%
Option Explicit
Response.Buffer = True
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
'****************************************************
'
' Name: register.asp
' Purpose: page to register for survey application
'
'
' Author: AdaCorp Software
' Date Written: 6/24/2002
' Modified:
'
' Changes:
'****************************************************
%>
<%
Dim intUserType
Dim strUsername
Dim strPassword
Dim strPasswordConfirm
Dim strFirstName
Dim strLastName
Dim strEmail
Dim strTitle
Dim strCompany
Dim strLocation
Dim strError
Dim strAction
Dim intUserIDOut
Dim strCustomField1
Dim strCustomField2
Dim strCustomField3
Dim strGUID
Dim strSQL
Dim rsResults
If SV_ALLOW_PUBLIC_REGISTRATION = False Then
Response.Redirect("index.asp?message=" & SV_MESSAGE_NO_PERMISSION)
End If
strAction = Request.Form("submit")
If strAction = "Add User" Then
'get all values from form post
strUsername = trim(Request.Form("username"))
strPassword = trim(Request.Form("password"))
strPasswordConfirm = trim(Request.Form("passwordConfirm"))
strFirstName = trim(Request.Form("firstName"))
strLastName = trim(Request.Form("lastName"))
strEmail = trim(Request.Form("email"))
strTitle = trim(Request.Form("title"))
strCompany = trim(Request.Form("company"))
strLocation = trim(Request.Form("location"))
strCustomField1 = trim(Request.Form("customField1"))
strCustomField2 = trim(Request.Form("customField2"))
strCustomField3 = trim(Request.Form("customField3"))
intUserType = SV_DEFAULT_USER_TYPE
'check required values
If strUsername = "" Then
strError = strError & "Username is required.
"
ElseIf user_usernameTaken(strUsername) = True Then
strError = strError & "Username is already taken.
"
End If
If strPassword = "" Then
strError = strError & "Password is required.
"
ElseIf strPasswordConfirm = "" Then
strError = strError & "You must confirm your password.
"
ElseIf strPassword <> strPasswordConfirm Then
strError = strError & "Your passwords do not match.
"
End If
If SV_EMAIL_REQUIRED = True Then
If strEmail = "" Then
strError = strError & "Email address is required.
"
ElseIf utility_isValidEmail(strEmail) = False Then
strError = strError & "Your email address is invalid.
"
End If
End If
'If no errors have been encountered
If strError = "" Then
Call user_addUser(strUsername, strPassword, intUserType, strFirstName, strLastName, _
strEmail, strTitle, strCompany, strLocation, SV_LOGIN_TYPE_PASSWORD, "", strCustomField1, strCustomField2, strCustomField3, intUserIDOut)
strGUID = utility_createGUID()
strSQL = "UPDATE s1_surveyUser SET userGUID = " & utility_SQLEncode(strGUID, True) &_
" WHERE userID = " & intUserIDOut
Call utility_executeCommand(strSQL)
Call user_setSessioninfo(intUserIDOut, intUserType, strUserName, SV_LOGIN_TYPE_PASSWORD, "true", strGUID)
Response.Redirect("index.asp?message=" & SV_MESSAGE_USER_ADDED)
End If
End If
%>
<%=header_htmlTop("white","")%>
<%=header_writeHeaderTop(0, "")%>
<%=header_writeSubMenuLogin("Login > Register")%>
<%=header_writeHeaderBottom()%>
Register
Fill out the fields below to register to use this survey system. Required fields are marked with a <%=common_requiredFlag()%>.