bugfixes, added redstoner env
This commit is contained in:
@@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base
|
||||
before_filter :update_ip, :update_seen
|
||||
# force_ssl
|
||||
|
||||
http_basic_authenticate_with name: "redstone", password: "sheep_"
|
||||
|
||||
helper :all
|
||||
include UsersHelper
|
||||
include ApplicationHelper
|
||||
|
||||
@@ -85,13 +85,16 @@ class UsersController < ApplicationController
|
||||
if user_profile
|
||||
@user.uuid = user_profile["id"]
|
||||
@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
|
||||
if @user.save
|
||||
session[:user_id] = @user.id
|
||||
if @user.uses_mc_password?(params[:user][:password])
|
||||
is_idiot = true
|
||||
flash[:alert] = "Really? That's your Minecraft password!"
|
||||
else
|
||||
is_idiot = false
|
||||
end
|
||||
begin
|
||||
RedstonerMailer.register_mail(@user, is_idiot).deliver
|
||||
@@ -116,7 +119,7 @@ class UsersController < ApplicationController
|
||||
end
|
||||
else
|
||||
flash[:alert] = "Error. Your username is not correct or Mojang's servers are down."
|
||||
render action: new
|
||||
render action: "new"
|
||||
return
|
||||
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="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>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>
|
||||
|
||||
Reference in New Issue
Block a user