Skip to content

Commit

Permalink
general remove database message
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Jul 28, 2017
1 parent e5f16f9 commit 2015e20
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions installation/model/database.php
Expand Up @@ -179,19 +179,18 @@ public function initialise($options)
// When all checks have been passed we don't need to do this here again.
if ($remoteDbFileTestsPassed === false)
{
// Add the general message
JFactory::getApplication()->enqueueMessage(
JText::sprintf(
'INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_GENERAL_MESSAGE',
'https://docs.joomla.org/Special:MyLanguage/J3.x:Secured_procedure_for_installing_Joomla_with_a_remote_database'
),
'warning'
$generalRemoteDatabaseMessage = JText::sprintf(
'INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_GENERAL_MESSAGE',
'https://docs.joomla.org/Special:MyLanguage/J3.x:Secured_procedure_for_installing_Joomla_with_a_remote_database'
);

$remoteDbFile = JFactory::getSession()->get('remoteDbFile', false);

if ($remoteDbFile === false)
{
// Add the general message
JFactory::getApplication()->enqueueMessage($generalRemoteDatabaseMessage, 'warning');

// This is the remote database file you need to remove if you want to use a remote database
$remoteDbFile = '_Joomla' . JUserHelper::genRandomPassword(21) . '.txt';
JFactory::getSession()->set('remoteDbFile', $remoteDbFile);
Expand Down Expand Up @@ -221,13 +220,19 @@ public function initialise($options)

if (JFactory::getSession()->get('remoteDbFileWrittenByJoomla', false) === true && file_exists(JPATH_INSTALLATION . '/' . $remoteDbFile))
{
// Add the general message
JFactory::getApplication()->enqueueMessage($generalRemoteDatabaseMessage, 'warning');

JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_DELETE_FILE', $remoteDbFile), 'error');

return false;
}

if (JFactory::getSession()->get('remoteDbFileUnwritable', false) === true && !file_exists(JPATH_INSTALLATION . '/' . $remoteDbFile))
{
// Add the general message
JFactory::getApplication()->enqueueMessage($generalRemoteDatabaseMessage, 'warning');

JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_CREATE_FILE', $remoteDbFile), 'error');

return false;
Expand Down

0 comments on commit 2015e20

Please sign in to comment.