Commit ca6146a4 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy/plugins) move plugin_scan to system.inc for dependency reasons

(cherry picked from commit 4bffccf8)
parent 5466d383
......@@ -26,29 +26,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
function plugin_scan()
{
$path = '/usr/local/etc/inc/plugins.inc.d/';
$ext = '.inc';
$ret = array();
$plugins = glob($path . '*' . $ext);
if (!is_array($plugins)) {
return $ret;
}
sort($plugins);
foreach ($plugins as $plugin) {
$name = preg_replace('/' . preg_quote($path, '/') . '/', '', $plugin);
$name = preg_replace('/' . preg_quote($ext, '/') . '/', '', $name);
$ret[$name] = $plugin;
}
return $ret;
}
function plugins_services()
{
$services = array();
......
<?php
/*
Copyright (C) 2016 Franco Fichtner <franco@opnsense.org>
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>
All rights reserved.
......@@ -844,7 +845,6 @@ function system_syslogd_start()
}
}
asort($separatelogfacilities);
$facilitylist = implode(',', array_unique($separatelogfacilities));
$syslogconf .= "!-{$facilitylist}\n";
......@@ -1809,3 +1809,30 @@ function get_possible_traffic_source_addresses($include_ipv6_link_local=false) {
}
return $sourceips;
}
/**
* scan plugins for legacy system
* @return array
*/
function plugin_scan()
{
$path = '/usr/local/etc/inc/plugins.inc.d/';
$ext = '.inc';
$ret = array();
$plugins = glob($path . '*' . $ext);
if (!is_array($plugins)) {
return $ret;
}
sort($plugins);
foreach ($plugins as $plugin) {
$name = preg_replace('/' . preg_quote($path, '/') . '/', '', $plugin);
$name = preg_replace('/' . preg_quote($ext, '/') . '/', '', $name);
$ret[$name] = $plugin;
}
return $ret;
}
......@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once("pfsense-utils.inc");
require_once("interfaces.inc");
require_once("services.inc");
require_once("system.inc");
require_once("plugins.inc");
require_once("plugins.inc.d/vpn.inc");
......
......@@ -29,6 +29,7 @@
require_once("guiconfig.inc");
require_once("services.inc");
require_once("system.inc");
require_once("plugins.inc");
require_once("plugins.inc.d/vpn.inc");
......
......@@ -45,6 +45,7 @@ function l2tp_users_sort()
require_once("guiconfig.inc");
require_once("services.inc");
require_once("system.inc");
require_once("plugins.inc");
require_once("plugins.inc.d/vpn.inc");
......
......@@ -31,6 +31,7 @@ require_once('guiconfig.inc');
require_once('interfaces.inc');
require_once('filter.inc');
require_once('services.inc');
require_once("system.inc");
require_once("plugins.inc");
require_once("pfsense-utils.inc");
require_once('plugins.inc.d/vpn.inc');
......
......@@ -29,6 +29,7 @@
require_once('guiconfig.inc');
require_once('services.inc');
require_once("system.inc");
require_once("plugins.inc");
require_once('plugins.inc.d/vpn.inc');
......
......@@ -45,6 +45,7 @@ function pptpd_users_sort()
require_once('guiconfig.inc');
require_once('services.inc');
require_once("system.inc");
require_once("plugins.inc");
require_once('plugins.inc.d/vpn.inc');
......
......@@ -33,6 +33,7 @@ $nocsrf = true;
require_once("guiconfig.inc");
require_once("services.inc");
require_once("system.inc");
require_once('plugins.inc');
require_once("ipsec.inc");
require_once("interfaces.inc");
......
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