Index: app/views/auth_sources/index.html.erb =================================================================== --- app/views/auth_sources/index.html.erb (revision 11979) +++ app/views/auth_sources/index.html.erb (working copy) @@ -8,7 +8,7 @@ <%=l(:field_name)%> <%=l(:field_type)%> - <%=l(:field_host)%> + <%=l(:field_hosts)%> <%=l(:label_user_plural)%> @@ -17,7 +17,7 @@ "> <%= link_to(h(source.name), :action => 'edit', :id => source)%> <%= h source.auth_method_name %> - <%= h source.host %> + <%= h source.hosts %> <%= h source.users.count %> <%= link_to l(:button_test), try_connection_auth_source_path(source), :class => 'icon icon-test' %> Index: app/views/auth_sources/_form_auth_source_ldap.html.erb =================================================================== --- app/views/auth_sources/_form_auth_source_ldap.html.erb (revision 11979) +++ app/views/auth_sources/_form_auth_source_ldap.html.erb (working copy) @@ -2,7 +2,7 @@

<%= f.text_field :name, :required => true %>

-

<%= f.text_field :host, :required => true %>

+

<%= f.text_field :hosts, :size => 60, :required => true %>

<%= f.text_field :port, :required => true, :size => 6 %> <%= f.check_box :tls, :no_label => true %> LDAPS

<%= f.text_field :account %>

