From 95ea2a03e3ccfa59bacd3d9a47bdf6d64b7d7a60 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 17 Jan 2011 00:51:02 +0000 Subject: [PATCH] # {0000481] No warning when user does not supply db credentials in create_coy --- CHANGELOG.txt | 2 ++ admin/create_coy.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3d2a0219..e2e29ac6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,8 @@ $ -> Affected files 17-Jan-2011 Joe Hunt # [0000494] Cannot set second company pref when setup System and General GL $ /admin/db/company_db.inc +# {0000481] No warning when user does not supply db credentials in create_coy +$ /admin/create_coy.php 12-Jan-2011 Janusz Dobrowolski + Added access extensions hook method, cleanup diff --git a/admin/create_coy.php b/admin/create_coy.php index 348c3634..6ed2c774 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -41,7 +41,10 @@ function check_data() global $db_connections, $tb_pref_counter, $selected_id; if ($_POST['name'] == "" || $_POST['host'] == "" || $_POST['dbuser'] == "" || $_POST['dbname'] == "") - return false; + { + display_error(_("Database setting are not specified.")); + return false; + } foreach($db_connections as $id=>$con) { @@ -309,7 +312,15 @@ function display_company_edit($selected_id) hidden('dbpassword', $_POST['dbpassword']); } else + { $_POST['tbpref'] = $tb_pref_counter."_"; + // Insert the current settings as default + $conn = $db_connections[user_company()]; + $_POST['host'] = $conn['host']; + $_POST['dbuser'] = $conn['dbuser']; + $_POST['dbpassword'] = $conn['dbpassword']; + $_POST['dbname'] = $conn['dbname']; + } text_row_ex(_("Company"), 'name', 30); text_row_ex(_("Host"), 'host', 30, 60); text_row_ex(_("Database User"), 'dbuser', 30); -- 2.30.2