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
39beb181
Commit
39beb181
authored
Jul 27, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) add full ldap url to auth_get_authserver
parent
6fee1e3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
auth.inc
src/etc/inc/auth.inc
+29
-9
No files found.
src/etc/inc/auth.inc
View file @
39beb181
...
...
@@ -1203,16 +1203,36 @@ function is_account_disabled($username) {
}
function
auth_get_authserver
(
$name
)
{
global
$config
;
global
$config
;
if
(
isset
(
$config
[
'system'
][
'authserver'
])
&&
is_array
(
$config
[
'system'
][
'authserver'
]))
{
foreach
(
$config
[
'system'
][
'authserver'
]
as
$authcfg
)
{
if
(
$authcfg
[
'name'
]
==
$name
)
return
$authcfg
;
}
}
if
(
$name
==
"Local Database"
)
return
array
(
"name"
=>
gettext
(
"Local Database"
),
"type"
=>
"Local Auth"
,
"host"
=>
$config
[
'system'
][
'hostname'
]);
if
(
$name
==
"Local Database"
)
{
return
array
(
"name"
=>
gettext
(
"Local Database"
),
"type"
=>
"Local Auth"
,
"host"
=>
$config
[
'system'
][
'hostname'
]
);
}
if
(
isset
(
$config
[
'system'
][
'authserver'
])
&&
is_array
(
$config
[
'system'
][
'authserver'
]))
{
foreach
(
$config
[
'system'
][
'authserver'
]
as
$authcfg
)
{
if
(
$authcfg
[
'name'
]
==
$name
)
{
if
(
$authcfg
[
'type'
]
==
'ldap'
)
{
// let's try to avoid regenerating the ldap url in every function.
if
(
strstr
(
$authcfg
[
'ldap_urltype'
],
"Standard"
))
{
$authcfg
[
'ldap_full_url'
]
=
"ldap://"
;
}
else
{
$authcfg
[
'ldap_full_url'
]
=
"ldaps://"
;
}
$authcfg
[
'ldap_full_url'
]
.=
is_ipaddrv6
(
$authcfg
[
'host'
])
?
"[
{
$authcfg
[
'host'
]
}
]"
:
$authcfg
[
'host'
];
if
(
!
empty
(
$authcfg
[
'ldap_port'
]))
{
$authcfg
[
'ldap_full_url'
]
.=
":
{
$authcfg
[
'ldap_port'
]
}
"
;
}
}
return
$authcfg
;
}
}
}
}
function
auth_get_authserver_list
()
{
...
...
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