mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 07:42:17 +02:00
Merge branch 'hotfix/N941'
This commit is contained in:
@@ -1305,6 +1305,16 @@ EOF
|
|||||||
$sDBUser = $aParameters['db_user'];
|
$sDBUser = $aParameters['db_user'];
|
||||||
$sDBPwd = $aParameters['db_pwd'];
|
$sDBPwd = $aParameters['db_pwd'];
|
||||||
$sDBName = $aParameters['db_name'];
|
$sDBName = $aParameters['db_name'];
|
||||||
|
|
||||||
|
$bIsWindows = (array_key_exists('WINDIR', $_SERVER) || array_key_exists('windir', $_SERVER));
|
||||||
|
if ($bIsWindows && (strpos($sDBPwd, '%') !== false))
|
||||||
|
{
|
||||||
|
// Unsuported Password, disable the "Next" button
|
||||||
|
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "error");');
|
||||||
|
$oPage->add_ready_script('$("#db_info").html("<img src=\'../images/error.png\'/> Database password cannot contain % character...");');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$sTlsEnabled = (isset($aParameters['db_tls_enabled'])) ? $aParameters['db_tls_enabled'] : null;
|
$sTlsEnabled = (isset($aParameters['db_tls_enabled'])) ? $aParameters['db_tls_enabled'] : null;
|
||||||
$sTlsCA = (isset($aParameters['db_tls_ca'])) ? $aParameters['db_tls_ca'] : null;
|
$sTlsCA = (isset($aParameters['db_tls_ca'])) ? $aParameters['db_tls_ca'] : null;
|
||||||
|
|
||||||
@@ -1328,17 +1338,22 @@ EOF
|
|||||||
{
|
{
|
||||||
$aErrors[] = $oCheck->sLabel;
|
$aErrors[] = $oCheck->sLabel;
|
||||||
}
|
}
|
||||||
else if ($oCheck->iSeverity == CheckResult::WARNING)
|
else
|
||||||
|
{
|
||||||
|
if ($oCheck->iSeverity == CheckResult::WARNING)
|
||||||
{
|
{
|
||||||
$aWarnings[] = $oCheck->sLabel;
|
$aWarnings[] = $oCheck->sLabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (count($aErrors) > 0)
|
if (count($aErrors) > 0)
|
||||||
{
|
{
|
||||||
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "error");');
|
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "error");');
|
||||||
$oPage->add_ready_script('$("#db_info").html(\'<img src="../images/validation_error.png"/> <b>Error:</b> '.htmlentities(implode('<br/>', $aErrors), ENT_QUOTES, 'UTF-8').'\');');
|
$oPage->add_ready_script('$("#db_info").html(\'<img src="../images/validation_error.png"/> <b>Error:</b> '.htmlentities(implode('<br/>', $aErrors), ENT_QUOTES, 'UTF-8').'\');');
|
||||||
}
|
}
|
||||||
else if (count($aWarnings) > 0)
|
else
|
||||||
|
{
|
||||||
|
if (count($aWarnings) > 0)
|
||||||
{
|
{
|
||||||
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "");');
|
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "");');
|
||||||
$oPage->add_ready_script('$("#db_info").html(\'<img src="../images/error.png"/> <b>Warning:</b> '.htmlentities(implode('<br/>', $aWarnings), ENT_QUOTES, 'UTF-8').'\');');
|
$oPage->add_ready_script('$("#db_info").html(\'<img src="../images/error.png"/> <b>Warning:</b> '.htmlentities(implode('<br/>', $aWarnings), ENT_QUOTES, 'UTF-8').'\');');
|
||||||
@@ -1348,6 +1363,7 @@ EOF
|
|||||||
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "");');
|
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "");');
|
||||||
$oPage->add_ready_script('$("#db_info").html(\'<img src="../images/validation_ok.png"/> Database server connection Ok.\');');
|
$oPage->add_ready_script('$("#db_info").html(\'<img src="../images/validation_ok.png"/> Database server connection Ok.\');');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($checks['databases'] == null)
|
if ($checks['databases'] == null)
|
||||||
{
|
{
|
||||||
@@ -1372,6 +1388,7 @@ EOF
|
|||||||
$oPage->add_ready_script('$("#db_name").bind("click keyup change", function() { $("#existing_db").prop("checked", true); WizardUpdateButtons(); });');
|
$oPage->add_ready_script('$("#db_name").bind("click keyup change", function() { $("#existing_db").prop("checked", true); WizardUpdateButtons(); });');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$oPage->add_ready_script('WizardUpdateButtons();');
|
$oPage->add_ready_script('WizardUpdateButtons();');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user