diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index a619b2f..399e61e 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -21,7 +21,7 @@ require 'iconv' class AuthSourceLdap < AuthSource validates_presence_of :host, :port, :attr_login validates_length_of :name, :host, :account_password, :maximum => 60, :allow_nil => true - validates_length_of :account, :base_dn, :maximum => 255, :allow_nil => true + validates_length_of :account, :domain, :base_dn, :maximum => 255, :allow_nil => true validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30, :allow_nil => true validates_numericality_of :port, :only_integer => true @@ -35,7 +35,7 @@ class AuthSourceLdap < AuthSource return nil if login.blank? || password.blank? attrs = [] # get user's DN - ldap_con = initialize_ldap_con(self.account, self.account_password) + domain.blank? ? ldap_con = initialize_ldap_con(self.account, self.account_password) : ldap_con = initialize_ldap_con(domain + "\\" + login, password); login_filter = Net::LDAP::Filter.eq( self.attr_login, login ) object_filter = Net::LDAP::Filter.eq( "objectClass", "*" ) dn = String.new diff --git a/app/views/auth_sources/_form.rhtml b/app/views/auth_sources/_form.rhtml index 9ffffaf..f023bce 100644 --- a/app/views/auth_sources/_form.rhtml +++ b/app/views/auth_sources/_form.rhtml @@ -11,6 +11,9 @@

<%= text_field 'auth_source', 'port', :size => 6 %> <%= check_box 'auth_source', 'tls' %> LDAPS

+

+<%= text_field 'auth_source', 'domain' %>

+

<%= text_field 'auth_source', 'account' %>

diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 2a68101..e755438 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -876,9 +876,9 @@ bg: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities - \ No newline at end of file diff --git a/config/locales/bs.yml b/config/locales/bs.yml index edfd1f6..50de765 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -900,6 +900,7 @@ bs: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 12d3632..084aced 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -879,6 +879,7 @@ ca: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 202ba3b..a381261 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -882,6 +882,7 @@ cs: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/da.yml b/config/locales/da.yml index ff76caa..4139d62 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -902,6 +902,7 @@ da: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/de.yml b/config/locales/de.yml index f3d87fd..7aecc30 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -902,6 +902,7 @@ de: Sie sind dabei, einige oder alle ihre Berechtigungen zu entfernen. Es ist möglich, dass Sie danach das Projekt nicht mehr sehen oder editieren dürfen. Sind Sie wirklich sicher, dass Sie dies tun möchten? label_close_versions: Vollständige Versionen schließen + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/el.yml b/config/locales/el.yml index 5ab7e62..3b5d7c7 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -882,6 +882,7 @@ el: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/en.yml b/config/locales/en.yml index 2ee57bc..d3ab055 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -241,6 +241,7 @@ en: field_port: Port field_account: Account field_base_dn: Base DN + field_domain: Domain field_attr_login: Login attribute field_attr_firstname: Firstname attribute field_attr_lastname: Lastname attribute diff --git a/config/locales/es.yml b/config/locales/es.yml index 5c77c71..83a63c4 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -262,6 +262,7 @@ es: field_default_value: Estado por defecto field_delay: Retraso field_description: Descripción + field_domain: Domain field_done_ratio: % Realizado field_downloads: Descargas field_due_date: Fecha fin diff --git a/config/locales/fi.yml b/config/locales/fi.yml index d26c985..c42e849 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -912,6 +912,7 @@ fi: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 636a588..49a0d77 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -906,5 +906,6 @@ fr: text_journal_deleted: "{{label}} {{old}} supprimé" text_journal_added: "{{label}} {{value}} ajouté" enumeration_system_activity: Activité système + field_domain: Domain label_board_sticky: Sticky label_board_locked: Verrouillé diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 92356c3..84c62e8 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -902,6 +902,7 @@ gl: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/he.yml b/config/locales/he.yml index eb068f7..e49d035 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -886,6 +886,7 @@ he: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 99a475e..5f54366 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -907,6 +907,7 @@ You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/id.yml b/config/locales/id.yml index 79e4d36..9655762 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -894,6 +894,7 @@ id: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/it.yml b/config/locales/it.yml index 4e52a3d..1418d7c 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -889,9 +889,9 @@ it: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities - \ No newline at end of file diff --git a/config/locales/ja.yml b/config/locales/ja.yml index ce5d87e..34e42fd 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -915,4 +915,5 @@ ja: enumeration_doc_categories: 文書カテゴリ enumeration_activities: 作業分類 (時間トラッキング) enumeration_system_activity: システム作業分類 + field_domain: Domain permission_manage_project_activities: Manage project activities diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 7d389a9..d5d73db 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -942,6 +942,7 @@ ko: 권한들 일부 또는 전부를 막 삭제하려고 하고 있습니다. 그렇게 되면 이 프로젝트를 더이상 수정할 수 없게 됩니다. 계속하시겠습니까? label_close_versions: 완료된 버전 닫기 + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 4c5be32..e1a6e88 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -950,6 +950,7 @@ lt: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/nl.yml b/config/locales/nl.yml index bb2b8dd..3ae829a 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -864,6 +864,7 @@ nl: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/no.yml b/config/locales/no.yml index ee84633..be303ed 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -877,6 +877,7 @@ You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 2492e6e..f95a4f8 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -906,7 +906,8 @@ pl: version_status_closed: zamknięta version_status_locked: zablokowana version_status_open: otwarta - + + field_domain: Domain label_board_sticky: Przyklejona label_board_locked: Zamknięta permission_export_wiki_pages: Eksport stron wiki diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index a708273..b86a9ed 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -909,6 +909,7 @@ pt-BR: Você está para remover algumas de suas próprias permissões e pode não mais estar apto a editar este projeto após esta operação. Você tem certeza que deseja continuar? label_close_versions: Fechar versões concluídas + field_domain: Domain label_board_sticky: Marcado label_board_locked: Travado label_change_log: Registro de alterações diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 7c22dff..b9fa202 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -894,6 +894,7 @@ pt: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/ro.yml b/config/locales/ro.yml index d7b115e..42a8e4b 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -879,6 +879,7 @@ ro: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 2017f62..9805ce7 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -990,6 +990,7 @@ ru: Вы собираетесь удалить некоторые или все права, из-за чего могут пропасть права на редактирование этого проекта. Продолжить? label_close_versions: Закрыть завершенные версии + field_domain: Domain label_board_sticky: Прикреплена label_board_locked: Заблокирована permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/sk.yml b/config/locales/sk.yml index f2baf51..f583ed9 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -881,6 +881,7 @@ sk: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 2d5279f..0cc81ca 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -878,6 +878,7 @@ sl: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 135715f..15cdeb9 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -897,6 +897,7 @@ You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/sv.yml b/config/locales/sv.yml index c073b93..3d85728 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -933,6 +933,7 @@ sv: enumeration_doc_categories: Dokumentkategorier enumeration_activities: Aktiviteter (tidsuppföljning) enumeration_system_activity: Systemaktivitet + field_domain: Domain permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities diff --git a/config/locales/th.yml b/config/locales/th.yml index 557ad2c..97b1a14 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -879,6 +879,7 @@ th: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/tr.yml b/config/locales/tr.yml index c90661a..865fe99 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -909,6 +909,7 @@ tr: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/uk.yml b/config/locales/uk.yml index f4e012d..25d0c8c 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -878,6 +878,7 @@ uk: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 5dfb504..49d6f61 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -941,6 +941,7 @@ vi: You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions + field_domain: Domain label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 4a64e2e..7dc4230 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -975,6 +975,7 @@ enumeration_doc_categories: 文件分類 enumeration_activities: 活動 (時間追蹤) enumeration_system_activity: 系統活動 + field_domain: Domain permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 3e87d0a..d4d2376 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -265,6 +265,7 @@ zh: field_port: 端口 field_account: 帐号 field_base_dn: Base DN + field_domain: Domain field_attr_login: 登录名属性 field_attr_firstname: 名字属性 field_attr_lastname: 姓氏属性 diff --git a/db/migrate/20100115124427_add_auth_sources_domain.rb b/db/migrate/20100115124427_add_auth_sources_domain.rb new file mode 100644 index 0000000..72c157d --- /dev/null +++ b/db/migrate/20100115124427_add_auth_sources_domain.rb @@ -0,0 +1,9 @@ +class AddAuthSourcesDomain < ActiveRecord::Migration + def self.up + add_column :auth_sources, :domain, :string, :default => '', :null => true + end + + def self.down + remove_column :auth_sources, :domain + end +end