From 72e1f103de65962eab4056b2a0a2b9b13de62630 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Mon, 12 May 2014 17:01:32 +0200 Subject: [PATCH] Fix tabs/spaces --- .../email_configuration_controller.rb | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb index 054fa3d518b..8d217f8efad 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb @@ -23,49 +23,49 @@ class EmailConfigurationController < ApplicationController before_filter :admin_required def index - @smtp_host = Property.value(configuration::SMTP_HOST, nil, configuration::SMTP_HOST_DEFAULT) - @smtp_port = Property.value(configuration::SMTP_PORT, nil, configuration::SMTP_PORT_DEFAULT) - @smtp_secure_connection = Property.value(configuration::SMTP_SECURE_CONNECTION, nil, configuration::SMTP_SECURE_CONNECTION) - @smtp_username = Property.value(configuration::SMTP_USERNAME, nil, configuration::SMTP_USERNAME_DEFAULT) - @smtp_password = Property.value(configuration::SMTP_PASSWORD, nil, configuration::SMTP_PASSWORD_DEFAULT) - @email_from = Property.value(configuration::FROM, nil, configuration::FROM_DEFAULT) - @email_prefix = Property.value(configuration::PREFIX, nil, configuration::PREFIX_DEFAULT) - params[:layout]='false' + @smtp_host = Property.value(configuration::SMTP_HOST, nil, configuration::SMTP_HOST_DEFAULT) + @smtp_port = Property.value(configuration::SMTP_PORT, nil, configuration::SMTP_PORT_DEFAULT) + @smtp_secure_connection = Property.value(configuration::SMTP_SECURE_CONNECTION, nil, configuration::SMTP_SECURE_CONNECTION) + @smtp_username = Property.value(configuration::SMTP_USERNAME, nil, configuration::SMTP_USERNAME_DEFAULT) + @smtp_password = Property.value(configuration::SMTP_PASSWORD, nil, configuration::SMTP_PASSWORD_DEFAULT) + @email_from = Property.value(configuration::FROM, nil, configuration::FROM_DEFAULT) + @email_prefix = Property.value(configuration::PREFIX, nil, configuration::PREFIX_DEFAULT) + params[:layout]='false' end def save - Property.set(configuration::SMTP_HOST, params[:smtp_host]) - Property.set(configuration::SMTP_PORT, params[:smtp_port]) - Property.set(configuration::SMTP_SECURE_CONNECTION, params[:smtp_secure_connection]) - Property.set(configuration::SMTP_USERNAME, params[:smtp_username]) - Property.set(configuration::SMTP_PASSWORD, params[:smtp_password]) - Property.set(configuration::FROM, params[:email_from]) - Property.set(configuration::PREFIX, params[:email_prefix]) - flash[:notice] = message('email_configuration.settings_saved') - redirect_to :action => 'index' + Property.set(configuration::SMTP_HOST, params[:smtp_host]) + Property.set(configuration::SMTP_PORT, params[:smtp_port]) + Property.set(configuration::SMTP_SECURE_CONNECTION, params[:smtp_secure_connection]) + Property.set(configuration::SMTP_USERNAME, params[:smtp_username]) + Property.set(configuration::SMTP_PASSWORD, params[:smtp_password]) + Property.set(configuration::FROM, params[:email_from]) + Property.set(configuration::PREFIX, params[:email_prefix]) + flash[:notice] = message('email_configuration.settings_saved') + redirect_to :action => 'index' end def send_test_email - to_address = params[:to_address] - subject = params[:subject] - message = params[:message] - if to_address.blank? - flash[:error] = message('email_configuration.test.to_address_required') - else - begin - java_facade.getComponentByClassname('emailnotifications', 'org.sonar.plugins.emailnotifications.EmailNotificationChannel').sendTestEmail(to_address, subject, message) - flash[:notice] = message('email_configuration.test.email_was_sent_to_x', :params => [to_address]) - rescue Exception => e - flash[:error] = e.message - end - end - redirect_to :action => 'index' + to_address = params[:to_address] + subject = params[:subject] + message = params[:message] + if to_address.blank? + flash[:error] = message('email_configuration.test.to_address_required') + else + begin + java_facade.getComponentByClassname('emailnotifications', 'org.sonar.plugins.emailnotifications.EmailNotificationChannel').sendTestEmail(to_address, subject, message) + flash[:notice] = message('email_configuration.test.email_was_sent_to_x', :params => [to_address]) + rescue Exception => e + flash[:error] = e.message + end + end + redirect_to :action => 'index' end private def configuration - java_facade.getComponentByClassname('emailnotifications', 'org.sonar.api.config.EmailSettings').class + java_facade.getComponentByClassname('emailnotifications', 'org.sonar.api.config.EmailSettings').class end end -- 2.39.5