]> source.dussan.org Git - sonarqube.git/commitdiff
Fix tabs/spaces
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 12 May 2014 15:01:32 +0000 (17:01 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 12 May 2014 15:29:14 +0000 (17:29 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb

index 054fa3d518bb5ab54d4c616920386ffd11297302..8d217f8efad91b3a14a243b3434f538c5ec2ab68 100644 (file)
@@ -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