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
18e84dd0
Commit
18e84dd0
authored
May 04, 2017
by
Côme Chilliet
Browse files
Fixes
#5509
Catching LDAP exceptions in dashboard tabs
parent
9f7cd0a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/addons/dashboard/class_dashBoard.inc
View file @
18e84dd0
...
...
@@ -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 @
18e84dd0
...
...
@@ -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 @
18e84dd0
...
...
@@ -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