Made user email case insensitive
This commit is contained in:
@@ -248,7 +248,7 @@ class ApplicationController < LinguaFrancaApplicationController
|
||||
|
||||
def generate_confirmation(user, url, expiry = nil)
|
||||
if user.is_a? String
|
||||
user = User.find_by_email(user)
|
||||
user = User.find_user(user)
|
||||
|
||||
# if the user doesn't exist, just show them a 403
|
||||
do_403 unless user.present?
|
||||
@@ -338,15 +338,11 @@ class ApplicationController < LinguaFrancaApplicationController
|
||||
# see if we've already sent the confirmation email and are just confirming
|
||||
# the email address
|
||||
if params[:token]
|
||||
user = User.find_by_email(params[:email])
|
||||
user = User.find_user(params[:email])
|
||||
confirm(user)
|
||||
return
|
||||
end
|
||||
user = User.find_by_email(params[:email])
|
||||
|
||||
unless user.present?
|
||||
user = User.create(:email => params[:email], locale: I18n.locale)
|
||||
end
|
||||
user = User.get(params[:email])
|
||||
|
||||
# generate the confirmation, send the email and show the 403
|
||||
referrer = params[:dest] || (request.present? && request.referer.present? ? request.referer.gsub(/^.*?\/\/.*?\//, '/') : settings_path)
|
||||
|
||||
@@ -631,11 +631,11 @@ class ConferenceAdministrationController < ApplicationController
|
||||
|
||||
companions = data['companions'] || []
|
||||
companions.each do | companion |
|
||||
user = User.find_by_email(companion)
|
||||
user = User.find_user(companion)
|
||||
if user.present?
|
||||
reg = ConferenceRegistration.find_by(
|
||||
:user_id => user.id,
|
||||
:conference_id => @this_conference.id
|
||||
user_id: user.id,
|
||||
conference_id: @this_conference.id
|
||||
)
|
||||
if reg.present? && @guests[reg.id].present?
|
||||
housing_data = reg.housing_data || {}
|
||||
@@ -846,7 +846,7 @@ class ConferenceAdministrationController < ApplicationController
|
||||
if params[:button] == 'save'
|
||||
return do_404 unless params[:email].present? && params[:name].present?
|
||||
|
||||
user = User.find_by_email(params[:email]) || User.create(email: params[:email])
|
||||
user = User.get(params[:email])
|
||||
user.firstname = params[:name]
|
||||
user.save!
|
||||
registration = ConferenceRegistration.new(
|
||||
|
||||
@@ -172,7 +172,7 @@ class ConferencesController < ApplicationController
|
||||
}
|
||||
when :questions
|
||||
# create the companion's user account and send a registration link unless they have already registered
|
||||
generate_confirmation(User.create(email: params[:companion]), register_path(@this_conference.slug)) if params[:companion].present? && User.find_by_email(params[:companion]).nil?
|
||||
generate_confirmation(User.create(email: params[:companion]), register_path(@this_conference.slug)) if params[:companion].present? && User.find_user(params[:companion]).nil?
|
||||
|
||||
@registration.housing = params[:housing]
|
||||
@registration.arrival = params[:arrival]
|
||||
|
||||
@@ -23,14 +23,13 @@ class OauthsController < ApplicationController
|
||||
# otherwise find the user by email
|
||||
unless user.present?
|
||||
# only look if the email address is present
|
||||
user = User.find_by_email(email) if email.present?
|
||||
user = User.find_user(email) if email.present?
|
||||
end
|
||||
|
||||
# create the user if the email is not recognized
|
||||
if user.nil?
|
||||
if email.present?
|
||||
user = User.new(email: email, firstname: user_info['name'], fb_id: fb_id)
|
||||
user.save!
|
||||
user = User.create(email: email, firstname: user_info['name'], fb_id: fb_id, locale: I18n.locale)
|
||||
else
|
||||
session[:oauth_update_user_info] = user_info
|
||||
return redirect_to oauth_update_path
|
||||
@@ -62,7 +61,7 @@ class OauthsController < ApplicationController
|
||||
return redirect_to oauth_update_path
|
||||
end
|
||||
|
||||
user = User.find_by_email(params[:email])
|
||||
user = User.find_user(params[:email])
|
||||
|
||||
if user.present?
|
||||
flash[:error] = :exists
|
||||
|
||||
@@ -297,11 +297,11 @@ class WorkshopsController < ApplicationController
|
||||
set_conference
|
||||
set_conference_registration!
|
||||
|
||||
user = User.find_by_email(params[:email])
|
||||
user = User.find_user(params[:email])
|
||||
|
||||
# create the user if they don't exist and send them a link to register
|
||||
unless user
|
||||
user = User.create(email: params[:email])
|
||||
user = User.create(email: params[:email], locale: I18n.locale)
|
||||
generate_confirmation(user, register_path(@this_conference.slug))
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user