Fixes in plugin

web-from-alpine
Terekhin Alexandr 5 years ago
parent 5463b603d6
commit ff5e19e8d0
  1. 2
      ldap.env
  2. 9
      redmine/999_config_ldap.rb
  3. 2
      redmine/redmine_ldap_passwd/app/models/auth_source_ldap_passwd.rb

@ -1,2 +1,2 @@
#LDAP_BASE_DN="o=example,c=org"
LDAP_ADMIN_PASSWORD="admin"
LDAP_ADMIN_PASSWORD=admin

@ -6,7 +6,7 @@ class Setup < ActiveRecord::Migration[4.2]
# or auth_source_ldap.rb
# in path /usr/src/redmine/app/models
class AuthSource < ActiveRecord::Base
class AuthSourceLdap < ActiveRecord::Base
end
def self.up
@ -44,19 +44,20 @@ class Setup < ActiveRecord::Migration[4.2]
# 'timeout')
# create default administrator account
auth = AuthSource.new
auth = AuthSourceLdap.create
auth.type = "AuthSourceLdap"
auth.name = "ldap"
auth.host = ENV["REDMINE_LDAP"]
auth.port = 389
auth.account = "admin"
auth.account = "cn=admin,dc=example,dc=org"
auth.account_password = ENV["LDAP_ADMIN_PASSWORD"]
auth.base_dn = ENV["LDAP_BASE_DN"]
auth.attr_login = "uid"
auth.attr_firstname = "givenName"
auth.attr_lastname = "sn"
auth.attr_mail = "mail"
auth.onthefly_register = true
auth.onthefly_register = 1
auth.save

@ -40,7 +40,7 @@ class AuthSourceLdapPasswd < AuthSourceLdap
def self.change_password_allowed?(user)
return false if user.nil?
AuthSourceLdapPasswd.name.eql?(user.auth_source.type)
AuthSourceLdapPasswd.name.eql?( user.auth_source .nil? ? "" : user.auth_source.type)
end
def self.is_password_valid(password)

Loading…
Cancel
Save