<% '=========================== 'the sigup should be as stright forward as possible 'display name, login and password MUST be unique (not password now) 'users need to unlock their own accounts 'tag lines and sigs are optional '=========================== 'as edit details is basically the same, we can use the same 'page and just make sure they have a cookie 1st '=========================== 'encodeTable 'run function to build IP encode table dim error, error_msg dim signed, updated_user dim login, pass, user_name, email, reg_tag, sig_file if (Request.QueryString("signup") = "yes") then 'they want to login, first check for *stuff* if trim(Request.Form("login")) = "" then error = true error_msg = error_msg & "
  • In order to login you need to enter a login name :]
  • " & vbcrlf end if if trim(Request.Form("pass")) = "" then error = true error_msg = error_msg & "
  • You seem to have forgotten to enter a password, lets try that again!
  • " & vbcrlf end if if trim(Request.Form("pass")) <> trim(Request.Form("passchk")) then error = true error_msg = error_msg & "
  • The password and password check you entered didn't match, try again
  • " & vbcrlf end if if (instr(1,trim(lcase(Request.Form("reg_tag"))),"lvl admin") > 0) and (not instr(1,left(ip_dig,10),"203.24.131") > 0) then error = true error_msg = error_msg & "
  • "& Request.Form("reg_tag") &" is a reserved tag line, try something else.
  • " & vbcrlf end if if trim(Request.Form("user_name")) = "" then error = true error_msg = error_msg & "
  • You didn't enter a display name, this is your nick or handle that will identify you. It can be different for your login if you wish.
  • " & vbcrlf end if 'now see if any info is already in the database (need unquie users only) 'call user_exists(trim(Request.Form("login")), trim(Request.Form("pass")), trim(Request.Form("user_name"))) 'check the login if user_exists("forum_user", "login", trim(Request.Form("login"))) then error = true error_msg = error_msg & "
  • The login name you entered already exists in the Database, please try a different login, sorry :[
  • " & vbcrlf end if 'check the password 'if user_exists("forum_user", "pass", trim(Request.Form("pass"))) then ' ' error = true ' error_msg = error_msg & "
  • The password you entered already exists in the Database, please try a different one, sorry :[
  • " & vbcrlf ' 'end if 'check the display name if user_exists("forum_user", "user_name", trim(Request.Form("user_name"))) then error = true error_msg = error_msg & "
  • Your nick, handle or name is already in the Database, please try a different one, sorry :[
  • " & vbcrlf end if if not ValidEmail(trim(Request.Form("email"))) then error = true error_msg = error_msg & "
  • The email address you entered is not vaild. It needs to be a real address as an unlocking key will be sent your inbox.
  • " & vbcrlf end if if len(trim(Request.Form("sig_file"))) > 255 then error = true error_msg = error_msg & "
  • Your signature file is too long, please shorten it.
  • " & vbcrlf end if '================================== 'sign them up if we have no errors! '================================== if not error then 'no errors! call the sign up function if Request.Cookies("lvl")("forumid") > 0 then 'this its an update call forum_signup_update else call forum_signup end if end if elseif (Request.Cookies("lvl")("forumid") > 0) and (not Request.QueryString("signup") ="yes") then 'only query the database if the cookie is found AND they have not submitted an update set con = Server.CreateObject("ADODB.Connection") con.Open(DSN) 'open the connection to the DSN (SQL server) query = "SELECT login, pass, user_name, email, reg_tag, sig_file " & _ "FROM forum_user " & _ "WHERE (id = " & Request.Cookies("lvl")("forumid") & ") AND (active = 1)" 'Response.Write("query = [" & query & "]
    ") 'run the query set RS=con.Execute(query) login = RS("login") pass = RS("pass") user_name = RS("user_name") email = RS("email") reg_tag = RS("reg_tag") sig_file = RS("sig_file") RS.close con.Close end if function forum_signup 'need to make a random number call for the unlock_key dim unlock_key Randomize unlock_key = Int(999999 * Rnd) set con = Server.CreateObject("ADODB.Connection") con.Open(DSN) 'open the connection to the DSN (SQL server) query = "INSERT INTO forum_user " & _ " (login, pass, user_name, email, active, reg_tag, sig_file, unlock_key) " & _ "VALUES (" & _ " '"& SQLsafe(trim(Request.Form("login"))) &"', " & _ " '"& SQLsafe(trim(Request.Form("pass"))) &"', " & _ " '"& SQLsafe(trim(Request.Form("user_name"))) &"', " & _ " '"& SQLsafe(trim(Request.Form("email"))) &"', " & _ " 0, " & _ " '"& SQLsafe(trim(Request.Form("reg_tag"))) &"', " & _ " '"& SQLsafe(trim(Request.Form("sig_file"))) &"', " & _ " '"& unlock_key &"' " & _ ")" 'Response.Write("query = [" & query & "]
    ") 'run the query con.Execute(query) con.Close 'signed up now, but account is locked! so send them an email to the unlock page :] signed = true dim sendto, from, subject, body 'sending an email is lots of fun! sendto = SQLsafe(Request.Form("email")) from = "lvl@ebom.org" subject = "..::LvL forum and/or update login" body = "Either you or someone pretending to be you, has requested a login to Forums and Updates features on ..::LvL - if it wasn't you " & _ "then simply ignore this email. If you really want a login to the ..::LvL forums and/or updates then " & _ "you will need to activate your account by visiting the URL below. " & vbcr & vbcr & _ site_url & "forum/unlock.asp?n=" & unlock_key & "&e=" & server.URLPathEncode(Request.Form("email")) & vbcr & vbcr & _ "(make sure you get the FULL URL, it will end with your email address)" & vbcr & _ "If you have any question or problems forward them to lvl@ebom.org" & vbcr & vbcr & _ "Thanx" & vbcr & _ "..::LvL Admin " & vbcr & vbcr & _ "====== "& replace(site_url,"http://","") & " =======" if Request.ServerVariables("LOCAL_ADDR") = local_ip then call cdontstime(sendto, from, subject, body) else call emailtime(sendto, from, subject, body) end if end function function forum_signup_update set con = Server.CreateObject("ADODB.Connection") con.Open(DSN) 'open the connection to the DSN (SQL server) query = "UPDATE forum_user " & _ "SET login ='"& SQLsafe(trim(Request.Form("login"))) &"', " & _ " pass ='"& SQLsafe(trim(Request.Form("pass"))) &"', " & _ " user_name ='"& SQLsafe(trim(Request.Form("user_name"))) &"', " & _ " email ='"& SQLsafe(trim(Request.Form("email"))) &"', " & _ " reg_tag ='"& SQLsafe(trim(Request.Form("reg_tag"))) &"', " & _ " sig_file ='"& SQLsafe(trim(Request.Form("sig_file"))) &"' " & _ "WHERE (id = " & Request.Cookies("lvl")("forumid") & ") AND (active = 1)" 'Response.Write("query = [" & query & "]
    ") 'run the query con.Execute(query) con.Close 'update user info Response.Cookies("lvl")("forumuser_name") = trim(Request.Form("user_name")) Response.Cookies("lvl").expires = dateadd("yyyy",1,now()) updated_user = true end function function user_exists(byval table_to_check, field_to_check, value_to_check) user_exists = false set con = Server.CreateObject("ADODB.Connection") con.Open(DSN) 'open the connection to the DSN (SQL server) query = "SELECT " & SQLsafe(field_to_check) & " " & _ "FROM " & SQLsafe(table_to_check) & " " & _ "WHERE " & SQLsafe(field_to_check) & " LIKE '" & SQLsafe(value_to_check) & "' " if Request.Cookies("lvl")("forumid") > 0 then 'they may want to keep some details the same, but id don't change query = query & "AND id <> " & Request.Cookies("lvl")("forumid") end if 'Response.Write("query = [" & query & "]
    ") set RS=con.Execute(query) if not RS.eof then 'ALWAYS check of the EOF (end of file) user_exists = true end if RS.Close con.Close end function %> [ comments ] <% if Request.Cookies("lvl")("forumid") > 0 then Response.Write("..::LvL user details.") else Response.Write("..::LvL signup.") end if %>
    +---------------------
    <% 'if error then ' ' Response.Write("

    "&vbcrlf&"Looks like there was a few problems with your submission:

    ") ' 'else if updated_user then Response.Write("

    "&vbcrlf&"Your user details have been updated, hope that was easy enough :]

    ") elseif signed then Response.Write("

    "&vbcrlf&"An email is now being sent to "& Request.Form("email") &" with details on how to activate your ..::LvL login

    ") Response.Write("

    "&vbcrlf&"If you never get the email you either entered your email address incorrectly or there was a problem. Either way you can send an email lvl@ebom.org and see what we can do about fixing it up

    ") Response.Write("

    "&vbcrlf&"Thanx for signing up

    ..::LvL Admin

    ") else if error then Response.Write("

    "&vbcrlf&"Looks like there was a few problems with your submission:

    ") else if not Request.Cookies("lvl")("forumid") > 0 then %>

    The ..::LvL forums do NOT require you to sign-up to post a reply, but if you do everyone will think you are really cool :] You can also have cool things like a Signature File and a Reg Tag. Don't get too exicted now, signing-up will require a little bit of work. You will also need to have a browser that supports cookies and a vaild email address (we send you out an unlocking key for your login).

    The ..::LvL Update listing does require you to signup if you which to add a pk3. Its a small ask and should stop junk postings (we hope).

    If all that is not too scary fill in the form below:

    <% end if end if if Request.QueryString("signup") = "yes" then 'ok, they have submittied some detail (otherwise they would have a blank querystring) %>

    ?signup=yes" method="post"> new signup Your nick or handle: (This is shown next to the all the post you make)
    " maxlength="48" size="24" />

    Login: (We use this to check who you are)
    " maxlength="32" size="24" />

    Password: (We also use this to check who you are)
    " maxlength="32" size="24" />

    Password check: (This is to make sure you can type :])
    " maxlength="32" size="24" />

    Your email address: (We will send you out an unlocking key for your login)
    " maxlength="128" size="24" />

    Reg Tag: (A short *something* that will appear under your name, its optional)
    " maxlength="32" size="24" />

    Signature file: (Also optional, its limited to 255 characters in length)


    <% else 'populate if they have a cookie, otherwise the vaule will just be blank %>

    ?signup=yes" method="post"> Your nick or handle: (This is shown next to the all the post you make)


    Login: (We use this to check who you are)


    Password: (We also use this to check who you are)


    Password check: (This is to make sure you can type :])


    Your email address: (We will send you out an unlocking key for your login)


    Reg Tag: (A short *something* that will appear under your name, its optional)


    Signature file: (Also optional, its limited to 255 characters in length)


    <% if Request.Cookies("lvl")("forumid") > 0 then 'ok, they are here to edit! Response.Write("") else Response.Write("") end if %>

    <% end if end if %>