plugins: style sweep

This commit is contained in:
Franco Fichtner 2024-03-14 08:49:45 +01:00
parent f3ed2695fe
commit 85a27147c4
7 changed files with 14 additions and 12 deletions

View File

@ -32,8 +32,8 @@ function ddclient_services()
$services = [];
$cnf = \OPNsense\Core\Config::getInstance()->object();
$is_enabled = false;
if ($cnf->OPNsense && $cnf->OPNsense->DynDNS && $cnf->OPNsense->DynDNS->general){
$is_enabled = $cnf->OPNsense->DynDNS->general->enabled == '1';
if ($cnf->OPNsense && $cnf->OPNsense->DynDNS && $cnf->OPNsense->DynDNS->general) {
$is_enabled = $cnf->OPNsense->DynDNS->general->enabled == '1';
}
if ($is_enabled) {

View File

@ -32,7 +32,7 @@ function wazuhagent_services()
$services = [];
$cnf = \OPNsense\Core\Config::getInstance()->object();
$is_enabled = false;
if ($cnf->OPNsense && $cnf->OPNsense->WazuhAgent && $cnf->OPNsense->WazuhAgent->general){
if ($cnf->OPNsense && $cnf->OPNsense->WazuhAgent && $cnf->OPNsense->WazuhAgent->general) {
$is_enabled = $cnf->OPNsense->WazuhAgent->general->enabled == '1';
}

View File

@ -27,7 +27,7 @@ Plugin Changelog
* Increased timeout of message area in reverse_proxy.volt and general.volt to 15 seconds.
* When pressing Apply, the form is saved automatically before the reconfigure action.
* Cleaned up Caddy.xml model to satisfy make lint.
* When selecting an interface in Dynamic DNS, at most one IPv6 GUA and IPv4 non-RFC1918 address will be extracted. Fixes all IP addresses being read.
* When selecting an interface in Dynamic DNS, at most one IPv6 GUA and IPv4 non-RFC1918 address will be extracted. Fixes all IP addresses being read.
1.5.1

View File

@ -32,8 +32,10 @@ function caddy_services()
$services = array();
if (isset($config['Pischem']['caddy']['general']['enabled']) &&
$config['Pischem']['caddy']['general']['enabled'] == 1) {
if (
isset($config['Pischem']['caddy']['general']['enabled']) &&
$config['Pischem']['caddy']['general']['enabled'] == 1
) {
$services[] = array(
'description' => gettext('Caddy Web Server'),
'configd' => array(

View File

@ -33,8 +33,10 @@ namespace OPNsense\Caddy;
use OPNsense\Base\IndexController;
class ReverseProxyController extends IndexController {
public function indexAction() {
class ReverseProxyController extends IndexController
{
public function indexAction()
{
$this->view->pick('OPNsense/Caddy/reverse_proxy');
$this->view->formDialogReverseProxy = $this->getForm("dialogReverseProxy");
$this->view->formDialogSubdomain = $this->getForm("dialogSubdomain");

View File

@ -40,16 +40,13 @@ class M1_1_3 extends BaseModelMigration
// Ensure there are reverse proxy configurations to process
if (!empty($config->Pischem->caddy->reverseproxy)) {
// Loop through each reverse proxy configuration in the stored configuration config.xml
foreach ($config->Pischem->caddy->reverseproxy->children() as $configNode) {
// Extract the UUID attribute to identify the configuration item
$uuid = (string)$configNode->attributes()->uuid;
// Check if the current configuration item has a 'Description' to migrate
if (!empty($configNode->Description)) {
// Store the value of 'Description' for migration
$descriptionValue = (string)$configNode->Description;

View File

@ -37,7 +37,8 @@ use OPNsense\Core\Config;
$configObj = Config::getInstance()->object();
$temp_dir = '/usr/local/etc/caddy/certificates/temp/';
function extract_and_save_certificates($configObj, $temp_dir) {
function extract_and_save_certificates($configObj, $temp_dir)
{
// Traverse through certificates
foreach ($configObj->cert as $cert) {
$cert_refid = (string)$cert->refid;