diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-07-20 14:08:21 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-08-11 16:26:43 +0200 |
commit | e03f75abae03373364a2f00797cc26e5126446d7 (patch) | |
tree | e21e6611230bb9cc8ab6b3d8d91315807e81f9d3 | |
parent | 7f6c2ce9205ed68c7b22bcb2508992ee51ea42a7 (diff) | |
download | sonarqube-e03f75abae03373364a2f00797cc26e5126446d7.tar.gz sonarqube-e03f75abae03373364a2f00797cc26e5126446d7.zip |
Remove useless rails code
4 files changed, 0 insertions, 123 deletions
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("<br/>\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 @@ -<form id="pass_form_tag" name="pass_form_tag" method="post" action="<%= ApplicationController.root_context -%>/account/change_password"> - <div class="modal-head"> - <h2><%= message('my_profile.password.title') -%></h2> - </div> - - <div class="modal-body"> - <div class="modal-field"> - <label for="old_password"><%= message('my_profile.password.old') -%>:</label> - <%= password_field_tag 'old_password', nil, {:autocomplete => 'off', :required => ''} %> - </div> - <div class="modal-field"> - <label for="password"><%= message('my_profile.password.new') -%>:</label> - <%= password_field_tag 'password', nil, {:autocomplete => 'off', :required => ''} %> - </div> - <div class="modal-field"> - <label for="password_confirmation"><%= message('my_profile.password.confirm') -%>:</label> - <%= password_field_tag 'password_confirmation', nil, {:autocomplete => 'off', :required => ''} %> - </div> - </div> - - <div class="modal-foot"> - <%= submit_tag message('my_profile.password.submit') %> - <%= link_to message('cancel'), { :controller => 'account', :action => 'index' } %> - </div> - -</form> 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| %> - <fieldset> - <div class="modal-head"> - <h2>Add new user</h2> - </div> - <div class="modal-body"> - <div class="modal-error"/> - <div class="modal-field"><label for="user[login]">Login <em class="mandatory">*</em></label> - <%= f.text_field :login, :size => 30, :maxLength => 255 %> - </div> - <div class="modal-field"> - <label for="user[]">Name <em class="mandatory">*</em></label> - <%= f.text_field :name, :size => 30, :maxLength => 200 %></div> - <div class="modal-field"> - <label for="user[]">Email</label> - <%= f.text_field :email, :size => 30, :maxLength => 100 %></div> - <div class="modal-field"> - <label for="user[password]">Password <em class="mandatory">*</em></label><%= f.password_field :password, :size => 30, :maxLength => 50, :autocomplete => 'off' %></div> - <div class="modal-field"><label for="user[password_confirmation]">Confirm password - <em class="mandatory">*</em></label><%= f.password_field :password_confirmation, :size => 30, :maxLength => 50, :autocomplete => 'off' %></div> - - <div class="modal-field"> - <label for="user[scm_accounts]">SCM accounts</label> - <table> - <tr class="scm_account"> - <td> - <input id="user_scm_accounts" type="text" size="30" name="user[scm_accounts][]"/> - </td> - </tr> - <tr class="scm_account template" style="display:none"> - <td> - <input id="user_scm_accounts" type="text" size="30" name="user[scm_accounts][]"/> - <a href="#" class="delete link-action"><%= message('delete') -%></a> - <br/> - </td> - </tr> - </table> - <div class="note marginbottom10">Note that login and email are automatically considered as SCM accounts</div> - <button class="add_value"><%= message('user.add_scm_account') -%></button> - </div> - - </div> - <div class="modal-foot"> - <%= submit_tag 'Create' %> - <%= link_to 'Cancel', {:controller => 'users', :action => 'index'}, {:class => 'action'} %><br/> - </div> - </fieldset> -<% end %> - -<script> - $j("#user_create_form").modalForm(); - - $j('#user_create_form').on('click', '.delete', function () { - $j(this).closest('.scm_account').remove(); - return false; - }); - - $j('#user_create_form .add_value').click(function () { - var template = $j(this).parents('#user_create_form').find('.template').last(); - template.clone().insertBefore(template).show(); - return false; - }); -</script> |