%
%>
<%
asp_include "include/siteusers_variables.asp",false
asp_header "Expires: Thu, 01 Jan 1970 00:00:01 GMT"
t_captcha = ""
email = ""
password = ""
userName = ""
doAssignmentByRef field,postvalue("field")
doAssignmentByRef val,postvalue("val")
if IsEqual(field,"UserName") then
doAssignment userName,val
else
if IsEqual(field,"Password") then
doAssignment password,val
else
if IsEqual(field,"UserEmailAddress") then
doAssignment email,val
else
if IsEqual(field,"captcha") then
doAssignment t_captcha,val
end if
end if
end if
end if
if bValue(asp_strlen(userName)) then
strSQL = "select count(*) from `siteusers` where `UserName`=" & CSmartStr(add_db_quotes("UserName",userName,""))
doAssignmentByRef rs,db_query(strSQL,conn)
doAssignmentByRef data,db_fetch_numarray(rs)
if IsLess(0,ArrayElement(data,0)) then
ResponseWrite (((CSmartStr("Username") & " ") & CSmartStr(userName)) & " ") & CSmartStr("already exists. Choose another username.")
end if
end if
if bValue(asp_strlen(email)) then
strSQL = "select count(*) from `siteusers` where `UserEmailAddress`=" & CSmartStr(add_db_quotes("UserEmailAddress",email,""))
doAssignmentByRef rs,db_query(strSQL,conn)
doAssignmentByRef data,db_fetch_numarray(rs)
if IsLess(0,ArrayElement(data,0)) then
ResponseWrite (((CSmartStr("Email") & " ") & CSmartStr(email)) & " ") & CSmartStr("already registered. If you forgot your username or password use the password reminder form.")
end if
end if
if bValue(asp_strlen(password)) and not bValue(checkpassword(password)) then
msg = ""
fmt = "Password must be at least %% characters length."
doAssignmentByRef fmt,asp_str_replace("%%","8",fmt)
msg = CSmartStr(msg) & ("
" & CSmartStr(fmt))
fmt = "Password must contain %% unique characters."
doAssignmentByRef fmt,asp_str_replace("%%","4",fmt)
msg = CSmartStr(msg) & ("
" & CSmartStr(fmt))
fmt = "Password must contain %% digits or symbols."
doAssignmentByRef fmt,asp_str_replace("%%","2",fmt)
msg = CSmartStr(msg) & ("
" & CSmartStr(fmt))
if bValue(msg) then
doAssignmentByRef msg,asp_substr(msg,4,empty)
end if
ResponseWrite msg
end if
%>