Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory-plugins
Commits
19f92b20
Commit
19f92b20
authored
7 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
fix(systems): Fix ACL handling in systems dashboard tab
issue #5746
parent
4690db1a
dev
6104-mail-methods-refactor
6231-give-the-ability-to-the-webservice-to-notice-if-an-attribute-is-monovalued-or-multivalued
6237-add-requiredattrs-array-to-the-webservice-informations
6245-adapt-the-ci-to-the-reorganisation-of-the-dev-tools-and-fixing-the-trigger-downstream-pipelines
6250-supann-configuration-backend-requires-account-life-cycle-section
6280-plugins-update-plugins-to-take-into-consideration-the-new-directory-of-core-structure
6310-tasks-reminder-error-in-the-schema-duplicate-attribute-id
6311-put-the-version-1-5-in-all-yaml-for-fusiondirectory-1-5
6322-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen-2
6332-zimbra-allows-update-of-data-for-unknown-domain-name-for-specific-individual-aliases
6337-webservice-issue-with-archiving-post-request-not-responding-but-successfully-archiving-user
6341-supann-extract-resources-states-sub-states-from-backend-configuration-to-their-own-objects
6346-lifecycle-adaptation-to-select-supann-resources-and-related-states-via-regex-mechanism
master
fusiondirectory-1.5
fusiondirectory-1.4
fusiondirectory-1.3.1
fusiondirectory-1.3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
systems/addons/dashboard/class_dashBoardSystems.inc
+37
-18
systems/addons/dashboard/class_dashBoardSystems.inc
with
37 additions
and
18 deletions
+37
-18
systems/addons/dashboard/class_dashBoardSystems.inc
+
37
−
18
View file @
19f92b20
...
...
@@ -79,7 +79,8 @@ class dashboardSystems extends simplePlugin
'img'
=>
'geticon.php?context=devices&icon=server&size=16'
),
array
(
'name'
=>
_
(
'Windows Workstations'
),
'filter'
=>
'(&(objectClass=sambaSamAccount)(uid=*$))'
,
'type'
=>
'workstation'
,
'filter'
=>
'(objectClass=sambaSamAccount)'
,
'img'
=>
'geticon.php?context=devices&icon=computer-windows&size=16'
),
array
(
'name'
=>
_
(
'Terminals'
),
...
...
@@ -103,13 +104,19 @@ class dashboardSystems extends simplePlugin
'img'
=>
'geticon.php?context=devices&icon=phone&size=16'
),
);
foreach
(
$stats
as
&
$stat
)
{
if
(
isset
(
$stat
[
'filter'
]))
{
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
search
(
$stat
[
'filter'
],
array
(
"cn"
));
$stat
[
'nb'
]
=
$ldap
->
count
();
}
else
{
$stat
[
'nb'
]
=
objects
::
count
(
$stat
[
'type'
]);
foreach
(
$stats
as
$key
=>
&
$stat
)
{
try
{
$stat
[
'nb'
]
=
count
(
objects
::
ls
(
$stat
[
'type'
],
NULL
,
NULL
,
(
isset
(
$stat
[
'filter'
])
?
$stat
[
'filter'
]
:
''
),
TRUE
));
if
(
$stat
[
'nb'
]
==
0
)
{
unset
(
$stats
[
$key
]);
}
}
catch
(
FusionDirectoryException
$e
)
{
unset
(
$stats
[
$key
]);
msg_dialog
::
display
(
_
(
'LDAP error'
),
sprintf
(
_
(
'Statistics for type "%s" could not be computed because of the following error: %s'
),
$stat
[
'type'
],
$e
->
getMessage
()),
ERROR_DIALOG
);
}
}
unset
(
$stat
);
...
...
@@ -119,21 +126,33 @@ class dashboardSystems extends simplePlugin
function
argonaut_stats
()
{
global
$config
;
$ldap
=
$config
->
get_ldap_link
();
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
search
(
"(objectClass=argonautServer)"
,
array
(
'cn'
,
'ipHostNumber'
,
'argonautProtocol'
,
'argonautPort'
));
$nb_argonaut_server
=
$ldap
->
count
();
$argonaut_server
=
array
();
global
$config
,
$ui
;
$argonaut_servers
=
objects
::
ls
(
'server'
,
array
(
'cn'
=>
'raw'
,
'ipHostNumber'
=>
'raw'
,
'argonautProtocol'
=>
'raw'
,
'argonautPort'
=>
'raw'
),
NULL
,
'(objectClass=argonautServer)'
,
TRUE
);
$nb_argonaut_server
=
count
(
$argonaut_servers
);
$argonaut_server
=
array
();
if
(
$nb_argonaut_server
==
1
)
{
$attrs
=
$ldap
->
fetch
(
);
$attrs
=
reset
(
$argonaut_servers
);
foreach
(
array
(
'cn'
,
'ipHostNumber'
,
'argonautProtocol'
,
'argonautPort'
)
as
$key
)
{
$argonaut_server
[
$key
]
=
$attrs
[
$key
][
0
];
}
$argonaut_server
[
'link'
]
=
objects
::
link
(
$attrs
[
'dn'
],
'server'
,
'service_serviceArgonaut'
,
$attrs
);
$argonaut_server
[
'link'
]
=
objects
::
link
(
key
(
$argonaut_servers
),
'server'
,
'service_serviceArgonaut'
,
$attrs
);
}
if
(
strpos
(
$ui
->
get_permissions
(
$config
->
current
[
'BASE'
],
'server/argonautClient'
,
''
),
'r'
)
===
FALSE
)
{
$nb_argonaut_clients
=
0
;
}
else
{
$ldap
=
$config
->
get_ldap_link
();
$ldap
->
cd
(
$config
->
current
[
'BASE'
]);
$ldap
->
search
(
'(objectClass=argonautClient)'
,
array
(
'cn'
));
$nb_argonaut_clients
=
$ldap
->
count
();
}
$ldap
->
search
(
"(objectClass=argonautClient)"
,
array
(
'cn'
));
$nb_argonaut_clients
=
$ldap
->
count
();
return
array
(
'nb_servers'
=>
$nb_argonaut_server
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets