Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changing email addresses to lower case

  • Loading branch information...
commit 501d9483da0cd801e9cdb39d08602467dc269ef5 1 parent 90dea48
Michael Camilleri michaelcamilleri authored
6 app/controllers/players_controller.rb
View
@@ -45,6 +45,7 @@ def password
# POST /player.xml
def create
@player = Player.new(params[:player])
+ @player.email = @player.email.downcase
# Get player coordinates and location
#@client_ip = request.remote_ip
@@ -98,9 +99,10 @@ def update
player_params = params[:player].stringify_keys
player_params.each do |key,value|
if key.eql? "email"
- @player_params_email = value
+ params[:player]["email"] = value.downcase
+ @player_params_email = value.downcase
elsif key.eql? "mobile"
- @player_params_mobile = value
+ @player_params_mobile = value
elsif key.eql? "password"
if ((!params[:old_password].nil?) && (!Digest::SHA2.hexdigest(@player.id.to_s() + params[:old_password]).eql?@player.password))
@player.errors.add("old_password", "Incorrect password")
4 app/controllers/sessions_controller.rb
View
@@ -3,7 +3,7 @@ class SessionsController < ApplicationController
# method called upon clicking Play button
def login
- email = params[:email]
+ email = params[:email].downcase
password = params[:password]
player = Player.get_player(email)
@@ -21,7 +21,7 @@ def login
if password != player.password and !password.blank?
flash.now[:error] = "Incorrect username and password combination"
elsif !password.nil? and password.empty?
- flash.now[:error] = "password empty"
+ flash.now[:error] = "Empty password"
elsif password == player.password
session[:logged_in_player] = player
end
Please sign in to comment.
Something went wrong with that request. Please try again.