From f5fa193e0ddbcd1886bab9d394b8fd947f3cd309 Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 20 Apr 2014 20:03:45 +0200 Subject: [PATCH] bugfixes, added redstoner env --- app/controllers/application_controller.rb | 2 ++ app/controllers/users_controller.rb | 7 +++++-- app/views/redstoner_mailer/register_mail.html.erb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 62d4d84..5e7c617 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 661536b..85273ef 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/views/redstoner_mailer/register_mail.html.erb b/app/views/redstoner_mailer/register_mail.html.erb index a883e09..968036a 100644 --- a/app/views/redstoner_mailer/register_mail.html.erb +++ b/app/views/redstoner_mailer/register_mail.html.erb @@ -1,6 +1,6 @@
- Hi <%=@ user.name %>! + Hi <%= @user.name %>!

Thank you for registering on Redstoner.com!

To use your account, you need to <%= link_to "confirm", confirm_user_path(@user, code: @user.email_token, only_path: false) %>your email address.