Merge pull request #5530 from GPCsolutions/forcedinstallfixes
Forced install fixes
This commit is contained in:
commit
437a8b53ae
@ -131,7 +131,7 @@ if (! empty($force_install_message))
|
||||
value="<?php print $dolibarr_main_document_root ?>"
|
||||
name="main_dir"
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -151,7 +151,7 @@ if (! empty($force_install_message))
|
||||
<td valign="top" class="label"><b> <?php print $langs->trans("DocumentsDirectory"); ?></b>
|
||||
</td>
|
||||
<?php
|
||||
$dolibarr_main_data_root = $force_install_main_data_root;
|
||||
$dolibarr_main_data_root = @$force_install_main_data_root;
|
||||
if (empty($dolibarr_main_data_root)) {
|
||||
$dolibarr_main_data_root = detect_dolibarr_main_data_root($dolibarr_main_document_root);
|
||||
}
|
||||
@ -162,7 +162,7 @@ if (! empty($force_install_message))
|
||||
value="<?php print $dolibarr_main_data_root ?>"
|
||||
name="main_data_dir"
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -193,7 +193,7 @@ if (! empty($force_install_message))
|
||||
name="main_url"
|
||||
value="<?php print $dolibarr_main_url_root; ?> "
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -214,10 +214,10 @@ if (! empty($force_install_message))
|
||||
<input type="checkbox"
|
||||
name="main_force_https"
|
||||
<?php if (!empty($force_install_mainforcehttps)) {
|
||||
print 'checked';
|
||||
print ' checked';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_mainforcehttps !== null) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -245,7 +245,7 @@ if (! empty($force_install_message))
|
||||
name="db_name"
|
||||
value="<?php echo (!empty($dolibarr_main_db_name)) ? $dolibarr_main_db_name : ($force_install_database ? $force_install_database : 'dolibarr'); ?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_database !== null) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -325,7 +325,7 @@ if (! empty($force_install_message))
|
||||
<select id="db_type"
|
||||
name="db_type"
|
||||
<?php if ($force_install_noedit && $force_install_type !== null) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
<?php print $option; ?>
|
||||
@ -434,7 +434,7 @@ if (! empty($force_install_message))
|
||||
print dol_escape_htmltag($autofill);
|
||||
?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_databasepass !== null) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -448,10 +448,10 @@ if (! empty($force_install_message))
|
||||
<input type="checkbox"
|
||||
id="db_create_user" name="db_create_user"
|
||||
<?php if (!empty($force_install_createuser)) {
|
||||
print 'checked';
|
||||
print ' checked';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_createuser !== null) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -478,9 +478,9 @@ if (! empty($force_install_message))
|
||||
id="db_user_root"
|
||||
name="db_user_root"
|
||||
class="needroot"
|
||||
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : $db_user_root; ?>"
|
||||
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_databaserootlogin !== null) {
|
||||
print 'disabled';
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
@ -506,7 +506,7 @@ if (! empty($force_install_message))
|
||||
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);
|
||||
$autofill = ((!empty($force_install_database_rootpass)) ? '' : @$db_pass_root);
|
||||
if (!empty($dolibarr_main_prod)) {
|
||||
$autofill = '';
|
||||
} // Do not autofill password if instance is a production instance
|
||||
|
||||
@ -79,7 +79,7 @@ $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db-
|
||||
if ($db->ok)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>';
|
||||
print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? $_GET["login"] : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . ($force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>';
|
||||
print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? $_GET["login"] : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . (@$force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Password").' :</td><td>';
|
||||
print '<input type="password" name="pass"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PasswordAgain").' :</td><td>';
|
||||
|
||||
33
test/phpunit/zenfusion/functional/DolibarrInstallTest.php
Normal file
33
test/phpunit/zenfusion/functional/DolibarrInstallTest.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
class ZenFusionInstallTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->setHost('localhost');
|
||||
$this->setPort(4444);
|
||||
$this->setBrowserUrl('http://dev.zenfusion.fr');
|
||||
$this->setBrowser('chrome');
|
||||
}
|
||||
|
||||
public function setUpPage()
|
||||
{
|
||||
$this->url('/');
|
||||
}
|
||||
|
||||
public function testInstallRedirect()
|
||||
{
|
||||
$this->assertContains('/install/index.php', $this->url());
|
||||
}
|
||||
|
||||
public function testInstallPageTitle()
|
||||
{
|
||||
$this->assertContains('Dolibarr', $this->title());
|
||||
}
|
||||
|
||||
public function testInstallProcess()
|
||||
{
|
||||
$this->byName('forminstall')->submit();
|
||||
$this->assertContains('/install/check.php', $this->url());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user