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:
Diffstat (limited to 'core/ArchiveProcessor/Rules.php')
-rw-r--r--core/ArchiveProcessor/Rules.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/core/ArchiveProcessor/Rules.php b/core/ArchiveProcessor/Rules.php
index bf0f73b836..24f9cc2fe2 100644
--- a/core/ArchiveProcessor/Rules.php
+++ b/core/ArchiveProcessor/Rules.php
@@ -226,9 +226,21 @@ class Rules
return !$isArchivingEnabled;
}
- public static function isRequestAuthorizedToArchive()
+ public static function isRequestAuthorizedToArchive(Parameters $params = null)
{
- return Rules::isBrowserTriggerEnabled() || SettingsServer::isArchivePhpTriggered();
+ $isRequestAuthorizedToArchive = Rules::isBrowserTriggerEnabled() || SettingsServer::isArchivePhpTriggered();
+
+ if (!empty($params)) {
+ /**
+ * @ignore
+ *
+ * @params bool &$isRequestAuthorizedToArchive
+ * @params Parameters $params
+ */
+ Piwik::postEvent('Archiving.isRequestAuthorizedToArchive', [&$isRequestAuthorizedToArchive, $params]);
+ }
+
+ return $isRequestAuthorizedToArchive;
}
public static function isBrowserTriggerEnabled()
@@ -293,11 +305,11 @@ class Rules
*
* @return string[]
*/
- public static function getSelectableDoneFlagValues($includeInvalidated = true)
+ public static function getSelectableDoneFlagValues($includeInvalidated = true, Parameters $params = null)
{
$possibleValues = array(ArchiveWriter::DONE_OK, ArchiveWriter::DONE_OK_TEMPORARY);
- if (!Rules::isRequestAuthorizedToArchive()
+ if (!Rules::isRequestAuthorizedToArchive($params)
&& $includeInvalidated
) {
//If request is not authorized to archive then fetch also invalidated archives