Commit 25819145 authored by Franco Fichtner's avatar Franco Fichtner

services: bubble down plugins_services hook

This way, the caller only needs to specify plugins.inc on the
top to let the subsystem(s) know plugin hooks need to be executed.

(cherry picked from commit e8fa56c5)
parent 638da619
......@@ -2743,6 +2743,13 @@ function services_get()
'name' => 'configd',
);
if (function_exists('plugins_services')) {
/* only pull plugins if plugins.inc was included before */
foreach (plugins_services() as $service) {
$services[] = $service;
}
}
return $services;
}
......@@ -2754,13 +2761,6 @@ function find_service_by_name($names, $filter = array())
$services = services_get();
if (function_exists('plugins_services')) {
/* only pull plugins if plugins.inc was included before */
foreach (plugins_services() as $service) {
$services[] = $service;
}
}
foreach ($services as $service) {
foreach ($names as $name) {
if ($service['name'] != $name) {
......
......@@ -178,10 +178,6 @@ function service_control_restart($name, $extras)
$services = services_get();
foreach (plugins_services() as $service) {
$services[] = $service;
}
if (count($services) > 0) {
uasort($services, "service_name_compare");
}
......
......@@ -40,10 +40,6 @@ require_once("widgets/include/services_status.inc");
$services = services_get();
foreach (plugins_services() as $service) {
$services[] = $service;
}
if (isset($_POST['servicestatusfilter'])) {
$config['widgets']['servicestatusfilter'] = htmlspecialchars($_POST['servicestatusfilter'], ENT_QUOTES | ENT_HTML401);
write_config("Saved Service Status Filter via Dashboard");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment