From bb28e21c206894803222151e73a36feee629766c Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 1 Oct 2007 13:01:32 +0000 Subject: [PATCH] Major change in the installation of modules to also accept an SQL-file for upload. --- CHANGELOG.txt | 12 ++++++++++++ admin/db/maintenance_db.inc | 1 + admin/inst_module.php | 14 +++++++++++++- config.php | 4 ++-- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c8ed3cfb..d53aba0c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,18 @@ Legend: ! -> Note $ -> Affected files +-------------------- 1.14 Stable Released ---------------------- +01-Oct-2007 Joe Hunt + ! Major change in the installation of modules to also accept an SQL-file for upload. + $ config.php + /admin/inst_module.php + /admin/db/maintenance_db.inc + +30-Sep-2007 Joe Hunt + # The following files were still vulnerable. Fixed + $ /access/login.php + /includes/lang/language.php + -------------------- 1.13 Stable Released ---------------------- 14-Sep-2007 Joe Hunt + Added optional link for electronic payment on invoices (PayPal). diff --git a/admin/db/maintenance_db.inc b/admin/db/maintenance_db.inc index c525f900..2d233d87 100644 --- a/admin/db/maintenance_db.inc +++ b/admin/db/maintenance_db.inc @@ -126,6 +126,7 @@ function db_import($filename, $connection) $line = trim($line); $line = str_replace("0_", $connection["tbpref"], $line); + $line = str_replace("Y_", "0_", $line); // the last line did not belong to a 'create' sql query if (!$table) { diff --git a/admin/inst_module.php b/admin/inst_module.php index 5f8e2363..76cb8363 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -8,6 +8,7 @@ page(_("Install/Update Modules")); include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/admin/db/company_db.inc"); +include_once($path_to_root . "/admin/db/maintenance_db.inc"); include_once($path_to_root . "/modules/installed_modules.php"); include_once($path_to_root . "/includes/ui.inc"); @@ -175,7 +176,7 @@ function write_modules() function handle_submit() { - global $path_to_root, $installed_modules; + global $path_to_root, $installed_modules, $db_connections; if (!check_data()) return false; @@ -201,6 +202,16 @@ function handle_submit() } else $installed_modules[$id]['filename'] = $_POST['filename']; + if (is_uploaded_file($_FILES['uploadfile2']['tmp_name'])) + { + $file1 = $_FILES['uploadfile2']['tmp_name']; + $file2 = $directory . "/".$_FILES['uploadfile2']['name']; + if (file_exists($file2)) + unlink($file2); + move_uploaded_file($file1, $file2); + $db_name = $_SESSION["wa_current_user"]->company; + db_import($file2, $db_connections[$db_name]); + } if (!write_modules()) return false; return true; @@ -311,6 +322,7 @@ function display_module_edit($selected_id) text_row_ex(_("Folder"), 'path', 20); label_row(_("Module File"), ""); + label_row(_("SQL File"), ""); end_table(0); display_note(_("Select your module PHP file from your local harddisk."), 0, 1); diff --git a/config.php b/config.php index 09580d15..419f949e 100644 --- a/config.php +++ b/config.php @@ -53,10 +53,10 @@ // Main Title $app_title = "FrontAccounting"; // application version - $version = "1.13"; + $version = "1.14"; // Build for development purposes - $build_version = "53"; + $build_version = "79"; // Powered by $power_by = "FrontAccounting"; -- 2.30.2