X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1a11c4dc191d93b18fcf5aa917448c8cd6d2556b..db52805f97b9134a66fe1b1240d81e1e6f60736a:/app/controllers/users_controller.rb?ds=sidebyside diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ea04e14f6..933cec53d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -55,8 +55,8 @@ class UsersController < ApplicationController elsif current_user unless current_user.terms_agreed? current_user.consider_pd = params[:user][:consider_pd] - current_user.tou_agreed = Time.now.getutc - current_user.terms_agreed = Time.now.getutc + current_user.tou_agreed = Time.now.utc + current_user.terms_agreed = Time.now.utc current_user.terms_seen = true flash[:notice] = t "users.new.terms accepted" if current_user.save @@ -73,8 +73,8 @@ class UsersController < ApplicationController current_user.description = "" if current_user.description.nil? current_user.creation_ip = request.remote_ip current_user.languages = http_accept_language.user_preferred_languages - current_user.terms_agreed = Time.now.getutc - current_user.tou_agreed = Time.now.getutc + current_user.terms_agreed = Time.now.utc + current_user.tou_agreed = Time.now.utc current_user.terms_seen = true if current_user.auth_uid.blank? @@ -83,7 +83,7 @@ class UsersController < ApplicationController end if current_user.save - flash[:piwik_goal] = PIWIK["goals"]["signup"] if defined?(PIWIK) + flash[:matomo_goal] = Settings.matomo["goals"]["signup"] if defined?(Settings.matomo) referer = welcome_path @@ -136,11 +136,7 @@ class UsersController < ApplicationController if current_user # The user is logged in already, so don't show them the signup # page, instead send them to the home page - if @referer - redirect_to @referer - else - redirect_to :controller => "site", :action => "index" - end + redirect_to @referer || { :controller => "site", :action => "index" } elsif params.key?(:auth_provider) && params.key?(:auth_uid) self.current_user = User.new(:email => params[:email], :email_confirmation => params[:email], @@ -202,8 +198,10 @@ class UsersController < ApplicationController def set_status @user.activate! if params[:event] == "activate" @user.confirm! if params[:event] == "confirm" + @user.unconfirm! if params[:event] == "unconfirm" @user.hide! if params[:event] == "hide" @user.unhide! if params[:event] == "unhide" + @user.unsuspend! if params[:event] == "unsuspend" redirect_to user_path(:display_name => params[:display_name]) end @@ -273,7 +271,7 @@ class UsersController < ApplicationController session[:new_user].auth_provider = provider session[:new_user].auth_uid = uid - session[:new_user].status = "active" if email_verified && email == session[:new_user].email + session[:new_user].activate if email_verified && email == session[:new_user].email redirect_to :action => "terms" else