summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-03-19 23:29:39 +0000
committerColin Smith <colin@pfsense.org>2005-03-19 23:29:39 +0000
commit194b4e0a3bddc2184cd5a48668ac5d93491ff8a2 (patch)
tree00375ab56f20dfb813e83117d2e9c0702e121dcb
parent050cb8a01378afd7caefbd5281ad1cdeced4e1da (diff)
downloadpfsense-194b4e0a3bddc2184cd5a48668ac5d93491ff8a2.zip
pfsense-194b4e0a3bddc2184cd5a48668ac5d93491ff8a2.tar.gz
Add basic support for <custom_php_global_functions> tag.
-rw-r--r--etc/inc/pfsense-utils.inc4
-rwxr-xr-xusr/local/www/pkg.php5
-rwxr-xr-xusr/local/www/pkg_edit.php6
-rwxr-xr-xusr/local/www/pkg_mgr_install.php3
4 files changed, 14 insertions, 4 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 616481d..4126b10 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -875,6 +875,8 @@ function sync_package($pkg_name, $sync_depends = true, $show_message = false) {
$pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], "packagegui");
if(isset($pkg_config['nosync'])) continue;
//if($show_message == true) print "Syncing " . $pkg_name;
+ if($pkg['custom_php_global_functions'] <> "")
+ eval($pkg['custom_php_global_functions']);
if($pkg_config['custom_php_command_before_form'] <> "")
eval($pkg_config['custom_php_command_before_form']);
if($pkg_config['custom_php_resync_config_command'] <> "")
@@ -938,4 +940,4 @@ function make_dirs($path, $mode = 0755)
return is_dir($path) || (make_dirs(dirname($path), $mode) && safe_mkdir($path, $mode));
}
-?> \ No newline at end of file
+?>
diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php
index 54c7d81..0f2d780 100755
--- a/usr/local/www/pkg.php
+++ b/usr/local/www/pkg.php
@@ -89,8 +89,11 @@ if ($_GET['act'] == "del") {
$toeval = "\$evaledvar = \$config['installedpackages']['" . xml_safe_fieldname($pkg['name']) . "']['config'];";
eval($toeval);
+if($pkg['custom_php_global_functions'] <> "")
+ eval($pkg['custom_php_global_functions']);
+
if($pkg['custom_php_command_before_form'] <> "")
- eval($pkg['custom_php_command_before_form']);
+ eval($pkg['custom_php_command_before_form']);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index e5f5a4b..70d77fb 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -82,9 +82,11 @@ eval($toeval);
$toeval = "\$a_pkg = &\$config['installedpackages']['" . xml_safe_fieldname($pkg['name']) . "']['config'];";
eval($toeval);
-if($pkg['custom_php_command_before_form'] <> "")
- eval($pkg['custom_php_command_before_form']);
+if($pkg['custom_php_global_functions'] <> "")
+ eval($pkg['custom_php_global_functions']);
+if($pkg['custom_php_command_before_form'] <> "")
+ eval($pkg['custom_php_command_before_form']);
if ($_POST) {
if($_POST['act'] == "del") {
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php
index 646a057..9f5d4d0 100755
--- a/usr/local/www/pkg_mgr_install.php
+++ b/usr/local/www/pkg_mgr_install.php
@@ -421,6 +421,9 @@ foreach ($packages_to_install as $id) {
$pb_percent += 10;
if($package_conf['custom_php_install_command']) {
+ if($package_conf['custom_php_global_functions'] <> "")
+ if(php_check_syntax($package_conf['custom_php_global_functions'], $error_message) == false)
+ eval($package_conf['custom_php_global_functions']);
update_status("Executing post install commands...\n");
fwrite($fd_log, "Executing post install commands...\n");
$error_message = "";
OpenPOWER on IntegriCloud