ldap_auth.patch

patch to request required attributes - Fabian Zimmermann, 11/14/2014 07:47 AM

Download (1.12 KB)

View differences:

ldap_auth.rb 2014-11-13 15:31:58.931734072 +0000
47 47
            :mapping_timeout    => 300,
48 48
            :mapping_filename   => 'server1.yaml',
49 49
            :mapping_key        => 'GROUP_DN',
50
            :mapping_default    => 1
50
            :mapping_default    => 1,
51
	    :attributes		=> [ "memberOf" ]
51 52
        }.merge(options)
52 53
        ops={}
......
123 124
        begin
124 125
            result=@ldap.search(
125 126
                :base => @options[:base],
127
		:attributes => @options[:attributes],
126 128
                :filter => "#{@options[:user_field]}=#{name}")
127 129
            if result && result.first
......
144 146
    end
145 147
    def is_in_group?(user, group)
148
	STDERR.puts user
149
	STDERR.puts group
146 150
        result=@ldap.search(
147 151
                    :base   => group,
152
		    :attributes => @options[:group_field],
148 153
                    :filter => "(#{@options[:group_field]}=#{user.first})")
149 154
        if result && result.first
......
183 188
        end
184 189
        groups.delete(false)
185
        groups.compact
190
        groups.compact.uniq
186 191
    end
187 192
end