diff options
author | Tim-Hinnerk Heuer <tim@innocraft.com> | 2021-09-04 10:20:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-04 10:20:24 +0300 |
commit | 5d5e630e06b7941d22fc338ee964e30f06ad74af (patch) | |
tree | b18d74e10e3467c7604e64b62b81ba471e55e6ce /core | |
parent | 7e0b0e602068a558a84f1e16fde5e7e6cb0b7fa4 (diff) |
show users more informative information on error (#17900)
* show users more informative information on error
fixes #15135
* add rel="noreferrer noopener" #15135
* show faq section only outside of cloud #15036
* privatise variables
contributing to View::showMoreFaqInfo #15135
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/Config.php | 6 | ||||
-rw-r--r-- | core/View.php | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/core/Config.php b/core/Config.php index f1230fd223..aad607e0c3 100644 --- a/core/Config.php +++ b/core/Config.php @@ -13,6 +13,8 @@ use Exception; use Piwik\Application\Kernel\GlobalSettingsProvider; use Piwik\Container\StaticContainer; use Piwik\Exception\MissingFilePermissionException; +use Piwik\Plugins\CoreAdminHome\Controller; +use Piwik\Plugins\CorePluginsAdmin\CorePluginsAdmin; use Piwik\ProfessionalServices\Advertising; /** @@ -183,10 +185,12 @@ class Config return array( 'action_url_category_delimiter' => $general['action_url_category_delimiter'], 'action_title_category_delimiter' => $general['action_title_category_delimiter'], + 'are_ads_enabled' => Advertising::isAdsEnabledInConfig($general), 'autocomplete_min_sites' => $general['autocomplete_min_sites'], 'datatable_export_range_as_day' => $general['datatable_export_range_as_day'], 'datatable_row_limits' => $this->getDatatableRowLimits(), - 'are_ads_enabled' => Advertising::isAdsEnabledInConfig($general) + 'enable_general_settings_admin' => Controller::isGeneralSettingsAdminEnabled(), + 'enable_plugins_admin' => CorePluginsAdmin::isPluginsAdminEnabled(), ); } diff --git a/core/View.php b/core/View.php index 36596e9997..c5c3b14899 100644 --- a/core/View.php +++ b/core/View.php @@ -11,11 +11,11 @@ namespace Piwik; use Exception; use Piwik\AssetManager\UIAssetCacheBuster; use Piwik\Container\StaticContainer; -use Piwik\Session\SessionAuth; +use Piwik\Plugins\CoreAdminHome\Controller; +use Piwik\Plugins\CorePluginsAdmin\CorePluginsAdmin; use Piwik\View\ViewInterface; use Piwik\View\SecurityPolicy; use Twig\Environment; -use Twig\Error\Error; /** * Transition for pre-Piwik 0.4.4 @@ -153,6 +153,11 @@ class View implements ViewInterface $this->piwik_version = Version::VERSION; $this->userLogin = Piwik::getCurrentUserLogin(); $this->isSuperUser = Access::getInstance()->hasSuperUserAccess(); + // following is used in ajaxMacros called macro (showMoreHelp as passed in other templates) - requestErrorDiv + $isGeneralSettingsAdminEnabled = Controller::isGeneralSettingsAdminEnabled(); + $isPluginsAdminEnabled = CorePluginsAdmin::isPluginsAdminEnabled(); + // simplify template usage + $this->showMoreFaqInfo = $this->isSuperUser && ($isGeneralSettingsAdminEnabled || $isPluginsAdminEnabled); try { $this->piwikUrl = SettingsPiwik::getPiwikUrl(); |