Skip to content

Commit 536dfa6

Browse files
Fix BingeHack Twitter LDAP Search
The ldap search would previously return the full DN of a user if they did not have a twitterName entry in their object. This changes the behavior to return the name that was originally entered if no twitterName exists.
1 parent 86d93b1 commit 536dfa6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/nethack_events/bingehack-tweeter/bingehack-twitter.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ def get_twitter_username(name)
3737
scope: LDAP::SearchScope_SingleLevel,
3838
attributes: ['twitterName']
3939
) do |entry|
40-
entry.each do |attribute, value|
41-
twitterName = value.first
42-
end
40+
twitterName = entry.twitterName.first
4341
end
4442
twitterName
4543
rescue

0 commit comments

Comments
 (0)