Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
8a571cb3
Commit
8a571cb3
authored
May 04, 2017
by
Côme Chilliet
Committed by
Benoit Mortier
May 04, 2017
Browse files
Fixes
#5509
Catching LDAP exceptions in dashboard tabs
parent
d82f655a
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/addons/dashboard/class_dashBoard.inc
View file @
8a571cb3
...
...
@@ -70,7 +70,11 @@ class dashboard extends simplePlugin
$nb
=
objects
::
count
(
$type
);
}
catch
(
FusionDirectoryException
$e
)
{
$nb
=
0
;
trigger_error
(
"Problem with
$type
:"
.
$e
->
getMessage
());
msg_dialog
::
display
(
_
(
'LDAP error'
),
sprintf
(
_
(
'Statistics for type "%s" could not be computed because of the following error: %s'
),
$type
,
$e
->
getMessage
()),
ERROR_DIALOG
);
}
if
(
$nb
==
0
)
{
continue
;
...
...
plugins/addons/dashboard/class_dashBoardPasswords.inc
View file @
8a571cb3
...
...
@@ -55,7 +55,16 @@ class dashboardPassword extends simplePlugin
$defaultMethod
=
$config
->
get_cfg_value
(
'passwordDefaultHash'
,
'ssha'
);
$forceDefault
=
(
$config
->
get_cfg_value
(
'forcePasswordDefaultHash'
,
'FALSE'
)
==
'TRUE'
);
$users
=
objects
::
ls
(
'user'
,
'userPassword'
);
try
{
$users
=
objects
::
ls
(
'user'
,
'userPassword'
);
}
catch
(
LDAPFailureException
$e
)
{
msg_dialog
::
display
(
_
(
'LDAP error'
),
sprintf
(
_
(
'Password statistics could not be computed because of the following LDAP error: %s'
),
$e
->
getMessage
()),
ERROR_DIALOG
);
$users
=
array
();
}
$nb_accounts
=
count
(
$users
);
$nb_locked_accounts
=
0
;
$methods_stats
=
array
();
...
...
plugins/addons/dashboard/class_dashBoardUsers.inc
View file @
8a571cb3
...
...
@@ -66,7 +66,16 @@ class dashboardUsers extends simplePlugin
{
global
$config
;
/* User statistics */
$nb_accounts
=
objects
::
count
(
'user'
);
try
{
$nb_accounts
=
objects
::
count
(
'user'
);
}
catch
(
LDAPFailureException
$e
)
{
msg_dialog
::
display
(
_
(
'LDAP error'
),
sprintf
(
_
(
'Total user number could not be computed because of the following LDAP error: %s'
),
$e
->
getMessage
()),
ERROR_DIALOG
);
$nb_accounts
=
0
;
}
$ldap
=
$config
->
get_ldap_link
();
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
...
...
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