Fix: Removed test on not initialized var
This commit is contained in:
parent
f2917e5de3
commit
50860bfaac
@ -125,12 +125,12 @@ if (! $error)
|
|||||||
$result=@include_once($main_dir."/core/db/".$_POST["db_type"].".class.php");
|
$result=@include_once($main_dir."/core/db/".$_POST["db_type"].".class.php");
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
// If we ask database or user creation we need to connect as root
|
// If we ask database or user creation we need to connect as root, so we need root login
|
||||||
if (! empty($_POST["db_create_database"]) && ! $userroot)
|
if (! empty($_POST["db_create_database"]) && ! $userroot)
|
||||||
{
|
{
|
||||||
print '<div class="error">'.$langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$_POST["db_name"]).'</div>';
|
print '<div class="error">'.$langs->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect",$_POST["db_name"]).'</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
if (empty($db->connected)) print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
||||||
print $langs->trans("ErrorGoBackAndCorrectParameters");
|
print $langs->trans("ErrorGoBackAndCorrectParameters");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ if (! $error)
|
|||||||
{
|
{
|
||||||
print '<div class="error">'.$langs->trans("YouAskLoginCreationSoDolibarrNeedToConnect",$_POST["db_user"]).'</div>';
|
print '<div class="error">'.$langs->trans("YouAskLoginCreationSoDolibarrNeedToConnect",$_POST["db_user"]).'</div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
if (! $db->connected) print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
print $langs->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>';
|
||||||
print $langs->trans("ErrorGoBackAndCorrectParameters");
|
print $langs->trans("ErrorGoBackAndCorrectParameters");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ if (! $error)
|
|||||||
$db=getDoliDBInstance($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest,$_POST["db_port"]);
|
$db=getDoliDBInstance($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest,$_POST["db_port"]);
|
||||||
|
|
||||||
dol_syslog("databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected, LOG_DEBUG);
|
dol_syslog("databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected, LOG_DEBUG);
|
||||||
//print "databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected;
|
print "databasefortest=".$databasefortest." connected=".$db->connected." database_selected=".$db->database_selected;
|
||||||
|
|
||||||
if (empty($_POST["db_create_database"]) && $db->connected && ! $db->database_selected)
|
if (empty($_POST["db_create_database"]) && $db->connected && ! $db->database_selected)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user