Archived
bugfixes, added redstoner env
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user