Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
affd3d15
Unverified
Commit
affd3d15
authored
Apr 23, 2018
by
Dan Cech
Committed by
GitHub
Apr 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11150 from sbskas/master
Make Ldap group composed of DNs work.
parents
d14ac54a
7cc3d0c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
pkg/login/ldap.go
+6
-1
No files found.
pkg/login/ldap.go
View file @
affd3d15
...
...
@@ -302,9 +302,11 @@ func (a *ldapAuther) searchForUser(username string) (*LdapUserInfo, error) {
// If we are using a POSIX LDAP schema it won't support memberOf, so we manually search the groups
var
groupSearchResult
*
ldap
.
SearchResult
for
_
,
groupSearchBase
:=
range
a
.
server
.
GroupSearchBaseDNs
{
filter_replace
:=
getLdapAttr
(
a
.
server
.
GroupSearchFilterUserAttribute
,
searchResult
)
var
filter_replace
string
if
a
.
server
.
GroupSearchFilterUserAttribute
==
""
{
filter_replace
=
getLdapAttr
(
a
.
server
.
Attr
.
Username
,
searchResult
)
}
else
{
filter_replace
=
getLdapAttr
(
a
.
server
.
GroupSearchFilterUserAttribute
,
searchResult
)
}
filter
:=
strings
.
Replace
(
a
.
server
.
GroupSearchFilter
,
"%s"
,
ldap
.
EscapeFilter
(
filter_replace
),
-
1
)
...
...
@@ -346,6 +348,9 @@ func (a *ldapAuther) searchForUser(username string) (*LdapUserInfo, error) {
}
func
getLdapAttrN
(
name
string
,
result
*
ldap
.
SearchResult
,
n
int
)
string
{
if
name
==
"DN"
{
return
result
.
Entries
[
0
]
.
DN
}
for
_
,
attr
:=
range
result
.
Entries
[
n
]
.
Attributes
{
if
attr
.
Name
==
name
{
if
len
(
attr
.
Values
)
>
0
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment