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
b234d36f
Commit
b234d36f
authored
Nov 29, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ldap: further tweaks according to user feedback
Puts LDAP back in into its supposed working state.
parent
340da972
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
LDAP.php
src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php
+18
-7
openvpn.xml
src/wizard/openvpn.xml
+1
-1
system_authservers.php
src/www/system_authservers.php
+5
-2
No files found.
src/opnsense/mvc/app/library/OPNsense/Auth/LDAP.php
View file @
b234d36f
...
@@ -126,17 +126,28 @@ class LDAP implements IAuthConnector
...
@@ -126,17 +126,28 @@ class LDAP implements IAuthConnector
{
{
$result
=
false
;
$result
=
false
;
if
(
$this
->
ldapHandle
!=
null
)
{
if
(
$this
->
ldapHandle
!=
null
)
{
// if we're looking at multple dn's, split and combine output
$searchpaths
=
array
();
if
(
!
empty
(
$this
->
ldapAuthcontainers
))
{
if
(
!
empty
(
$this
->
ldapAuthcontainers
))
{
$searchpaths
=
$this
->
ldapAuthcontainers
;
/* prepend each authentication container */
foreach
(
explode
(
';'
,
$this
->
ldapAuthcontainers
)
as
$container
)
{
$searchpath
=
array
();
if
(
!
empty
(
$container
))
{
$searchpath
[]
=
$container
;
}
if
(
!
empty
(
$this
->
baseSearchDN
))
{
$searchpath
[]
=
$this
->
baseSearchDN
;
}
$searchpaths
[]
=
implode
(
','
,
$searchpath
);
}
}
else
{
}
else
{
$searchpaths
=
$this
->
baseSearchDN
;
/* use a single base DN */
$searchpaths
[]
=
$this
->
baseSearchDN
;
}
}
foreach
(
explode
(
";"
,
$searchpaths
)
as
$baseDN
)
{
foreach
(
$searchpaths
as
$baseDN
)
{
if
(
$this
->
ldapScope
==
"one"
)
{
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
);
}
}
if
(
$sr
!==
false
)
{
if
(
$sr
!==
false
)
{
$info
=
@
ldap_get_entries
(
$this
->
ldapHandle
,
$sr
);
$info
=
@
ldap_get_entries
(
$this
->
ldapHandle
,
$sr
);
...
...
src/wizard/openvpn.xml
View file @
b234d36f
...
@@ -205,7 +205,7 @@
...
@@ -205,7 +205,7 @@
<displayname>
User Naming Attribute
</displayname>
<displayname>
User Naming Attribute
</displayname>
<type>
input
</type>
<type>
input
</type>
<bindstofield>
ovpnserver->step2->nameattr
</bindstofield>
<bindstofield>
ovpnserver->step2->nameattr
</bindstofield>
<description>
Typically "cn" (OpenLDAP, Novell eDirectory), "s
am
AccountName" (Microsoft AD)
</description>
<description>
Typically "cn" (OpenLDAP, Novell eDirectory), "s
AM
AccountName" (Microsoft AD)
</description>
</field>
</field>
<field>
<field>
<name>
groupattr
</name>
<name>
groupattr
</name>
...
...
src/www/system_authservers.php
View file @
b234d36f
...
@@ -333,7 +333,7 @@ $( document ).ready(function() {
...
@@ -333,7 +333,7 @@ $( document ).ready(function() {
$
(
"
#ldap_attr_user
"
).
val
(
'
cn
'
);
$
(
"
#ldap_attr_user
"
).
val
(
'
cn
'
);
break
;
break
;
case
'
msad
'
:
case
'
msad
'
:
$
(
"
#ldap_attr_user
"
).
val
(
'
s
am
AccountName
'
);
$
(
"
#ldap_attr_user
"
).
val
(
'
s
AM
AccountName
'
);
break
;
break
;
}
}
});
});
...
@@ -604,9 +604,12 @@ endif; ?>
...
@@ -604,9 +604,12 @@ endif; ?>
<?php
<?php
endif
;
?>
endif
;
?>
<tr
class=
"auth_ldap auth_options hidden"
>
<tr
class=
"auth_ldap auth_options hidden"
>
<td><
i
class=
"fa fa-info-circle text-muted"
></i
>
<?=
gettext
(
"User naming attribute"
);
?>
</td>
<td><
a
id=
"help_for_ldap_attr_user"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a
>
<?=
gettext
(
"User naming attribute"
);
?>
</td>
<td>
<td>
<input
name=
"ldap_attr_user"
type=
"text"
id=
"ldap_attr_user"
size=
"20"
value=
"
<?=
$pconfig
[
'ldap_attr_user'
];
?>
"
/>
<input
name=
"ldap_attr_user"
type=
"text"
id=
"ldap_attr_user"
size=
"20"
value=
"
<?=
$pconfig
[
'ldap_attr_user'
];
?>
"
/>
<div
class=
"hidden"
for=
"help_for_ldap_attr_user"
>
<?=
gettext
(
'Typically "cn" (OpenLDAP, Novell eDirectory), "sAMAccountName" (Microsoft AD)'
)
?>
</div>
</td>
</td>
</tr>
</tr>
<!-- RADIUS -->
<!-- RADIUS -->
...
...
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