Commit 302f3e74 authored by Birin Sanchez's avatar Birin Sanchez
Browse files

Approve LDAP users by default.


Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent 4dd66df0
Pipeline #6310 failed with stages
......@@ -266,7 +266,7 @@ class User < ApplicationRecord
private
def set_approved
self.approved = open_registrations? || invited?
self.approved = open_registrations? || invited? || Devise.ldap_users_approved
end
def open_registrations?
......
......@@ -61,6 +61,8 @@ module Devise
@@ldap_tls_no_verify = false
mattr_accessor :ldap_search_filter
@@ldap_search_filter = nil
mattr_accessor :ldap_users_approved
@@ldap_users_approved = true
class Strategies::PamAuthenticatable
def valid?
......@@ -365,5 +367,6 @@ Devise.setup do |config|
config.ldap_uid = ENV.fetch('LDAP_UID', 'cn')
config.ldap_tls_no_verify = ENV['LDAP_TLS_NO_VERIFY'] == 'true'
config.ldap_search_filter = ENV.fetch('LDAP_SEARCH_FILTER', '%{uid}=%{email}')
config.ldap_users_approved = ENV.fetch('LDAP_USERS_APPROVED', true)
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment