# Already agreed to terms, so just show settings
redirect_to :action => :account, :display_name => current_user.display_name
elsif current_user.nil? && session[:new_user].nil?
- redirect_to :action => :login, :referer => request.fullpath
+ redirect_to login_path(:referer => request.fullpath)
end
end
end
if current_user
current_user.terms_seen = true
- flash[:notice] = t("users.new.terms declined", :url => t("users.new.terms declined url")).html_safe if current_user.save
+ flash[:notice] = { :partial => "users/terms_declined_flash" } if current_user.save
if params[:referer]
redirect_to safe_referer(params[:referer])
when "active", "confirmed"
successful_login(user, request.env["omniauth.params"]["referer"])
when "suspended"
- failed_login t("users.login.account is suspended", :webmaster => "mailto:#{Settings.support_email}").html_safe
+ failed_login t("sessions.new.account is suspended", :webmaster => "mailto:#{Settings.support_email}").html_safe
else
- failed_login t("users.login.auth failure")
+ failed_login t("sessions.new.auth failure")
end
else
redirect_to :action => "new", :nickname => name, :email => email,
user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation]
end
- if params[:user][:description] != user.description
- user.description = params[:user][:description]
- user.description_format = "markdown"
- end
-
- user.languages = params[:user][:languages].split(",")
-
- case params[:avatar_action]
- when "new"
- user.avatar.attach(params[:user][:avatar])
- user.image_use_gravatar = false
- when "delete"
- user.avatar.purge_later
- user.image_use_gravatar = false
- when "gravatar"
- user.avatar.purge_later
- user.image_use_gravatar = true
- end
-
- user.home_lat = params[:user][:home_lat]
- user.home_lon = params[:user][:home_lon]
-
- user.preferred_editor = if params[:user][:preferred_editor] == "default"
- nil
- else
- params[:user][:preferred_editor]
- end
-
if params[:user][:auth_provider].nil? || params[:user][:auth_provider].blank?
user.auth_provider = nil
user.auth_uid = nil
if user.save
session[:fingerprint] = user.fingerprint
- set_locale(:reset => true)
-
if user.new_email.blank? || user.new_email == user.email
flash[:notice] = t "users.account.flash update success"
else