Skip to content

Commit

Permalink
Tweak the allowed to login code, hotfix for issue #48
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcath committed Feb 19, 2014
1 parent 9db2d98 commit 7a5b810
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/adauth/authenticate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.authenticate(username, password)

# Check if the user is allowed to login
def self.allowed_to_login(user)
(allowed_from_arrays(@config.allowed_groups, @config.denied_groups, user.cn_groups_nested) && allowed_from_arrays(@config.allowed_ous, @config.denied_ous, user.dn_ous))
(((@config.allowed_groups.empty? && @config.denied_groups.empty?) || allowed_from_arrays(@config.allowed_groups, @config.denied_groups, user.cn_groups_nested)) && ((@config.allowed_ous.empty? && @config.denied_ous.empty?) || allowed_from_arrays(@config.allowed_ous, @config.denied_ous, user.dn_ous)))
end

private
Expand Down

0 comments on commit 7a5b810

Please sign in to comment.