Commit 588233c2 authored by Cool Fire's avatar Cool Fire

Add parent to signup email

parent 2117db06
Pipeline #1095 passed with stages
in 4 minutes and 47 seconds
......@@ -43,7 +43,11 @@ class SignupSite < Sinatra::Base
end
mysql = mysql_connect
unless session.key?(:invite)
if session.key?(:invite)
query = mysql.prepare 'SELECT * FROM invites where `key` = ? LIMIT 1'
record = query.execute(session[:username]).first
session[:parent] = Rack::Utils.escape_html(record['parent'])
else
insert = mysql.prepare 'INSERT INTO invites (`email`, `key`, `parent`) VALUES (?, ?, ?)'
insert.execute session[:email], 'No invite code', 'SignupSite'
end
......
......@@ -2,6 +2,10 @@ username:
<%= session[:username] %>
parent:
<%= session[:parent] %>
email:
<%= session[:email] %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment