]> source.dussan.org Git - redmine.git/commitdiff
Added LDAPS support migration and fixed connection test flash messages.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 16 Oct 2007 19:19:10 +0000 (19:19 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 16 Oct 2007 19:19:10 +0000 (19:19 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@845 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/auth_sources_controller.rb
db/migrate/074_add_auth_sources_tls.rb [new file with mode: 0644]

index 86b58d3655d2f897791ea14097adef89ef29a662..b830f19702a86497a03ca6af5221875fb4ee8778 100644 (file)
@@ -65,10 +65,10 @@ class AuthSourcesController < ApplicationController
     @auth_method = AuthSource.find(params[:id])
     begin
       @auth_method.test_connection
+      flash[:notice] = l(:notice_successful_connection)
     rescue => text
-      flash[:notice] = text
+      flash[:error] = "Unable to connect (#{text})"
     end
-    flash[:notice] ||= l(:notice_successful_connection)
     redirect_to :action => 'list'
   end
 
diff --git a/db/migrate/074_add_auth_sources_tls.rb b/db/migrate/074_add_auth_sources_tls.rb
new file mode 100644 (file)
index 0000000..3987f70
--- /dev/null
@@ -0,0 +1,9 @@
+class AddAuthSourcesTls < ActiveRecord::Migration
+  def self.up
+    add_column :auth_sources, :tls, :boolean, :default => false, :null => false
+  end
+
+  def self.down
+    remove_column :auth_sources, :tls
+  end
+end