diff --git a/build/exe/doliwamp/install.forced.php.install b/build/exe/doliwamp/install.forced.php.install index fd98dbf398401ae1d96b945107b8c6343f5f9a44..5b186c1726824857fd7ce2fc09fda4ba7cc41523 100644 --- a/build/exe/doliwamp/install.forced.php.install +++ b/build/exe/doliwamp/install.forced.php.install @@ -5,7 +5,7 @@ // during install process to be used. // // -$force_install_noedit=2; +$force_install_noedit=2; // 1=To block vars specific to distrib, 2 to block all technical parameters $force_install_message='KeepDefaultValuesWamp'; $force_install_main_data_root='WAMPROOT/dolibarr_documents'; $force_install_type='mysqli'; diff --git a/build/rpm/install.forced.php.fedora b/build/rpm/install.forced.php.fedora index 108455a940396029214ec461446a3e25f5234875..a8db3e25c9e9364cb40ccc4fcddd628237b7c30b 100644 --- a/build/rpm/install.forced.php.fedora +++ b/build/rpm/install.forced.php.fedora @@ -1,7 +1,7 @@ <?php $force_install_packager='rpmfedora'; -$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters +$force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters $force_install_message='KeepDefaultValuesDeb'; $force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_type='mysqli'; diff --git a/build/rpm/install.forced.php.generic b/build/rpm/install.forced.php.generic index 161f69cdbb3a57099c5a95fc216d3e4e65db9257..107ef533310def5b523960dd9c59711d2395cd31 100644 --- a/build/rpm/install.forced.php.generic +++ b/build/rpm/install.forced.php.generic @@ -1,7 +1,7 @@ <?php $force_install_packager='rpmgeneric'; -$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters +$force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters $force_install_message='KeepDefaultValuesDeb'; $force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_type='mysqli'; diff --git a/build/rpm/install.forced.php.mandriva b/build/rpm/install.forced.php.mandriva index 266468c7f334c96f4249494279971d40cef05152..927877b59d09368447d131c9537ec097009c86e8 100644 --- a/build/rpm/install.forced.php.mandriva +++ b/build/rpm/install.forced.php.mandriva @@ -1,7 +1,7 @@ <?php $force_install_packager='rpmmandriva'; -$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters +$force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters $force_install_message='KeepDefaultValuesDeb'; $force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_type='mysqli'; diff --git a/build/rpm/install.forced.php.opensuse b/build/rpm/install.forced.php.opensuse index b644cea6e249fd2d58d8bffe8962f2fbe2eefa01..c91836918f4726cd695f477ab25209204d219715 100644 --- a/build/rpm/install.forced.php.opensuse +++ b/build/rpm/install.forced.php.opensuse @@ -1,7 +1,7 @@ <?php $force_install_packager='rpmopensuse'; -$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters +$force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters $force_install_message='KeepDefaultValuesDeb'; $force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_type='mysqli'; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index cdd639ad50b8c584f28fe6bf59e2eead595928e1..c1083062a5fee8a95a4c9d876e46332172c8e774 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -66,6 +66,7 @@ if (@file_exists($forcedfile)) { } + /* * View */ @@ -426,8 +427,8 @@ if (! empty($force_install_message)) <input type="password" id="db_pass" autocomplete="off" name="db_pass" value="<?php - // We don't want to set password. It will be extracted from the forced install file at step1. - $autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : ''); + // If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1. + $autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : str_pad('', strlen($force_install_databasepass), '*')); if (!empty($dolibarr_main_prod)) { $autofill = ''; } @@ -479,7 +480,7 @@ if (! empty($force_install_message)) name="db_user_root" class="needroot" value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>" - <?php if ($force_install_noedit == 2 && $force_install_databaserootlogin !== null) { + <?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootlogin)) { print ' disabled'; } ?> > @@ -499,26 +500,28 @@ if (! empty($force_install_message)) <td class="label" valign="top"><b><?php echo $langs->trans("Password"); ?></b> </td> <td class="label" valign="top"> + <input type="password" autocomplete="off" id="db_pass_root" name="db_pass_root" class="needroot" value="<?php - // We don't want to set password. It will be extracted from the forced install file at step1. - $autofill = ((!empty($force_install_database_rootpass)) ? '' : @$db_pass_root); + // If $force_install_databaserootpass is on, we don't want to set password here, we just show '***'. Real value will be extracted from the forced install file at step1. + $autofill = ((!empty($force_install_databaserootpass)) ? str_pad('', strlen($force_install_databaserootpass), '*') : @$db_pass_root); if (!empty($dolibarr_main_prod)) { $autofill = ''; - } // Do not autofill password if instance is a production instance + } + // Do not autofill password if instance is a production instance if (!empty($_SERVER["SERVER_NAME"]) && !in_array($_SERVER["SERVER_NAME"], - array('127.0.0.1', 'localhost')) + array('127.0.0.1', 'localhost', 'localhostgit')) ) { $autofill = ''; } // Do not autofill password for remote access print dol_escape_htmltag($autofill); ?>" - <?php if ($force_install_noedit == 2 && $force_install_databaserootpass !== null) { - print ' disabled'; + <?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootpass)) { + print ' disabled'; // May be removed by javascript } ?> > </td> @@ -561,7 +564,10 @@ jQuery(document).ready(function() { if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked")) { jQuery(".hideroot").show(); - jQuery(".needroot").removeAttr('disabled'); + <?php + if ($force_install_noedit == 0) { ?> + jQuery(".needroot").removeAttr('disabled'); + <?php } ?> } else { diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index b323c970a9dca08ef330c5c439aa0dbbb51faee0..486b156fcaf15ec77821592a5f3ea2553d6cf6de 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -88,6 +88,7 @@ if (@file_exists($forcedfile)) { $main_data_dir = detect_dolibarr_main_data_root($main_dir); } $main_url = detect_dolibarr_main_url_root(); + if (!empty($force_install_databaserootlogin)) { $userroot = parse_database_login($force_install_databaserootlogin); } @@ -542,7 +543,7 @@ if (! $error && $db->connected && $action == "set") if ($db->connected) { $resultbis = 1; - + // Create user $result=$db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); // Create user bis @@ -553,7 +554,7 @@ if (! $error && $db->connected && $action == "set") $resultbis=$db->DDLCreateUser('%', $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); } } - + if ($result > 0 && $resultbis > 0) {