Skip to content

Commit f1eae4d

Browse files
committed
Refactor code style
1 parent 29be3d3 commit f1eae4d

File tree

7 files changed

+108
-189
lines changed

7 files changed

+108
-189
lines changed

files/usr/local/pkg/bro.inc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ function bro_enabled() {
7474
}
7575
return $bro_enabled;
7676
}
77+
7778
// Check whether Bro Cluster is enabled
7879
function bro_cluster_enabled() {
7980
global $config, $bro_cluster_enabled;
@@ -158,7 +159,6 @@ fi
158159
EOD;
159160

160161
write_rcfile($rcfile);
161-
162162
}
163163

164164
/*
@@ -365,7 +365,7 @@ EOD;
365365
//$settings = $config['installedpackages']['broscript']['config'];
366366
if (!bro_enabled()) {
367367
$input_errors[] = 'You must enabled Bro instance first';
368-
}else {
368+
} else {
369369
if (substr($post['broscriptpath'], -1, 1) == '/') {
370370
$input_errors[] = 'Script location must not end with a / character.';
371371
}
@@ -448,8 +448,7 @@ EOD;
448448

449449
file_put_contents($nodefile, $conf);
450450
chmod($nodefile, 0640);
451-
452-
}
451+
}
453452

454453
$conf = '';
455454
$conf .= <<< EOD
@@ -655,7 +654,7 @@ EOD;
655654
file_put_contents($nodefile, $conf);
656655
chmod($nodefile, 0640);
657656

658-
}
657+
}
659658
bro_sync_on_changes();
660659
bro_restart_services();
661660
}
@@ -792,20 +791,19 @@ $filename
792791
$newline
793792
794793
EOD;
794+
}
795795
}
796-
}
797796

798797
$destpath = '/usr/local/share/bro/site/local.bro';
799798

800799
file_put_contents($destpath, $conf);
801800
chmod($destpath, 0640);
802-
803801

804802
}else {
805803
log_error("You must enabled Bro instance first.");
806804
}
807-
bro_sync_on_changes();
808-
bro_restart_services();
805+
bro_sync_on_changes();
806+
bro_restart_services();
809807
}
810808

811809
/*

files/usr/local/pkg/bro.xml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,21 @@
88
/* ====================================================================================== */
99
/*
1010
bro.xml
11-
part of pfSense (https://www.pfSense.org/)
12-
Copyright (C) 2016 Prosper DOKO
13-
All rights reserved.
14-
*/
15-
/* ====================================================================================== */
16-
/*
17-
Redistribution and use in source and binary forms, with or without
18-
modification, are permitted provided that the following conditions are met:
19-
20-
21-
1. Redistributions of source code must retain the above copyright notice,
22-
this list of conditions and the following disclaimer.
23-
24-
2. Redistributions in binary form must reproduce the above copyright
25-
notice, this list of conditions and the following disclaimer in the
26-
documentation and/or other materials provided with the distribution.
27-
28-
29-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
30-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31-
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32-
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
33-
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38-
POSSIBILITY OF SUCH DAMAGE.
11+
*part of pfSense (https://www.pfSense.org/)
12+
*Copyright (c) 2018 Prosper Doko
13+
* All rights reserved.
14+
*
15+
* Licensed under the Apache License, Version 2.0 (the "License");
16+
* you may not use this file except in compliance with the License.
17+
* You may obtain a copy of the License at
18+
*
19+
* http://www.apache.org/licenses/LICENSE-2.0
20+
*
21+
* Unless required by applicable law or agreed to in writing, software
22+
* distributed under the License is distributed on an "AS IS" BASIS,
23+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
* See the License for the specific language governing permissions and
25+
* limitations under the License.
3926
*/
4027
/* ====================================================================================== */
4128
]]>
@@ -139,16 +126,16 @@
139126
<encoding>base64</encoding>
140127
</field>
141128
</fields>
142-
<custom_php_validation_command>
143-
bro_validate_general($_POST, $input_errors);
144-
</custom_php_validation_command>
145-
<custom_php_resync_config_command>
146-
bro_settings_resync();
147-
</custom_php_resync_config_command>
148129
<custom_php_install_command>
149130
bro_install_command();
150131
</custom_php_install_command>
151132
<custom_php_deinstall_command>
152133
bro_deinstall_command();
153134
</custom_php_deinstall_command>
135+
<custom_php_validation_command>
136+
bro_validate_general($_POST, $input_errors);
137+
</custom_php_validation_command>
138+
<custom_php_resync_config_command>
139+
bro_settings_resync();
140+
</custom_php_resync_config_command>
154141
</packagegui>

files/usr/local/pkg/bro_broctl.xml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,22 @@
77
/* $Id$ */
88
/* ====================================================================================== */
99
/*
10-
bro.xml
11-
part of pfSense (https://www.pfSense.org/)
12-
Copyright (C) 2016 Prosper DOKO
13-
All rights reserved.
14-
*/
15-
/* ====================================================================================== */
16-
/*
17-
Redistribution and use in source and binary forms, with or without
18-
modification, are permitted provided that the following conditions are met:
19-
20-
21-
1. Redistributions of source code must retain the above copyright notice,
22-
this list of conditions and the following disclaimer.
23-
24-
2. Redistributions in binary form must reproduce the above copyright
25-
notice, this list of conditions and the following disclaimer in the
26-
documentation and/or other materials provided with the distribution.
27-
28-
29-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
30-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31-
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32-
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
33-
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38-
POSSIBILITY OF SUCH DAMAGE.
10+
* bro_broctl.xml
11+
* part of pfSense (https://www.pfSense.org/)
12+
* Copyright (c) 2018 Prosper Doko
13+
* All rights reserved.
14+
*
15+
* Licensed under the Apache License, Version 2.0 (the "License");
16+
* you may not use this file except in compliance with the License.
17+
* You may obtain a copy of the License at
18+
*
19+
* http://www.apache.org/licenses/LICENSE-2.0
20+
*
21+
* Unless required by applicable law or agreed to in writing, software
22+
* distributed under the License is distributed on an "AS IS" BASIS,
23+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
* See the License for the specific language governing permissions and
25+
* limitations under the License.
3926
*/
4027
/* ====================================================================================== */
4128
]]>

files/usr/local/pkg/bro_cluster.xml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,22 @@
77
/* $Id$ */
88
/* ====================================================================================== */
99
/*
10-
bro.xml
11-
part of pfSense (https://www.pfSense.org/)
12-
Copyright (C) 2016 Prosper DOKO
13-
All rights reserved.
14-
*/
15-
/* ====================================================================================== */
16-
/*
17-
Redistribution and use in source and binary forms, with or without
18-
modification, are permitted provided that the following conditions are met:
19-
20-
21-
1. Redistributions of source code must retain the above copyright notice,
22-
this list of conditions and the following disclaimer.
23-
24-
2. Redistributions in binary form must reproduce the above copyright
25-
notice, this list of conditions and the following disclaimer in the
26-
documentation and/or other materials provided with the distribution.
27-
28-
29-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
30-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31-
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32-
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
33-
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38-
POSSIBILITY OF SUCH DAMAGE.
10+
* bro_cluster.xml
11+
* part of pfSense (https://www.pfSense.org/)
12+
* Copyright (c) 2018 Prosper Doko
13+
* All rights reserved.
14+
*
15+
* Licensed under the Apache License, Version 2.0 (the "License");
16+
* you may not use this file except in compliance with the License.
17+
* You may obtain a copy of the License at
18+
*
19+
* http://www.apache.org/licenses/LICENSE-2.0
20+
*
21+
* Unless required by applicable law or agreed to in writing, software
22+
* distributed under the License is distributed on an "AS IS" BASIS,
23+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
* See the License for the specific language governing permissions and
25+
* limitations under the License.
3926
*/
4027
/* ====================================================================================== */
4128
]]>

files/usr/local/pkg/bro_log.xml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,22 @@
77
/* $Id$ */
88
/* ====================================================================================== */
99
/*
10-
bro.xml
11-
part of pfSense (https://www.pfSense.org/)
12-
Copyright (C) 2016 Prosper DOKO
13-
All rights reserved.
14-
*/
15-
/* ====================================================================================== */
16-
/*
17-
Redistribution and use in source and binary forms, with or without
18-
modification, are permitted provided that the following conditions are met:
19-
20-
21-
1. Redistributions of source code must retain the above copyright notice,
22-
this list of conditions and the following disclaimer.
23-
24-
2. Redistributions in binary form must reproduce the above copyright
25-
notice, this list of conditions and the following disclaimer in the
26-
documentation and/or other materials provided with the distribution.
27-
28-
29-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
30-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31-
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32-
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
33-
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38-
POSSIBILITY OF SUCH DAMAGE.
10+
* bro_log.xml
11+
* part of pfSense (https://www.pfSense.org/)
12+
* Copyright (c) 2018 Prosper Doko
13+
* All rights reserved.
14+
*
15+
* Licensed under the Apache License, Version 2.0 (the "License");
16+
* you may not use this file except in compliance with the License.
17+
* You may obtain a copy of the License at
18+
*
19+
* http://www.apache.org/licenses/LICENSE-2.0
20+
*
21+
* Unless required by applicable law or agreed to in writing, software
22+
* distributed under the License is distributed on an "AS IS" BASIS,
23+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
* See the License for the specific language governing permissions and
25+
* limitations under the License.
3926
*/
4027
/* ====================================================================================== */
4128
]]>

files/usr/local/pkg/bro_script.xml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,22 @@
77
/* $Id$ */
88
/* ====================================================================================== */
99
/*
10-
bro.xml
11-
part of pfSense (https://www.pfSense.org/)
12-
Copyright (C) 2016 Prosper DOKO
13-
All rights reserved.
14-
*/
15-
/* ====================================================================================== */
16-
/*
17-
Redistribution and use in source and binary forms, with or without
18-
modification, are permitted provided that the following conditions are met:
19-
20-
21-
1. Redistributions of source code must retain the above copyright notice,
22-
this list of conditions and the following disclaimer.
23-
24-
2. Redistributions in binary form must reproduce the above copyright
25-
notice, this list of conditions and the following disclaimer in the
26-
documentation and/or other materials provided with the distribution.
27-
28-
29-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
30-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31-
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32-
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
33-
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38-
POSSIBILITY OF SUCH DAMAGE.
10+
* bro_script.xml
11+
* part of pfSense (https://www.pfSense.org/)
12+
* Copyright (c) 2018 Prosper Doko
13+
* All rights reserved.
14+
*
15+
* Licensed under the Apache License, Version 2.0 (the "License");
16+
* you may not use this file except in compliance with the License.
17+
* You may obtain a copy of the License at
18+
*
19+
* http://www.apache.org/licenses/LICENSE-2.0
20+
*
21+
* Unless required by applicable law or agreed to in writing, software
22+
* distributed under the License is distributed on an "AS IS" BASIS,
23+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
* See the License for the specific language governing permissions and
25+
* limitations under the License.
3926
*/
4027
/* ====================================================================================== */
4128
]]>

0 commit comments

Comments
 (0)