<%= f.password_field :account_password, :label => :field_password, Index: app/models/auth_source_ldap.rb =================================================================== --- app/models/auth_source_ldap.rb (revision 11979) +++ app/models/auth_source_ldap.rb (working copy) @@ -20,8 +20,9 @@ require 'timeout' class AuthSourceLdap < AuthSource - validates_presence_of :host, :port, :attr_login - validates_length_of :name, :host, :maximum => 60, :allow_nil => true + validates_presence_of :hosts, :port, :attr_login + validates_length_of :name, :maximum => 60, :allow_nil => true + validates_length_of :hosts, :maximum => 120, :allow_nil => true validates_length_of :account, :account_password, :base_dn, :filter, :maximum => 255, :allow_blank => true validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30, :allow_nil => true validates_numericality_of :port, :only_integer => true @@ -51,12 +52,7 @@ # test the connection to the LDAP def test_connection - with_timeout do - ldap_con = initialize_ldap_con(self.account, self.account_password) - ldap_con.open { } - end - rescue Net::LDAP::LdapError => e - raise AuthSourceException.new(e.message) + initialize_ldap_con(self.account, self.account_password) end def auth_method_name @@ -130,12 +126,27 @@ end def initialize_ldap_con(ldap_user, ldap_password) - options = { :host => self.host, + options = { :host => "", :port => self.port, :encryption => (self.tls ? :simple_tls : nil) } options.merge!(:auth => { :method => :simple, :username => ldap_user, :password => ldap_password }) unless ldap_user.blank? && ldap_password.blank? - Net::LDAP.new options + + m = nil + self.hosts.split(",").reverse.each do |host| + begin + options[:host] = host + ldap_con = Net::LDAP.new options + with_timeout do + ldap_con.open { } + end + return ldap_con + rescue Exception => e + logger.warn e.message if logger && logger.warn? + m = e.message + end + end + raise AuthSourceException.new(m) end def get_user_attributes_from_ldap_entry(entry) Index: config/locales/uk.yml =================================================================== --- config/locales/uk.yml (revision 11979) +++ config/locales/uk.yml (working copy) @@ -226,7 +226,7 @@ field_password_confirmation: Підтвердження field_version: Версія field_type: Тип - field_host: Машина + field_hosts: Машина field_port: Порт field_account: Обліковий запис field_base_dn: Базове відмітне ім'я Index: config/locales/pt-BR.yml =================================================================== --- config/locales/pt-BR.yml (revision 11979) +++ config/locales/pt-BR.yml (working copy) @@ -258,7 +258,7 @@ field_password_confirmation: Confirmação field_version: Versão field_type: Tipo - field_host: Servidor + field_hosts: Servidor field_port: Porta field_account: Conta field_base_dn: DN Base Index: config/locales/fa.yml =================================================================== --- config/locales/fa.yml (revision 11979) +++ config/locales/fa.yml (working copy) @@ -261,7 +261,7 @@ field_password_confirmation: بررسی گذرواژه field_version: نگارش field_type: گونه - field_host: میزبان + field_hosts: میزبان field_port: درگاه field_account: حساب field_base_dn: DN پایه Index: config/locales/bg.yml =================================================================== --- config/locales/bg.yml (revision 11979) +++ config/locales/bg.yml (working copy) @@ -270,7 +270,7 @@ field_password_confirmation: Потвърждение field_version: Версия field_type: Тип - field_host: Хост + field_hosts: Хост field_port: Порт field_account: Профил field_base_dn: Base DN Index: config/locales/ja.yml =================================================================== --- config/locales/ja.yml (revision 11979) +++ config/locales/ja.yml (working copy) @@ -291,7 +291,7 @@ field_password_confirmation: パスワードの確認 field_version: バージョン field_type: タイプ - field_host: ホスト + field_hosts: ホスト field_port: ポート field_account: アカウント field_base_dn: 検索範囲 Index: config/locales/fi.yml =================================================================== --- config/locales/fi.yml (revision 11979) +++ config/locales/fi.yml (working copy) @@ -257,7 +257,7 @@ field_password_confirmation: Vahvistus field_version: Versio field_type: Tyyppi - field_host: Verkko-osoite + field_hosts: Verkko-osoite field_port: Portti field_account: Tili field_base_dn: Base DN Index: config/locales/bs.yml =================================================================== --- config/locales/bs.yml (revision 11979) +++ config/locales/bs.yml (working copy) @@ -250,7 +250,7 @@ field_password_confirmation: Potvrda field_version: Verzija field_type: Tip - field_host: Host + field_hosts: Host field_port: Port field_account: Korisnički račun field_base_dn: Base DN Index: config/locales/fr.yml =================================================================== --- config/locales/fr.yml (revision 11979) +++ config/locales/fr.yml (working copy) @@ -277,7 +277,7 @@ field_password_confirmation: Confirmation field_version: Version field_type: Type - field_host: Hôte + field_hosts: Hôte field_port: Port field_account: Compte field_base_dn: Base DN Index: config/locales/nl.yml =================================================================== --- config/locales/nl.yml (revision 11979) +++ config/locales/nl.yml (working copy) @@ -229,7 +229,7 @@ field_fixed_version: Versie field_hide_mail: Verberg mijn e-mailadres field_homepage: Homepage - field_host: Host + field_hosts: Host field_hours: Uren field_identifier: Identificatiecode field_is_closed: Issue gesloten Index: config/locales/no.yml =================================================================== --- config/locales/no.yml (revision 11979) +++ config/locales/no.yml (working copy) @@ -226,7 +226,7 @@ field_password_confirmation: Bekreft passord field_version: Versjon field_type: Type - field_host: Vert + field_hosts: Vert field_port: Port field_account: Konto field_base_dn: Base DN Index: config/locales/vi.yml =================================================================== --- config/locales/vi.yml (revision 11979) +++ config/locales/vi.yml (working copy) @@ -289,7 +289,7 @@ field_password_confirmation: Nhập lại mật khẩu field_version: Phiên bản field_type: Kiểu - field_host: Host + field_hosts: Host field_port: Cổng field_account: Tài khoản field_base_dn: Base DN Index: config/locales/ro.yml =================================================================== --- config/locales/ro.yml (revision 11979) +++ config/locales/ro.yml (working copy) @@ -234,7 +234,7 @@ field_password_confirmation: Confirmare field_version: Versiune field_type: Tip - field_host: Gazdă + field_hosts: Gazdă field_port: Port field_account: Cont field_base_dn: Base DN Index: config/locales/zh.yml =================================================================== --- config/locales/zh.yml (revision 11979) +++ config/locales/zh.yml (working copy) @@ -265,7 +265,7 @@ field_password_confirmation: 确认 field_version: 版本 field_type: 类型 - field_host: 主机 + field_hosts: 主机 field_port: 端口 field_account: 帐号 field_base_dn: Base DN Index: config/locales/ca.yml =================================================================== --- config/locales/ca.yml (revision 11979) +++ config/locales/ca.yml (working copy) @@ -262,7 +262,7 @@ field_password_confirmation: Confirmació field_version: Versió field_type: Tipus - field_host: Ordinador + field_hosts: Ordinador field_port: Port field_account: Compte field_base_dn: Base DN Index: config/locales/ru.yml =================================================================== --- config/locales/ru.yml (revision 11979) +++ config/locales/ru.yml (working copy) @@ -332,7 +332,7 @@ field_fixed_version: Версия field_hide_mail: Скрывать мой email field_homepage: Стартовая страница - field_host: Компьютер + field_hosts: Компьютер field_hours: час(а,ов) field_identifier: Уникальный идентификатор field_identity_url: OpenID URL Index: config/locales/gl.yml =================================================================== --- config/locales/gl.yml (revision 11979) +++ config/locales/gl.yml (working copy) @@ -258,7 +258,7 @@ field_fixed_version: Versión prevista field_hide_mail: Ocultar a miña dirección de correo field_homepage: Sitio web - field_host: Anfitrión + field_hosts: Anfitrión field_hours: Horas field_identifier: Identificador field_is_closed: Petición resolta Index: config/locales/cs.yml =================================================================== --- config/locales/cs.yml (revision 11979) +++ config/locales/cs.yml (working copy) @@ -266,7 +266,7 @@ field_password_confirmation: Potvrzení field_version: Verze field_type: Typ - field_host: Host + field_hosts: Host field_port: Port field_account: Účet field_base_dn: Base DN Index: config/locales/ko.yml =================================================================== --- config/locales/ko.yml (revision 11979) +++ config/locales/ko.yml (working copy) @@ -290,7 +290,7 @@ field_password_confirmation: 비밀번호 확인 field_version: 버전 field_type: 방식 - field_host: 호스트 + field_hosts: 호스트 field_port: 포트 field_account: 계정 field_base_dn: 기본 DN Index: config/locales/sk.yml =================================================================== --- config/locales/sk.yml (revision 11979) +++ config/locales/sk.yml (working copy) @@ -232,7 +232,7 @@ field_password_confirmation: Potvrdenie field_version: Verzia field_type: Typ - field_host: Host + field_hosts: Host field_port: Port field_account: Účet field_base_dn: Base DN Index: config/locales/sl.yml =================================================================== --- config/locales/sl.yml (revision 11979) +++ config/locales/sl.yml (working copy) @@ -236,7 +236,7 @@ field_password_confirmation: Potrditev field_version: Verzija field_type: Tip - field_host: Gostitelj + field_hosts: Gostitelj field_port: Vrata field_account: Račun field_base_dn: Bazni DN Index: config/locales/sr-YU.yml =================================================================== --- config/locales/sr-YU.yml (revision 11979) +++ config/locales/sr-YU.yml (working copy) @@ -262,7 +262,7 @@ field_password_confirmation: Potvrda lozinke field_version: Verzija field_type: Tip - field_host: Glavni računar + field_hosts: Glavni računar field_port: Port field_account: Korisnički nalog field_base_dn: Bazni DN Index: config/locales/sq.yml =================================================================== --- config/locales/sq.yml (revision 11979) +++ config/locales/sq.yml (working copy) @@ -267,7 +267,7 @@ field_password_confirmation: Konfirmim Fjalekalimi field_version: Versioni field_type: Type - field_host: Host + field_hosts: Host field_port: Port field_account: Llogaria field_base_dn: Base DN Index: config/locales/da.yml =================================================================== --- config/locales/da.yml (revision 11979) +++ config/locales/da.yml (working copy) @@ -249,7 +249,7 @@ field_password_confirmation: Bekræft field_version: Version field_type: Type - field_host: Vært + field_hosts: Vært field_port: Port field_account: Kode field_base_dn: Base DN Index: config/locales/sr.yml =================================================================== --- config/locales/sr.yml (revision 11979) +++ config/locales/sr.yml (working copy) @@ -260,7 +260,7 @@ field_password_confirmation: Потврда лозинке field_version: Верзија field_type: Тип - field_host: Главни рачунар + field_hosts: Главни рачунар field_port: Порт field_account: Кориснички налог field_base_dn: Базни DN Index: config/locales/sv.yml =================================================================== --- config/locales/sv.yml (revision 11979) +++ config/locales/sv.yml (working copy) @@ -312,7 +312,7 @@ field_password_confirmation: Bekräfta lösenord field_version: Version field_type: Typ - field_host: Värddator + field_hosts: Värddator field_port: Port field_account: Konto field_base_dn: Bas-DN Index: config/locales/en-GB.yml =================================================================== --- config/locales/en-GB.yml (revision 11979) +++ config/locales/en-GB.yml (working copy) @@ -266,7 +266,7 @@ field_password_confirmation: Confirmation field_version: Version field_type: Type - field_host: Host + field_hosts: Host field_port: Port field_account: Account field_base_dn: Base DN Index: config/locales/de.yml =================================================================== --- config/locales/de.yml (revision 11979) +++ config/locales/de.yml (working copy) @@ -53,8 +53,8 @@ one: 'etwa 1 Stunde' other: 'etwa %{count} Stunden' x_hours: - one: "1 Stunde" - other: "%{count} Stunden" + one: "1 hour" + other: "%{count} hours" x_days: one: '1 Tag' other: '%{count} Tagen' @@ -312,7 +312,7 @@ field_group_by: Gruppiere Ergebnisse nach field_hide_mail: E-Mail-Adresse nicht anzeigen field_homepage: Projekt-Homepage - field_host: Host + field_hosts: Hosts field_hours: Stunden field_identifier: Kennung field_identity_url: OpenID-URL Index: config/locales/he.yml =================================================================== --- config/locales/he.yml (revision 11979) +++ config/locales/he.yml (working copy) @@ -265,7 +265,7 @@ field_password_confirmation: אישור field_version: גירסה field_type: סוג - field_host: שרת + field_hosts: שרת field_port: פורט field_account: חשבון field_base_dn: בסיס DN Index: config/locales/zh-TW.yml =================================================================== --- config/locales/zh-TW.yml (revision 11979) +++ config/locales/zh-TW.yml (working copy) @@ -354,7 +354,7 @@ field_password_confirmation: 確認新密碼 field_version: 版本 field_type: Type - field_host: Host + field_hosts: Host field_port: 連接埠 field_account: 帳戶 field_base_dn: Base DN Index: config/locales/hr.yml =================================================================== --- config/locales/hr.yml (revision 11979) +++ config/locales/hr.yml (working copy) @@ -247,7 +247,7 @@ field_password_confirmation: Potvrda zaporke field_version: Verzija field_type: Tip - field_host: Host + field_hosts: Host field_port: Port field_account: Racun field_base_dn: Osnovni DN Index: config/locales/pl.yml =================================================================== --- config/locales/pl.yml (revision 11979) +++ config/locales/pl.yml (working copy) @@ -250,7 +250,7 @@ field_fixed_version: Wersja docelowa field_hide_mail: Ukryj mój adres e-mail field_homepage: Strona www - field_host: Host + field_hosts: Host field_hours: Godzin field_identifier: Identyfikator field_is_closed: Zagadnienie zamknięte Index: config/locales/th.yml =================================================================== --- config/locales/th.yml (revision 11979) +++ config/locales/th.yml (working copy) @@ -232,7 +232,7 @@ field_password_confirmation: ยืนยันรหัสผ่าน field_version: รุ่น field_type: ชนิด - field_host: โฮสต์ + field_hosts: โฮสต์ field_port: พอร์ต field_account: บัญชี field_base_dn: Base DN Index: config/locales/hu.yml =================================================================== --- config/locales/hu.yml (revision 11979) +++ config/locales/hu.yml (working copy) @@ -255,7 +255,7 @@ field_password_confirmation: Megerősítés field_version: Verzió field_type: Típus - field_host: Kiszolgáló + field_hosts: Kiszolgáló field_port: Port field_account: Felhasználói fiók field_base_dn: Base DN Index: config/locales/lt.yml =================================================================== --- config/locales/lt.yml (revision 11979) +++ config/locales/lt.yml (working copy) @@ -323,7 +323,7 @@ field_password_confirmation: Patvirtinimas field_version: Versija field_type: Tipas - field_host: Pagrindinis kompiuteris + field_hosts: Pagrindinis kompiuteris field_port: Prievadas field_account: Paskyra field_base_dn: Bazinis skiriamasis vardas (base DN) Index: config/locales/lv.yml =================================================================== --- config/locales/lv.yml (revision 11979) +++ config/locales/lv.yml (working copy) @@ -246,7 +246,7 @@ field_password_confirmation: Paroles apstiprinājums field_version: Versija field_type: Tips - field_host: Hosts + field_hosts: Hosts field_port: Ports field_account: Konts field_base_dn: Base DN Index: config/locales/pt.yml =================================================================== --- config/locales/pt.yml (revision 11979) +++ config/locales/pt.yml (working copy) @@ -246,7 +246,7 @@ field_password_confirmation: Confirmação field_version: Versão field_type: Tipo - field_host: Servidor + field_hosts: Servidor field_port: Porta field_account: Conta field_base_dn: Base DN Index: config/locales/tr.yml =================================================================== --- config/locales/tr.yml (revision 11979) +++ config/locales/tr.yml (working copy) @@ -256,7 +256,7 @@ field_password_confirmation: Onay field_version: Sürüm field_type: Tip - field_host: Host + field_hosts: Host field_port: Port field_account: Hesap field_base_dn: Base DN Index: config/locales/id.yml =================================================================== --- config/locales/id.yml (revision 11979) +++ config/locales/id.yml (working copy) @@ -247,7 +247,7 @@ field_password_confirmation: Konfirmasi field_version: Versi field_type: Tipe - field_host: Host + field_hosts: Host field_port: Port field_account: Akun field_base_dn: Base DN Index: config/locales/el.yml =================================================================== --- config/locales/el.yml (revision 11979) +++ config/locales/el.yml (working copy) @@ -246,7 +246,7 @@ field_password_confirmation: Επιβεβαίωση field_version: Έκδοση field_type: Τύπος - field_host: Κόμβος + field_hosts: Κόμβος field_port: Θύρα field_account: Λογαριασμός field_base_dn: Βάση DN Index: config/locales/ar.yml =================================================================== --- config/locales/ar.yml (revision 11979) +++ config/locales/ar.yml (working copy) @@ -264,7 +264,7 @@ field_password_confirmation: تأكيد field_version: إصدار field_type: نوع - field_host: المضيف + field_hosts: المضيف field_port: المنفذ field_account: الحساب field_base_dn: DN قاعدة Index: config/locales/en.yml =================================================================== --- config/locales/en.yml (revision 11979) +++ config/locales/en.yml (working copy) @@ -269,7 +269,7 @@ field_password_confirmation: Confirmation field_version: Version field_type: Type - field_host: Host + field_hosts: Hosts field_port: Port field_account: Account field_base_dn: Base DN Index: config/locales/es.yml =================================================================== --- config/locales/es.yml (revision 11979) +++ config/locales/es.yml (working copy) @@ -283,7 +283,7 @@ field_fixed_version: Versión prevista field_hide_mail: Ocultar mi dirección de correo field_homepage: Sitio web - field_host: Anfitrión + field_hosts: Anfitrión field_hours: Horas field_identifier: Identificador field_is_closed: Petición resuelta Index: config/locales/mk.yml =================================================================== --- config/locales/mk.yml (revision 11979) +++ config/locales/mk.yml (working copy) @@ -260,7 +260,7 @@ field_password_confirmation: Потврда field_version: Верзија field_type: Тип - field_host: Хост + field_hosts: Хост field_port: Порт field_account: Account field_base_dn: Base DN Index: config/locales/et.yml =================================================================== --- config/locales/et.yml (revision 11979) +++ config/locales/et.yml (working copy) @@ -284,7 +284,7 @@ field_password_confirmation: "Kinnitus" field_version: "Versioon" field_type: "Tüüp" - field_host: "Server" + field_hosts: "Server" field_port: "Port" field_account: "Konto" field_base_dn: "Baas DN" Index: config/locales/eu.yml =================================================================== --- config/locales/eu.yml (revision 11979) +++ config/locales/eu.yml (working copy) @@ -254,7 +254,7 @@ field_password_confirmation: Berrespena field_version: Bertsioa field_type: Mota - field_host: Ostalaria + field_hosts: Ostalaria field_port: Portua field_account: Kontua field_base_dn: Base DN Index: config/locales/az.yml =================================================================== --- config/locales/az.yml (revision 11979) +++ config/locales/az.yml (working copy) @@ -322,7 +322,7 @@ field_fixed_version: Variant field_hide_mail: E-poçtumu gizlət field_homepage: Başlanğıc səhifə - field_host: Kompyuter + field_hosts: Kompyuter field_hours: saat field_identifier: Unikal identifikator field_identity_url: OpenID URL Index: config/locales/mn.yml =================================================================== --- config/locales/mn.yml (revision 11979) +++ config/locales/mn.yml (working copy) @@ -252,7 +252,7 @@ field_password_confirmation: Баталгаажуулах field_version: Хувилбар field_type: Төрөл - field_host: Хост + field_hosts: Хост field_port: Порт field_account: Данс field_base_dn: Үндсэн ДН Index: config/locales/it.yml =================================================================== --- config/locales/it.yml (revision 11979) +++ config/locales/it.yml (working copy) @@ -228,7 +228,7 @@ field_password_confirmation: Conferma field_version: Versione field_type: Tipo - field_host: Host + field_hosts: Host field_port: Porta field_account: Utente field_base_dn: DN base