X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c34ed1e3706020c59aa8dc70ece41c36a8a30930..4ec85171fd7b484ea701e5d9d6c009e72dbbd7de:/app/controllers/users_controller.rb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4f05ece74..3489b4eda 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? @@ -164,8 +164,6 @@ class UsersController < ApplicationController Rails.logger.info "create: #{session[:referer]}" - current_user.status = "pending" - if current_user.auth_provider.present? && current_user.pass_crypt.empty? # We are creating an account with external authentication and # no password was specified so create a random one @@ -202,15 +200,19 @@ class UsersController < ApplicationController ## # sets a user's status def set_status - @user.status = params[:status] - @user.save + @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 ## - # delete a user, marking them as deleted and removing personal data + # destroy a user, marking them as deleted and removing personal data def destroy - @user.delete + @user.soft_destroy! redirect_to user_path(:display_name => params[:display_name]) end