From: Janusz Dobrowolski Date: Tue, 26 Oct 2010 16:29:25 +0000 (+0000) Subject: Fixed installer (sys_prefs update error). X-Git-Tag: v2.4.2~19^2~537 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=2f31ae3b632b9e0734c629a9fbd5f12d6b287e71;p=fa-stable.git Fixed installer (sys_prefs update error). --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e771d41b..eaed0a4b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,8 @@ $ -> Affected files $ version.php # Small fix to tabbed_content behaviour. $ /includes/ui/ui_controls.inc +# Fixed installer (error in sys_prefs update) +$ /install/index.php 26-Oct-2010 Joe Hunt # 0000272: Manufacturing Bugs. Issue GL items moved to wo_work_order_issues.inc diff --git a/install/index.php b/install/index.php index 53c865ec..2b43068d 100644 --- a/install/index.php +++ b/install/index.php @@ -124,7 +124,7 @@ function install_connect_db() { return false; } if (!defined('TB_PREF')) - define('TB_PREF', $conn["tbpref"]); + define('TB_PREF', '&TB_PREF&'); if (!mysql_select_db($conn["dbname"], $db)) { $sql = "CREATE DATABASE " . $conn["dbname"]; @@ -146,16 +146,6 @@ function do_install() { if (install_connect_db() && db_import($path_to_root.'/sql/'.$coa, $_SESSION['inst_set'])) { $con = $_SESSION['inst_set']; $table_prefix = $con['tbpref']; - update_company_prefs(array('coy_name'=>$con['name'])); - $admin = get_user_by_login('admin'); -// update_admin_password($con, md5($con['pass'])); - update_user_prefs($admin['id'], array('language' => $_POST['lang'], - 'password' => md5($con['pass']))); - - if (!copy($path_to_root. "/config.default.php", $path_to_root. "/config.php")) { - display_error(_("Cannot save system configuration file 'config.php'.")); - return false; - } $def_coy = 0; $tb_pref_counter = 0; @@ -167,6 +157,20 @@ function do_install() { 'dbname' => $con['dbname'], 'tbpref' => $table_prefix )); + + $_SESSION['wa_current_user']->cur_con = 0; + + update_company_prefs(array('coy_name'=>$con['name'])); + $admin = get_user_by_login('admin'); +// update_admin_password($con, md5($con['pass'])); + update_user_prefs($admin['id'], array('language' => $_POST['lang'], + 'password' => md5($con['pass']))); + + if (!copy($path_to_root. "/config.default.php", $path_to_root. "/config.php")) { + display_error(_("Cannot save system configuration file 'config.php'.")); + return false; + } + $err = write_config_db($table_prefix != ""); if ($err == -1) {