Skip to content

Commit efcf915

Browse files
author
Dave Sims
committed
Docs & better structure for configure_entry_search_strategy
1 parent 4a9e082 commit efcf915

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lib/github/ldap.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,18 @@ def configure_search_strategy(strategy = nil)
261261
configure_member_search_strategy(strategy)
262262
end
263263

264+
# Internal: Configure the entry search strategy.
265+
#
266+
# If the user has configured GHE to use forest searches AND we have an active
267+
# Directory instance that has the right capabilities, use a ForestSearch
268+
# strategy. Otherwise, the entry search strategy is simple the existing LDAP
269+
# connection object.
270+
#
264271
def configure_entry_search_strategy(use_forest_search)
265-
@entry_search_strategy = begin
266-
if use_forest_search && active_directory_capability? && capabilities[:configurationnamingcontext].any?
267-
@entry_search_strategy = GitHub::Ldap::ForestSearch.new(@connection)
268-
else
269-
@entry_search_strategy = @connection
270-
end
272+
@entry_search_strategy = if use_forest_search && active_directory_capability? && capabilities[:configurationnamingcontext].any?
273+
@entry_search_strategy = GitHub::Ldap::ForestSearch.new(@connection)
274+
else
275+
@entry_search_strategy = @connection
271276
end
272277
end
273278

@@ -322,7 +327,6 @@ def configure_member_search_strategy(strategy = nil)
322327
end
323328
end
324329

325-
326330
# Internal: Detect whether the LDAP host is an ActiveDirectory server.
327331
#
328332
# See: http://msdn.microsoft.com/en-us/library/cc223359.aspx.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy