diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-04-07 13:51:19 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-04-07 13:51:19 +0400 |
commit | 8ffdaf7adb68b0b2daea81dcea3371810e0f9ccb (patch) | |
tree | e1482df6c852c01b95e5e48200e8bfe2610873c3 /core/SettingsPiwik.php | |
parent | aa39881b4e8cdfd93ef158ce68f4821fc7dd39c6 (diff) |
force_ssl should start working only after Piwik is installed
Diffstat (limited to 'core/SettingsPiwik.php')
-rw-r--r-- | core/SettingsPiwik.php | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php index f21e1c3328..969e21a3d6 100644 --- a/core/SettingsPiwik.php +++ b/core/SettingsPiwik.php @@ -186,6 +186,19 @@ class SettingsPiwik } /** + * Return true if Piwik is installed (installation is done). + * @return bool + */ + public static function isPiwikInstalled() + { + $config = Config::getInstance()->getLocalConfigPath(); + $exists = file_exists($config); + + // Piwik is installed if the config file is found + return $exists; + } + + /** * Returns `true` if segmentation is allowed for this user, `false` if otherwise. * * @return bool @@ -255,7 +268,7 @@ class SettingsPiwik * @param $piwikServerUrl * @return bool */ - static public function checkPiwikServerWorking($piwikServerUrl) + static public function checkPiwikServerWorking($piwikServerUrl, $acceptInvalidSSLCertificates = false) { // Now testing if the webserver is running try { @@ -267,11 +280,8 @@ class SettingsPiwik $file = null, $followDepth = 0, $acceptLanguage = false, - - // Accept self signed certificates for developers - $acceptInvalidSslCertificate = true - ); - + $acceptInvalidSSLCertificates + ); } catch (Exception $e) { $fetched = "ERROR fetching: " . $e->getMessage(); } @@ -352,4 +362,11 @@ class SettingsPiwik Option::set(self::OPTION_PIWIK_URL, $currentUrl, $autoLoad = true); } + /** + * @return bool + */ + public static function isHttpsForced() + { + return Config::getInstance()->General['force_ssl'] == 1; + } } |