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
b57f2415
Commit
b57f2415
authored
Feb 26, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) refactor system_usermanager_settings_test.php
parent
4294e773
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
44 deletions
+62
-44
system_usermanager_settings_test.php
src/www/system_usermanager_settings_test.php
+62
-44
No files found.
src/www/system_usermanager_settings_test.php
View file @
b57f2415
<?php
<?php
/*
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2007 Scott Ullrich <sullrich@gmail.com>
Copyright (C) 2007 Scott Ullrich <sullrich@gmail.com>
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
modification, are permitted provided that the following conditions are met:
...
@@ -40,47 +40,65 @@ if (isset($config['system']['authserver'][0]['host'])) {
...
@@ -40,47 +40,65 @@ if (isset($config['system']['authserver'][0]['host'])) {
ldap_setup_caenv
(
$authcfg
);
ldap_setup_caenv
(
$authcfg
);
$ldap_is_connected
=
$ldap_auth
->
connect
(
$authcfg
[
'ldap_full_url'
],
$authcfg
[
'ldap_binddn'
],
$authcfg
[
'ldap_bindpw'
]);
$ldap_is_connected
=
$ldap_auth
->
connect
(
$authcfg
[
'ldap_full_url'
],
$authcfg
[
'ldap_binddn'
],
$authcfg
[
'ldap_bindpw'
]);
}
}
?>
?>
<html>
<body>
<body>
<form
method=
"post"
name=
"iform"
id=
"iform"
>
<table
class=
'table table-striped'
>
<?php
<?php
if
(
empty
(
$authcfg
))
:?>
if
(
!
$authcfg
)
{
<
tr
>
printf
(
gettext
(
"Could not find settings for %s%s"
),
htmlspecialchars
(
$authserver
),
"<p/>"
);
<
td
>
}
else
{
<?
php
echo
"<table class='table table-striped'>"
;
printf
(
gettext
(
"Could not find settings for %s%s"
),
htmlspecialchars
(
$authserver
),
"<p/>"
);
?>
</td>
echo
"<tr><th colspan='2'>"
.
gettext
(
"Testing LDAP settings... One moment please..."
)
.
"</th></tr>"
;
</tr>
echo
"<tr><td>"
.
gettext
(
"Attempting connection to"
)
.
" "
.
$authserver
.
"</td>"
;
<?php
if
(
$ldap_is_connected
)
{
else
:?>
echo
"<td><font color='green'>OK</font></td></tr>"
;
<
tr
>
echo
"<tr><td>"
.
gettext
(
"Attempting to fetch Organizational Units from"
)
.
" "
.
$authserver
.
"</td>"
;
<
td
colspan
=
'2'
>
$ous
=
$ldap_auth
->
listOUs
();
<?=
sprintf
(
gettext
(
"Testing %s LDAP settings... One moment please..."
),
$g
[
'product_name'
]);
?>
if
(
count
(
$ous
)
>
1
)
{
</td>
echo
"<td><font color=green>OK</font></td></tr>"
;
</tr>
echo
"<tr><td>"
.
gettext
(
"Organization units found"
)
.
"</td><td><font color=green>"
.
count
(
$ous
)
.
"</font></td></tr>"
;
<tr>
foreach
(
$ous
as
$ou
)
{
<td>
<?=
gettext
(
"Attempting connection to"
)
.
" "
.
htmlspecialchars
(
$authserver
);
?>
</td>
echo
"<tr><td colspan='2'>"
.
$ou
.
"</td></tr>"
;
<?php
}
if
(
$ldap_is_connected
)
:?>
}
else
{
<
td
>
echo
"<td><font color='red'>"
.
gettext
(
"failed"
)
.
"</font></td></tr>"
;
<
font
color
=
'green'
><?=
gettext
(
"OK"
);
?>
</font></td>
}
</tr>
}
else
{
<tr>
echo
"<td><font color='red'>"
.
gettext
(
"failed"
)
.
"</font></td></tr>"
;
<td>
<?=
gettext
(
"Attempting to fetch Organizational Units from"
)
.
" "
.
htmlspecialchars
(
$authserver
);
?>
</td>
}
<?php
}
$ous
=
$ldap_auth
->
listOUs
();
if
(
count
(
$ous
)
>
1
)
:?>
?>
<
td
><
font
color
=
green
><?=
gettext
(
"OK"
);
?>
</font></td>
<tr>
</tr>
<td
colspan=
"2"
align=
"right"
>
<tr>
<input
type=
"Button"
value=
"
<?=
gettext
(
"Close"
);
?>
"
class=
"btn btn-default"
onClick=
'Javascript:window.close();'
>
<td>
<?=
gettext
(
"Organization units found"
);
?>
</td>
</td>
<td><font
color=
green
>
<?=
count
(
$ous
);
?>
</font></td>
</tr>
</tr>
</table>
<?php
</form>
foreach
(
$ous
as
$ou
)
:?>
</body>
<
tr
><
td
colspan
=
'2'
><?=
$ou
;
?>
</td></tr>
<?php
endforeach
;
else
:?>
<
td
><
font
color
=
'red'
><?=
gettext
(
"failed"
);
?>
</font></td>
</tr>
<?php
endif
;
?>
<?php
else
:?>
<
td
><
font
color
=
'red'
><?=
gettext
(
"failed"
);
?>
</font></td>
</tr>
<?php
endif
;
endif
;
?>
<tr>
<td
colspan=
"2"
align=
"right"
>
<input
type=
"Button"
value=
"
<?=
gettext
(
"Close"
);
?>
"
class=
"btn btn-default"
onClick=
'Javascript:window.close();'
>
</td>
</tr>
</table>
</body>
</html>
</html>
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