<% if not Request.Cookies("lvlserver")("sysadminid") > 0 then 'they ain't welcomed, get them out of here Response.Redirect("login.asp") else 'they must have logged in fine let them have the world 'they have hit *update* so.. update them if Request.QueryString("updateme") = "yes" then if Request.Form("submit") = "Cancel" then Response.Redirect("login.asp") end if session("login") = Trim(Request.Form("login")) session("password") = Trim(Request.Form("password")) session("passchk") = Trim(Request.Form("passchk")) session("sysadmin") = Trim(Request.Form("sysadmin")) session("email") = Trim(Request.Form("email")) 'session("active") = Cint(Trim(Request.Form("active"))) dim error, error_msg if (session("sysadmin") = "") then error = true error_msg = error_msg & "
  • You can't have a blank sysadmin name" end if if (session("login") = "") then error = true error_msg = error_msg & "
  • You can't have a blank login" end if if (session("email") = "") then error = true error_msg = error_msg & "
  • You can't have a blank email" end if if not (instr(2,session("email"),"@") > 1) and not (instr(4,session("email"),".") > 3) then error = true error_msg = error_msg & "
  • You can't have an invalid email" end if if (session("password") = "") then error = true error_msg = error_msg & "
  • You need to enter a password" end if if (session("passchk") = "") then error = true error_msg = error_msg & "
  • You need to enter a check password" end if if not (session("passchk")) = (session("password")) then error = true error_msg = error_msg & "
  • The password and password check did not match" end if '1st check to see if their name, login, pass, is already listed set tigCON = Server.CreateObject("ADODB.Connection") tigCON.Open(DSN) query = "select sysadmin, login, password " query = query & "from server_sysadmin where " query = query & "((sysadmin = '" & SQLSafe(session("sysadmin")) & "') or " query = query & "(login = '" & SQLSafe(session("login")) & "') or " query = query & "(password = '" & SQLSafe(session("password")) & "')) and " query = query & "(id <> " & Request.Cookies("lvlserver")("sysadminid") & ")" 'Response.Write("Query = [" & query & "]
    ") set tigRS = tigCON.Execute(query) dim no_worries if (tigRS.EOF) then 'ok, all is good, they can be added no_worries = true else 'must be a match, they have to chage some thing do while not tigRS.EOF if tigRS("sysadmin") = session("sysadmin") then 'Response.Write("error is name [" & tigRS("sysadmin") & "]
    ") error_msg = error_msg & "
  • The sysadmin name you have chosen is already in use." error = true end if if tigRS("login") = session("login") then 'Response.Write("error is login [" & tigRS("login") & "]
    ") error_msg = error_msg & "
  • The login you have chosen is already in use." error = true end if if tigRS("password") = session("password") then 'Response.Write("error is pass [" & tigRS("password") & "]
    ") error_msg = error_msg & "
  • The password you have chosen is already in use." error = true end if tigRS.MoveNext loop end if if no_worries and not error then 'Response.Write("im here") set tigCON = Server.CreateObject("ADODB.Connection") tigCON.Open(DSN) query = "update server_sysadmin set " query = query & "login = '" & SQLsafe(session("login")) & "', " query = query & "email = '" & SQLsafe(session("email")) & "', " query = query & "sysadmin = '" & SQLsafe(session("sysadmin")) & "', " query = query & "password = '" & SQLsafe(session("password")) & "' " query = query & "where id =" & Request.Cookies("lvlserver")("sysadminid") 'Response.Write("query=[" & query & "]
    ") tigCON.Execute(query) dim all_done all_done = true end if tigRS.close tigCON.close else 'they just got here, so grab some details from the database set tigCON = Server.CreateObject("ADODB.Connection") tigCON.Open(DSN) query = "select all * " query = query & "from server_sysadmin where " query = query & "(id = " & Request.Cookies("lvlserver")("sysadminid") & ")" 'Response.Write("Query = [" & query & "]
    ") set tigRS = tigCON.Execute(query) dim no_info if (tigRS.EOF) then 'ok, this means they ain't got a cookie, or there is no info no_info = true else session("login") = tigRS("login") session("password") = tigRS("password") session("sysadmin") = tigRS("sysadmin") session("email") = tigRS("email") end if tigRS.close tigCON.close end if if all_done then Response.Redirect("login.asp") else %> admin <% 'Response.Write("ReQu id =[" & Request.Cookies("lvlserver")("sysadminid") & "]
    ") if Request.QueryString("updateme") = "yes" then set tigCON = Server.CreateObject("ADODB.Connection") tigCON.Open(DSN) query = "select all * from server_sysadmin where id = " & Request.Cookies("lvlserver")("sysadminid") & _ " and active = 1" 'Response.Write("Query = [" & query & "]
    ") set tigRS = tigCON.Execute(query) if (tigRS.EOF) then %> The LvL Sysadmin account you have requested has not been activated, does not exist, or some thing has gone wrong - email tigger@ebom.org if there is a real problem. <% else 'create some session vars for this level session("login") = tigRS("login") session("sysadmin") = tigRS("sysadmin") session("email") = tigRS("email") session("password") = tigRS("password") end if tigRS.close tigCON.close end if if error then Response.Write(error_msg) end if %>
    ?updateme=yes" method="post">

    System Admins Name - (thats your name or nick, it will appear everywhere)
    ">

    System Admin Email - (kind of important this is, so get it right, OK)
    ">

    Login name - (you will use this to login into your account)
    ">

    Password - (so others can't just change your details)
    ">

    Password check- (how about we check that password)

    <% 'end the all_one end if %>
    <% end if %>