From e03f75abae03373364a2f00797cc26e5126446d7 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 20 Jul 2016 14:08:21 +0200 Subject: [PATCH] Remove useless rails code --- .../app/controllers/account_controller.rb | 20 ------ .../app/controllers/users_controller.rb | 14 ----- .../account/_change_password_form.html.erb | 26 -------- .../app/views/users/_create_form.html.erb | 63 ------------------- 4 files changed, 123 deletions(-) delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_change_password_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_create_form.html.erb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb index 508c5ac7ae1..af804e260e2 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb @@ -40,26 +40,6 @@ class AccountController < ApplicationController end end - def change_password - verify_post_request - if User.authenticate(current_user.login, params[:old_password], servlet_request) - if params[:password].blank? - flash[:error] = message('my_profile.password.empty') - elsif current_user.update_attributes(:password => params[:password], :password_confirmation => params[:password_confirmation]) - flash[:notice] = message('my_profile.password.changed') - else - flash[:error] = current_user.errors.full_messages.join("
\n") - end - else - flash[:error] = message('my_profile.password.wrong_old') - end - redirect_to :controller => 'account', :action => 'index' - end - - def change_password_form - render :partial => 'change_password_form' - end - def update_notifications verify_post_request # Global notifs diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb index 63884f550fa..5c4d3ac44c7 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb @@ -24,20 +24,6 @@ class UsersController < ApplicationController before_filter :admin_required, :except => ['new', 'signup', 'autocomplete'] skip_before_filter :check_authentication, :only => ['new', 'signup', 'autocomplete'] - def create - return unless request.post? - - call_backend do - isUserReactivated = Internal.users_api.create(params[:user]) - if !isUserReactivated - flash[:notice] = 'User is created.' - else - flash[:notice] = Api::Utils.message('user.reactivated', :params => params[:user][:login]) - end - render :text => 'ok', :status => 200 - end - end - def signup access_denied unless request.post? && Property.value('sonar.allowUsersToSignUp')=='true' diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_change_password_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_change_password_form.html.erb deleted file mode 100644 index c62a514c98e..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_change_password_form.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -
- - - - - - -
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_create_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_create_form.html.erb deleted file mode 100644 index f0821948851..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_create_form.html.erb +++ /dev/null @@ -1,63 +0,0 @@ -<% form_for :user, @user, :url => {:id => @user.id, :action => 'create'}, :html => {:id => 'user_create_form', :method => @user.id.nil? ? :post : :put} do |f| %> -
- -
-<% end %> - - -- 2.39.5