% '*********************************************************** ' Modified : Rajiv Lodha ' Date : 06, June, 2006 ' Purpose : Zipcode fix ' Desc : Regular Expression changed '*********************************************************** Dim sError,strErrorText strErrorText = "" If lCase(Request("submit")) = "submit" then If Not Request.TotalBytes <= 108 Then If Request.Form("agree") = "on" Then Call MakePageHeader("Processing your request","Attention!!") Call AddNewUser() Else Call MakePageHeader("Registration Process encountered an error","Register with MyRemoteIP.com") strErrorText = "ERROR : You are required to agree with our terms & conditions" ShowRegForm End If Else Call MakePageHeader("Registration Process encountered an error","Register with MyRemoteIP.com") strErrorText = "ERROR : The form was not filled properly, some of the required information were missing." Call ShowRegForm() End If Else Call ClearSession() If Not Request.QueryString = "edit" Then Call MakePageHeader("Register with MyRemoteIP.com","Register with MyRemoteIP.com") Else Call MakePageHeader("Member Profile : " & Session("user_name"),"Member Profile : " & Session("user_name")) End If Call ShowRegForm() End If %> <% '************************************************************************************************************ 'ShowRegForm '************************************************************************************************************ ' Function ShowRegForm() If Request.QueryString = "edit" and Session("user_loggedin") Then Call conOpen sSQL = "SELECT * FROM `myip_users` where `user_id` = " & Session("user_id") Set pRS = oConn.Execute ( sSQL ) If Not ( pRS.EOF And pRS.BOF ) Then Session("email") = Trim(REDOSQL(pRS("user_email"))) Session("pass") = ReverseString(Trim(REDOSQL(pRS("user_password")))) Session("confirm") = Session("pass") Session("fname") = Split(Trim(REDOSQL(pRS("user_name").value))," ")(0) if InStr (1,pRS("user_name").value," ", vbTextCompare) > 0 Then Session("lname") = Split(Trim(REDOSQL(pRS("user_name").value)), " ")(1) Else Session("lname") = " " End If Session("add1") = Split(Trim(REDOSQL(pRS("user_address"))),"||")(0) IF InStr(1,pRS("user_address"),"||",vbTextCompare) Then Session("add2") = Split(Trim(REDOSQL(pRS("user_address"))),"||")(1) Else Session("add2") = "" End If Session("city") = Trim(REDOSQL(pRS("user_city").value)) Session("state") = Trim(REDOSQL(pRS("user_state").value)) Session("country") = Trim(REDOSQL(pRS("user_country").value)) Session("zip") = Trim(REDOSQL(pRS("user_zip").value)) Session("phone") = Trim(REDOSQL(pRS("user_phone").value)) Session("fax") = Trim(REDOSQL(pRS("user_fax").value)) Session("cell") = Trim(REDOSQL(pRS("user_mobile").value)) Session("secq") = pRS("user_secqst").value Session("seca") = pRS("user_secans").value 'hide these Session("utl") = pRS("user_trial").value Session("uvc") = pRS("user_verify_code").value Session("uvr") = pRS("user_verified").value Session("uav") = pRS("user_active").value Session("uam") = pRS("user_admin").value Session("uip") = pRS("user_ipaddress").value Session("upk") = pRS("user_package").value Session("user_datetime")= pRS("user_registered").value Session("paid_for") = pRS("paid_for").value Else Session("email") = "" Session("pass") = "" Session("confirm") = "" Session("fname") = "" Session("lname") = "" Session("add1") = "" Session("add2") = "" Session("city") = "" Session("state") = "" Session("country") = "" Session("zip") = "" Session("phone") = "" Session("fax") = "" Session("cell") = "" End If Else End If %> <% If Not Request.QueryString = "edit" Then %>
<% End Function ' '************************************************************************************************************ '************************************************************************************************************ 'AddNewUser '************************************************************************************************************ ' Function AddNewUser Dim lAllOK, strEmailBody lAllOK = True Session("email") = Trim(ReplaceSQL(Request.Form("email"))) Session("pass") = Trim(ReplaceSQL(Request.Form("pass"))) Session("confirm") = Trim(ReplaceSQL(Request.Form("confirm"))) Session("fname") = Trim(ReplaceSQL(Request.Form("fname"))) Session("lname") = Trim(ReplaceSQL(Request.Form("lname"))) Session("add1") = Trim(ReplaceSQL(Request.Form("add1"))) Session("add2") = Trim(ReplaceSQL(Request.Form("add2"))) Session("city") = Trim(ReplaceSQL(Request.Form("city"))) Session("state") = Trim(ReplaceSQL(Request.Form("state"))) Session("country") = Trim(ReplaceSQL(Request.Form("country"))) Session("zip") = Trim(ReplaceSQL(Request.Form("zip"))) Session("phone") = Trim(ReplaceSQL(Request.Form("phone"))) Session("fax") = Trim(ReplaceSQL(Request.Form("fax"))) Session("cell") = Trim(ReplaceSQL(Request.Form("mobile"))) Session("agree") = Trim(ReplaceSQL(Request.Form("agree"))) Session("secq") = Trim(ReplaceSQL(Request.Form("secq"))) Session("seca") = Trim(ReplaceSQL(Request.Form("seca"))) If Not Request.QueryString = "edit" Then Session("user_registered") = MYSQL_NOW Session("user_trial") = MYSQL_FALSE Session("verify_code") = ToggleString(ReverseString(Session.SessionID)) Session("user_verified") = MYSQL_FALSE Session("user_active") = MYSQL_FALSE Session("user_admin") = MYSQL_FALSE Session("ip_addr") = Request.ServerVariables("REMOTE_ADDR") Session("user_package") = "-1" Session("act_link") = CONST_WEBSITE_URL & "/members/" & "activate.asp?q=" & Session("verify_code") Session("paid_for") = 0 Else Session("user_registered") = MYSQL_NOW 'Trim(ReplaceSQL(Request.Form("dtm"))) 'datetime Session("user_trial") = Trim(ReplaceSQL(Request.Form("utl"))) 'trial Session("verify_code") = Trim(ReplaceSQL(Request.Form("uvc"))) 'user verify code Session("user_verified") = Trim(ReplaceSQL(Request.Form("uvr"))) 'user verified Session("user_active") = Trim(ReplaceSQL(Request.Form("uav"))) 'user active Session("user_admin") = Trim(ReplaceSQL(Request.Form("uam"))) 'user_admin Session("ip_addr") = Trim(ReplaceSQL(Request.Form("uip"))) 'user ip Session("user_package") = Trim(ReplaceSQL(Request.Form("upk"))) 'user package Session("paid_for") = Trim(ReplaceSQL(Request.Form("pfr"))) 'user package End If If Not RegExprOK (Session("email"), REGEXP_EMAIL_CHECK) Then lAllOK = False sErrorText = "email" End If If Not RegExprOK (Session("pass"), REGEXP_SAFE_PASSWORD ) Then lAllOK = False sErrorText = "password" End If If Not Session("confirm") = Session("pass") Then lAllOK = False sErrorText = "confirm password" End If If Session("pass") <> session("confirm") then lAllOK = False sErrorText = "password mismatch" End If If Not RegExprOK (Session("fname"), REGEXP_SAFE_TEXT) Then lAllOK = False sErrorText = "First Name" End If If Not RegExprOK (Session("lname"), REGEXP_SAFE_TEXT) Then lAllOK = False sErrorText = "Last Name" End If If Not RegExprOK (Session("country"), REGEXP_SAFE_TEXT) Then lAllOK = False sErrorText = "Country" End If If lAllOK Then Call conOpen IF Request.QueryString = "edit" Then ssQL = "delete from `myip_users` where `user_id` = " & session("user_id") oConn.Execute ( sSQL ) End If If Not EmailExists(Session("email")) Then sSQL = "" sSQL = "insert into myip_users(" If Request.QueryString = "edit" Then sSQL = sSQL & "user_id," End If sSQL = sSQL & "user_package,user_name,user_email,user_address,user_city,user_state," _ & "user_country,user_zip,user_phone,user_fax,user_mobile,user_password,user_registered,user_secqst,user_secans," _ & "user_ipaddress,user_verify_code,user_active,user_verified,user_admin,paid_for) " sSQL = sSQL & "values(" IF Request.QueryString = "edit" Then sSQL = sSQL & Session("user_id") & "," End If sSQL = sSQL & Session("user_package") & "," sSQL = sSQL & "'" & Session("fname") & " " & Session("lname") & "'," sSQL = sSQL & "'" & Session("email") & "'," sSQL = sSQL & "'" & Session("add1") & "||" & Session("add2") & "'," sSQL = sSQL & "'" & Session("city") & "'," sSQL = sSQL & "'" & Session("state") & "'," sSQL = sSQL & "'" & Session("country") & "'," sSQL = sSQL & "'" & Session("zip") & "'," sSQL = sSQL & "'" & Session("phone") & "'," sSQL = sSQL & "'" & Session("fax") & "'," sSQL = sSQL & "'" & Session("cell") & "'," sSQL = sSQL & "'" & ReverseString(Session("pass")) & "'," sSQL = sSQL & "'" & Session("user_registered") & "'," sSQL = sSQL & "'" & Session("secq") & "'," sSQL = sSQL & "'" & Session("seca") & "'," sSQL = sSQL & "'" & Session("ip_addr") & "'," sSQL = sSQL & "'" & Session("verify_code") & "'," sSQL = sSQL & Session("user_active") & "," sSQL = sSQL & Session("user_verified") & "," sSQL = sSQL & Session("user_admin") & "," sSQL = sSQL & Session("paid_for") sSQL = sSQL & ")" 'Response.Write sSQL oConn.Execute ( sSQL ) If Err.Number = 0 Then IF Not Request.QueryString = "edit" Then strEmailBody = ReadFromFile("/tmpl/email_activate.tmpl") strEmailBody = Replace(strEmailBody,"[TMPL_FIRST_NAME]",Session("fname")) strEmailBody = Replace(strEmailBody,"[TMPL_LAST_NAME]",Session("lname")) strEmailBody = Replace(strEmailBody,"[TMPL_EMAIL_ADDRESS]",Session("email")) strEmailBody = Replace(strEmailBody,"[TMPL_ACTIVATE_LINK]",Session("act_link")) strEmailBody = Replace(strEmailBody,"[TMPL_ACTIVATE_CODE]",Session("verify_code")) strEmailBody = Replace(strEmailBody,"[TMPL_WEBSITE_PRIVACY_LINK]",CONST_WEBSITE_URL & "/privacy.asp") strEmailBody = Replace(strEmailBody,"[TMPL_SITE_NAME]",SITE_NAME) strEmailBody = Replace(strEmailBody,"[TMPL_SITE_DESCRIPTION]",META_DESC) Call SendMail_CDOSYS (Session("email"),"Welcome to " & SITE_NAME,strEmailBody,NO_REPLY_EMAIL,"") Response.Write ("We have sent an email to your email address " & Session("email") & ". Please check your email account and follow the steps described in the email.
It may take 1 - 48 hours for the email message to reach you, but usually it takes around 1 or 2 minutes. If you have not received the verification email, please click here to resend the verification email.") Else Response.Write ("
" & sErrorText & " was left blank or was not in proper format, please correct the errors, click here to fix the same.
") End If 'Response.Redirect("/members/package.asp") End Function ' '************************************************************************************************************ '************************************************************************************************************ 'ClearSession '************************************************************************************************************ ' Public Function ClearSession Session("email") = "" Session("pass") = "" Session("confirm") = "" Session("fname") = "" Session("lname") = "" Session("add1") = "" Session("add2") = "" Session("city") = "" Session("state") = "" Session("country") = "" Session("zip") = "" Session("phone") = "" Session("fax") = "" Session("cell") = "" Session("agree") = "" Session("user_registered") = "" Session("ip_addr") = "" Session("verify_code") = "" Session("secq") = "" Session("seca") = "" End Function ' '************************************************************************************************************ %> <% Call MakePageFooter %>