bugfixes, added redstoner env

This commit is contained in:
jomo
2014-04-20 20:03:45 +02:00
parent c0a57f1554
commit f5fa193e0d
3 changed files with 8 additions and 3 deletions
@@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base
before_filter :update_ip, :update_seen before_filter :update_ip, :update_seen
# force_ssl # force_ssl
http_basic_authenticate_with name: "redstone", password: "sheep_"
helper :all helper :all
include UsersHelper include UsersHelper
include ApplicationHelper include ApplicationHelper
+5 -2
View File
@@ -85,13 +85,16 @@ class UsersController < ApplicationController
if user_profile if user_profile
@user.uuid = user_profile["id"] @user.uuid = user_profile["id"]
@user.ign = user_profile["name"] # correct case @user.ign = user_profile["name"] # correct case
if validate_token(@user.uuid, @user.email, params[:registration_token]) # TODO: uncomment when MC part works
if true # validate_token(@user.uuid, @user.email, params[:registration_token])
@user.last_ip = request.remote_ip # showing in mail @user.last_ip = request.remote_ip # showing in mail
if @user.save if @user.save
session[:user_id] = @user.id session[:user_id] = @user.id
if @user.uses_mc_password?(params[:user][:password]) if @user.uses_mc_password?(params[:user][:password])
is_idiot = true is_idiot = true
flash[:alert] = "Really? That's your Minecraft password!" flash[:alert] = "Really? That's your Minecraft password!"
else
is_idiot = false
end end
begin begin
RedstonerMailer.register_mail(@user, is_idiot).deliver RedstonerMailer.register_mail(@user, is_idiot).deliver
@@ -116,7 +119,7 @@ class UsersController < ApplicationController
end end
else else
flash[:alert] = "Error. Your username is not correct or Mojang's servers are down." flash[:alert] = "Error. Your username is not correct or Mojang's servers are down."
render action: new render action: "new"
return return
end end
end end
@@ -1,6 +1,6 @@
<div style="font-family: 'Oswald','Calibri','Arial','DejaVu Sans','Open Sans','Lucida Sans','Lucida Grande','Lucida Sans Unicode',sans-serif; background: #F2F2F2"> <div style="font-family: 'Oswald','Calibri','Arial','DejaVu Sans','Open Sans','Lucida Sans','Lucida Grande','Lucida Sans Unicode',sans-serif; background: #F2F2F2">
<div style="color: rgb(63, 63, 63); width: 600px; max-width: 100%; padding: 2em; margin: auto"> <div style="color: rgb(63, 63, 63); width: 600px; max-width: 100%; padding: 2em; margin: auto">
Hi <%=@ user.name %>! Hi <%= @user.name %>!
<p>Thank you for registering on Redstoner.com!</p> <p>Thank you for registering on Redstoner.com!</p>
<p>To use your account, you need to <%= link_to "confirm", confirm_user_path(@user, code: @user.email_token, only_path: false) %>your email address.</p> <p>To use your account, you need to <%= link_to "confirm", confirm_user_path(@user, code: @user.email_token, only_path: false) %>your email address.</p>