Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
0f881bc4
Commit
0f881bc4
authored
Nov 24, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ldap) re-enable ldap_scope and legacy auth containers.
parent
36473899
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
LDAP.php
src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php
+21
-4
No files found.
src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php
View file @
0f881bc4
...
@@ -80,6 +80,17 @@ class LDAP implements IAuthConnector
...
@@ -80,6 +80,17 @@ class LDAP implements IAuthConnector
*/
*/
private
$ldapExtendedQuery
=
null
;
private
$ldapExtendedQuery
=
null
;
/**
* @var auth containers
*/
private
$ldapAuthcontainers
=
null
;
/**
* @var ldap scope
*/
private
$ldapScope
=
"tree"
;
/**
/**
* @var array list of already known usernames vs distinguished names
* @var array list of already known usernames vs distinguished names
*/
*/
...
@@ -109,16 +120,20 @@ class LDAP implements IAuthConnector
...
@@ -109,16 +120,20 @@ class LDAP implements IAuthConnector
/**
/**
* search ldap tree
* search ldap tree
* @param string $filter ldap filter string to use
* @param string $filter ldap filter string to use
* @param string $ldap_scope scope either one or tree
* @return array|bool result list or false on errors
* @return array|bool result list or false on errors
*/
*/
private
function
search
(
$filter
,
$ldap_scope
=
"tree"
)
private
function
search
(
$filter
)
{
{
$result
=
false
;
$result
=
false
;
if
(
$this
->
ldapHandle
!=
null
)
{
if
(
$this
->
ldapHandle
!=
null
)
{
// if we're looking at multple dn's, split and combine output
// if we're looking at multple dn's, split and combine output
foreach
(
explode
(
";"
,
$this
->
baseSearchDN
)
as
$baseDN
)
{
if
(
!
empty
(
$this
->
ldapAuthcontainers
))
{
if
(
$ldap_scope
==
"one"
)
{
$searchpaths
=
$this
->
ldapAuthcontainers
;
}
else
{
$searchpaths
=
$this
->
baseSearchDN
;
}
foreach
(
explode
(
";"
,
$searchpaths
)
as
$baseDN
)
{
if
(
$this
->
ldapScope
==
"one"
)
{
$sr
=@
ldap_list
(
$this
->
ldapHandle
,
$baseDN
,
$filter
,
$this
->
ldapSearchAttr
);
$sr
=@
ldap_list
(
$this
->
ldapHandle
,
$baseDN
,
$filter
,
$this
->
ldapSearchAttr
);
}
else
{
}
else
{
$sr
=@
ldap_search
(
$this
->
ldapHandle
,
$baseDN
,
$filter
,
$this
->
ldapSearchAttr
);
$sr
=@
ldap_search
(
$this
->
ldapHandle
,
$baseDN
,
$filter
,
$this
->
ldapSearchAttr
);
...
@@ -185,6 +200,8 @@ class LDAP implements IAuthConnector
...
@@ -185,6 +200,8 @@ class LDAP implements IAuthConnector
"ldap_bindpw"
=>
"ldapBindPassword"
,
"ldap_bindpw"
=>
"ldapBindPassword"
,
"ldap_attr_user"
=>
"ldapAttributeUser"
,
"ldap_attr_user"
=>
"ldapAttributeUser"
,
"ldap_extended_query"
=>
"ldapExtendedQuery"
,
"ldap_extended_query"
=>
"ldapExtendedQuery"
,
"ldap_authcn"
=>
"ldapAuthcontainers"
,
"ldap_scope"
=>
"ldapScope"
,
"local_users"
=>
"userDNmap"
"local_users"
=>
"userDNmap"
);
);
...
...
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