Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
5cab1142
Commit
5cab1142
authored
Jun 26, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upnp: rip out the custom php hooks
parent
c4bf112d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
64 deletions
+6
-64
miniupnpd.xml
src/pkg/miniupnpd.xml
+0
-9
service_upnp.php
src/www/service_upnp.php
+6
-55
No files found.
src/pkg/miniupnpd.xml
View file @
5cab1142
...
@@ -124,13 +124,4 @@
...
@@ -124,13 +124,4 @@
<size>
60
</size>
<size>
60
</size>
</field>
</field>
</fields>
</fields>
<custom_php_command_before_form>
before_form_miniupnpd($pkg);
</custom_php_command_before_form>
<custom_php_validation_command>
validate_form_miniupnpd($_POST, $input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
sync_package_miniupnpd();
</custom_php_resync_config_command>
</packagegui>
</packagegui>
src/www/service_upnp.php
View file @
5cab1142
...
@@ -84,9 +84,6 @@ if(!is_numeric($id)) {
...
@@ -84,9 +84,6 @@ if(!is_numeric($id)) {
exit
;
exit
;
}
}
if
(
$pkg
[
'custom_php_global_functions'
]
<>
""
)
eval
(
$pkg
[
'custom_php_global_functions'
]);
// grab the installedpackages->package_name section.
// grab the installedpackages->package_name section.
if
(
$config
[
'installedpackages'
]
&&
!
is_array
(
$config
[
'installedpackages'
][
xml_safe_fieldname
(
$pkg
[
'name'
])][
'config'
]))
if
(
$config
[
'installedpackages'
]
&&
!
is_array
(
$config
[
'installedpackages'
][
xml_safe_fieldname
(
$pkg
[
'name'
])][
'config'
]))
$config
[
'installedpackages'
][
xml_safe_fieldname
(
$pkg
[
'name'
])][
'config'
]
=
array
();
$config
[
'installedpackages'
][
xml_safe_fieldname
(
$pkg
[
'name'
])][
'config'
]
=
array
();
...
@@ -101,8 +98,7 @@ $a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config
...
@@ -101,8 +98,7 @@ $a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config
if
(
$_GET
[
'savemsg'
]
<>
""
)
if
(
$_GET
[
'savemsg'
]
<>
""
)
$savemsg
=
htmlspecialchars
(
$_GET
[
'savemsg'
]);
$savemsg
=
htmlspecialchars
(
$_GET
[
'savemsg'
]);
if
(
$pkg
[
'custom_php_command_before_form'
]
<>
""
)
before_form_miniupnpd
(
$pkg
);
eval
(
$pkg
[
'custom_php_command_before_form'
]);
if
(
$_POST
)
{
if
(
$_POST
)
{
$firstfield
=
""
;
$firstfield
=
""
;
...
@@ -120,37 +116,12 @@ if ($_POST) {
...
@@ -120,37 +116,12 @@ if ($_POST) {
}
}
}
}
do_input_validation
(
$_POST
,
$reqfields
,
$reqfieldsn
,
$input_errors
);
do_input_validation
(
$_POST
,
$reqfields
,
$reqfieldsn
,
$input_errors
);
validate_form_miniupnpd
(
$_POST
,
$input_errors
);
if
(
$pkg
[
'custom_php_validation_command'
])
eval
(
$pkg
[
'custom_php_validation_command'
]);
if
(
$_POST
[
'act'
]
==
"del"
)
{
if
(
$_POST
[
'act'
]
==
"del"
)
{
if
(
$pkg
[
'custom_delete_php_command'
])
{
if
(
$pkg
[
'custom_php_command_before_form'
]
<>
""
)
eval
(
$pkg
[
'custom_php_command_before_form'
]);
eval
(
$pkg
[
'custom_delete_php_command'
]);
}
write_config
(
$pkg
[
'delete_string'
]);
write_config
(
$pkg
[
'delete_string'
]);
// resync the configuration file code if defined.
before_form_miniupnpd
(
$pkg
);
if
(
$pkg
[
'custom_php_resync_config_command'
]
<>
""
)
{
sync_package_miniupnpd
();
if
(
$pkg
[
'custom_php_command_before_form'
]
<>
""
)
eval
(
$pkg
[
'custom_php_command_before_form'
]);
eval
(
$pkg
[
'custom_php_resync_config_command'
]);
}
}
else
{
if
(
!
$input_errors
&&
$pkg
[
'custom_add_php_command'
])
{
if
(
$pkg
[
'donotsave'
]
<>
""
or
$pkg
[
'preoutput'
]
<>
""
)
{
?>
<?php
include
(
"head.inc"
);
?>
<body
link=
"#0000CC"
vlink=
"#0000CC"
alink=
"#0000CC"
>
<?php
include
(
"fbegin.inc"
);
?>
<?php
}
if
(
$pkg
[
'preoutput'
])
echo
"<pre>"
;
eval
(
$pkg
[
'custom_add_php_command'
]);
if
(
$pkg
[
'preoutput'
])
echo
"</pre>"
;
}
}
}
// donotsave is enabled. lets simply exit.
// donotsave is enabled. lets simply exit.
...
@@ -193,19 +164,8 @@ if ($_POST) {
...
@@ -193,19 +164,8 @@ if ($_POST) {
$a_pkg
[]
=
$pkgarr
;
$a_pkg
[]
=
$pkgarr
;
write_config
(
$pkg
[
'addedit_string'
]);
write_config
(
$pkg
[
'addedit_string'
]);
// late running code
if
(
$pkg
[
'custom_add_php_command_late'
]
<>
""
)
{
eval
(
$pkg
[
'custom_add_php_command_late'
]);
}
if
(
isset
(
$pkg
[
'filter_rules_needed'
]))
filter_configure
();
// resync the configuration file code if defined.
if
(
$pkg
[
'custom_php_resync_config_command'
]
<>
""
)
{
eval
(
$pkg
[
'custom_php_resync_config_command'
]);
}
sync_package_miniupnpd
();
parse_package_templates
();
parse_package_templates
();
/* if start_command is defined, restart w/ this */
/* if start_command is defined, restart w/ this */
...
@@ -235,14 +195,7 @@ if ($_POST) {
...
@@ -235,14 +195,7 @@ if ($_POST) {
$title
=
$pkg
[
'title'
];
$title
=
$pkg
[
'title'
];
$pgtitle
=
$title
;
$pgtitle
=
$title
;
if
(
$pkg
[
'custom_php_after_head_command'
])
{
include
(
"head.inc"
);
$closehead
=
false
;
include
(
"head.inc"
);
eval
(
$pkg
[
'custom_php_after_head_command'
]);
echo
"</head>
\n
"
;
}
else
include
(
"head.inc"
);
?>
?>
...
@@ -937,8 +890,6 @@ echo '<tr><td>';
...
@@ -937,8 +890,6 @@ echo '<tr><td>';
</div>
</div>
</section>
</section>
<?php
if
(
$pkg
[
'custom_php_after_form_command'
])
eval
(
$pkg
[
'custom_php_after_form_command'
]);
?>
<?php
<?php
/* JavaScript to handle the advanced fields. */
/* JavaScript to handle the advanced fields. */
if
(
$pkg
[
'advanced_options'
]
==
"enabled"
)
{
if
(
$pkg
[
'advanced_options'
]
==
"enabled"
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment