mvc: style sweep

This commit is contained in:
Franco Fichtner 2023-10-03 09:07:09 +02:00
parent 33e497f808
commit 9c15cf7157
2 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<?php
/*
* Copyright (C) 2019 - 2023 Deciso B.V.
* Copyright (C) 2019-2023 Deciso B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -44,13 +44,15 @@ class VxLan extends BaseModel
$vxlandev = (string) $vxlan->vxlandev;
// Validate that values in Fields have been changed, prevents configuration save lockout when invalid data is present.
if ($validateFullModel ||
if (
$validateFullModel ||
$vxlan->vxlangroup->isFieldChanged() ||
$vxlan->vxlanremote->isFieldChanged() ||
$vxlan->vxlandev->isFieldChanged()
) {
// Validation 1: At least one of vxlangroup and vxlanremote must be populated, but not both.
if ((!empty($vxlangroup) && !empty($vxlanremote)) ||
if (
(!empty($vxlangroup) && !empty($vxlanremote)) ||
(empty($vxlangroup) && empty($vxlanremote))
) {
$messages->appendMessage(new Message(

View File

@ -66,7 +66,8 @@ class OpenVPN extends BaseModel
);
}
} elseif ($instance->role == 'server') {
if ($instance->dev_type == 'tun' &&
if (
$instance->dev_type == 'tun' &&
empty((string)$instance->server) &&
empty((string)$instance->server_ipv6)
) {