mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 16:14:40 +00:00
src: style sweep
This commit is contained in:
parent
a6b0827716
commit
2fef2a80b0
@ -74,7 +74,7 @@ class TunablesController extends ApiMutableModelControllerBase
|
||||
Config::getInstance()->lock();
|
||||
$factory_config = Config::getInstance()->toArrayFromFile('/usr/local/etc/config.xml', []);
|
||||
$mdl = $this->getModel()->Default();
|
||||
if (!empty($factory_config['sysctl']) && !empty($factory_config['sysctl']['item'])){
|
||||
if (!empty($factory_config['sysctl']) && !empty($factory_config['sysctl']['item'])) {
|
||||
foreach ($factory_config['sysctl']['item'] as $item) {
|
||||
$node = $mdl->item->Add();
|
||||
foreach ($item as $key => $val) {
|
||||
|
||||
@ -49,7 +49,7 @@ class TunableField extends ArrayField
|
||||
protected static function getStaticChildren()
|
||||
{
|
||||
$result = [];
|
||||
foreach (self::$static_entries as $key => $item){
|
||||
foreach (self::$static_entries as $key => $item) {
|
||||
/* md5($key) ensures static keys identifiable as static options */
|
||||
$result[md5($key)] = [
|
||||
'tunable' => $key,
|
||||
|
||||
@ -114,16 +114,18 @@ class Filter extends BaseModel
|
||||
)
|
||||
) {
|
||||
$messages->appendMessage(new Message(
|
||||
gettext("Inverting interfaces is only allowed for ".
|
||||
gettext("Inverting interfaces is only allowed for " .
|
||||
"single targets to avoid mis-interpretations"),
|
||||
$rule->interfacenot->__reference
|
||||
));
|
||||
}
|
||||
if ($rule->statetype == 'none') {
|
||||
foreach ([
|
||||
foreach (
|
||||
[
|
||||
'statetimeout', 'max', 'max-src-states', 'max-src-nodes', 'adaptivestart', 'adaptiveend',
|
||||
'max-src-conn'
|
||||
] as $fieldname) {
|
||||
] as $fieldname
|
||||
) {
|
||||
if (!empty((string)$rule->$fieldname)) {
|
||||
$messages->appendMessage(new Message(
|
||||
gettext("Invalid option when statetype is none."),
|
||||
@ -133,10 +135,12 @@ class Filter extends BaseModel
|
||||
}
|
||||
}
|
||||
if (!in_array($rule->protocol, ['TCP', 'TCP/UDP'])) {
|
||||
foreach ([
|
||||
foreach (
|
||||
[
|
||||
'statetimeout', 'max-src-conn', 'tcpflags1', 'tcpflags2',
|
||||
'max-src-conn-rate', 'max-src-conn-rates', 'overload'
|
||||
] as $fieldname) {
|
||||
] as $fieldname
|
||||
) {
|
||||
if (!empty((string)$rule->$fieldname)) {
|
||||
$messages->appendMessage(new Message(
|
||||
gettext("Invalid option for other than TCP protocol choices."),
|
||||
@ -155,7 +159,7 @@ class Filter extends BaseModel
|
||||
|
||||
if (!empty((string)$rule->tcpflags1) && empty((string)$rule->tcpflags2)) {
|
||||
$messages->appendMessage(new Message(
|
||||
gettext("If you specify TCP flags that should be set ".
|
||||
gettext("If you specify TCP flags that should be set " .
|
||||
"you should specify out of which flags as well."),
|
||||
$rule->tcpflags2->__reference
|
||||
));
|
||||
@ -198,12 +202,11 @@ class Filter extends BaseModel
|
||||
|
||||
if ((string)$rule->{'set-prio'} == '' && (string)$rule->{'set-prio-low'} != '') {
|
||||
$messages->appendMessage(new Message(
|
||||
gettext("Set priority for low latency and acknowledgements ".
|
||||
gettext("Set priority for low latency and acknowledgements " .
|
||||
"requires a set priority for normal packets."),
|
||||
$rule->{'set-prio-low'}->__reference
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ class KeaDhcpv4 extends BaseModel
|
||||
'id' => $subnet_id++,
|
||||
'subnet' => (string)$subnet->subnet,
|
||||
'next-server' => (string)$subnet->next_server,
|
||||
'match-client-id'=> !empty((string)$subnet->{'match-client-id'}),
|
||||
'match-client-id' => !empty((string)$subnet->{'match-client-id'}),
|
||||
'option-data' => [],
|
||||
'pools' => [],
|
||||
'reservations' => []
|
||||
|
||||
@ -30,4 +30,4 @@
|
||||
require_once("config.inc");
|
||||
require_once("system.inc");
|
||||
|
||||
echo json_encode(system_sysctl_defaults());
|
||||
echo json_encode(system_sysctl_defaults());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user