RE: LDAP authentication with user binding » patch0.patch
| app/models/auth_source_ldap.rb | ||
|---|---|---|
|
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
|
||
|
|
||
| ... | ... | |
|
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
|
||
| app/views/auth_sources/_form.rhtml | ||
|---|---|---|
|
<p><label for="auth_source_port"><%=l(:field_port)%> <span class="required">*</span></label>
|
||
|
<%= text_field 'auth_source', 'port', :size => 6 %> <%= check_box 'auth_source', 'tls' %> LDAPS</p>
|
||
|
<p><label for="auth_source_domain"><%=l(:field_domain)%></label>
|
||
|
<%= text_field 'auth_source', 'domain' %></p>
|
||
|
<p><label for="auth_source_account"><%=l(:field_account)%></label>
|
||
|
<%= text_field 'auth_source', 'account' %></p>
|
||
| config/locales/bg.yml | ||
|---|---|---|
|
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
|
||
|
|
||
| config/locales/bs.yml | ||
|---|---|---|
|
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
|
||
| config/locales/ca.yml | ||
|---|---|---|
|
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
|
||
| config/locales/cs.yml | ||
|---|---|---|
|
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
|
||
| config/locales/da.yml | ||
|---|---|---|
|
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
|
||
| config/locales/de.yml | ||
|---|---|---|
|
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
|
||
| config/locales/el.yml | ||
|---|---|---|
|
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
|
||
| config/locales/en.yml | ||
|---|---|---|
|
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
|
||
| config/locales/es.yml | ||
|---|---|---|
|
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
|
||
| config/locales/fi.yml | ||
|---|---|---|
|
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
|
||
| config/locales/fr.yml | ||
|---|---|---|
|
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é
|
||
| config/locales/gl.yml | ||
|---|---|---|
|
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
|
||
| config/locales/he.yml | ||
|---|---|---|
|
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
|
||
| config/locales/hu.yml | ||
|---|---|---|
|
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
|
||
| config/locales/id.yml | ||
|---|---|---|
|
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
|
||
| config/locales/it.yml | ||
|---|---|---|
|
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
|
||
|
|
||
| config/locales/ja.yml | ||
|---|---|---|
|
enumeration_doc_categories: 文書カテゴリ
|
||
|
enumeration_activities: 作業分類 (時間トラッキング)
|
||
|
enumeration_system_activity: システム作業分類
|
||
|
field_domain: Domain
|
||
|
permission_manage_project_activities: Manage project activities
|
||
| config/locales/ko.yml | ||
|---|---|---|
|
권한들 일부 또는 전부를 막 삭제하려고 하고 있습니다. 그렇게 되면 이 프로젝트를 더이상 수정할 수 없게 됩니다.
|
||
|
계속하시겠습니까?
|
||
|
label_close_versions: 완료된 버전 닫기
|
||
|
field_domain: Domain
|
||
|
label_board_sticky: Sticky
|
||
|
label_board_locked: Locked
|
||
|
permission_export_wiki_pages: Export wiki pages
|
||
| config/locales/lt.yml | ||
|---|---|---|
|
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
|
||
| config/locales/nl.yml | ||
|---|---|---|
|
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
|
||
| config/locales/no.yml | ||
|---|---|---|
|
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
|
||
| config/locales/pl.yml | ||
|---|---|---|
|
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
|
||
| config/locales/pt-BR.yml | ||
|---|---|---|
|
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
|
||
| config/locales/pt.yml | ||
|---|---|---|
|
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
|
||
| config/locales/ro.yml | ||
|---|---|---|
|
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
|
||
| config/locales/ru.yml | ||
|---|---|---|
|
Вы собираетесь удалить некоторые или все права, из-за чего могут пропасть права на редактирование этого проекта.
|
||
|
Продолжить?
|
||
|
label_close_versions: Закрыть завершенные версии
|
||
|
field_domain: Domain
|
||
|
label_board_sticky: Прикреплена
|
||
|
label_board_locked: Заблокирована
|
||
|
permission_export_wiki_pages: Export wiki pages
|
||
| config/locales/sk.yml | ||
|---|---|---|
|
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
|
||
| config/locales/sl.yml | ||
|---|---|---|
|
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
|
||
| config/locales/sr.yml | ||
|---|---|---|
|
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
|
||
| config/locales/sv.yml | ||
|---|---|---|
|
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
|
||
| config/locales/th.yml | ||
|---|---|---|
|
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
|
||
| config/locales/tr.yml | ||
|---|---|---|
|
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
|
||
| config/locales/uk.yml | ||
|---|---|---|
|
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
|
||
| config/locales/vi.yml | ||
|---|---|---|
|
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
|
||
| config/locales/zh-TW.yml | ||
|---|---|---|
|
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
|
||
| config/locales/zh.yml | ||
|---|---|---|
|
field_port: 端口
|
||
|
field_account: 帐号
|
||
|
field_base_dn: Base DN
|
||
|
field_domain: Domain
|
||
|
field_attr_login: 登录名属性
|
||
|
field_attr_firstname: 名字属性
|
||
|
field_attr_lastname: 姓氏属性
|
||
| db/migrate/20100115124427_add_auth_sources_domain.rb | ||
|---|---|---|
|
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
|
||