Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/SettingsPiwik.php10
-rw-r--r--plugins/Installation/Controller.php7
2 files changed, 16 insertions, 1 deletions
diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php
index ae3782495c..c63925aada 100644
--- a/core/SettingsPiwik.php
+++ b/core/SettingsPiwik.php
@@ -205,7 +205,15 @@ class SettingsPiwik
if (array_key_exists('installation_in_progress', $general)) {
$isInstallationInProgress = (bool) $general['installation_in_progress'];
}
- return !$isInstallationInProgress;
+ if($isInstallationInProgress) {
+ return false;
+ }
+
+ // Check that the database section is really set, ie. file is not empty
+ if(empty(Config::getInstance()->database['username'])) {
+ return false;
+ }
+ return true;
}
diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php
index 7cb903efff..abd291d4ae 100644
--- a/plugins/Installation/Controller.php
+++ b/plugins/Installation/Controller.php
@@ -74,12 +74,19 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
/**
* Installation Step 1: Welcome
+ *
+ * Can also display an error message when there is a failure early (eg. DB connection failed)
+ *
+ * @param string Optional error message
*/
function welcome($message = false)
{
// Delete merged js/css files to force regenerations based on updated activated plugin list
Filesystem::deleteAllCacheOnUpdate();
+ if(empty($message)) {
+ $this->checkPiwikIsNotInstalled();
+ }
$view = new View(
'@Installation/welcome',
$this->getInstallationSteps(),