projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed logout error when setting show users online.
[fa-stable.git]
/
admin
/
create_coy.php
diff --git
a/admin/create_coy.php
b/admin/create_coy.php
index 21861a0f83c8bb9343f4be3fb3956824b89ef3c2..f500feb9cd26b85ca6c17684cf1179286b197bbf 100644
(file)
--- 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'] == "")
global $db_connections, $tb_pref_counter, $selected_id;
if ($_POST['name'] == "" || $_POST['host'] == "" || $_POST['dbuser'] == "" || $_POST['dbname'] == "")
- return false;
+ {
+ display_error(_("Database settings are not specified."));
+ return false;
+ }
foreach($db_connections as $id=>$con)
{
foreach($db_connections as $id=>$con)
{
@@
-281,11
+284,6
@@
function display_company_edit($selected_id)
{
global $def_coy, $db_connections, $tb_pref_counter;
{
global $def_coy, $db_connections, $tb_pref_counter;
- if ($selected_id != -1)
- $n = $selected_id;
- else
- $n = count($db_connections);
-
start_form();
start_table(TABLESTYLE2);
start_form();
start_table(TABLESTYLE2);
@@
-309,9
+307,17
@@
function display_company_edit($selected_id)
hidden('dbpassword', $_POST['dbpassword']);
}
else
hidden('dbpassword', $_POST['dbpassword']);
}
else
+ {
$_POST['tbpref'] = $tb_pref_counter."_";
$_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(_("Company"), 'name', 30);
- text_row_ex(_("Host"), 'host', 30);
+ text_row_ex(_("Host"), 'host', 30
, 60
);
text_row_ex(_("Database User"), 'dbuser', 30);
if ($selected_id == -1)
text_row_ex(_("Database Password"), 'dbpassword', 30);
text_row_ex(_("Database User"), 'dbuser', 30);
if ($selected_id == -1)
text_row_ex(_("Database Password"), 'dbpassword', 30);