From 87334e0f3bce4b39b5f1d26befa9b9a55d694d99 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 18 Aug 2016 14:40:48 -0700 Subject: [PATCH] CRM-12132 - Declare `secure_cache_timeout_minutes` setting --- CRM/Core/BAO/Cache.php | 7 ------- settings/Core.setting.php | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index e807d22831..51f30566d1 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -40,12 +40,6 @@ */ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { - /** - * Const the default maximum number of minutes that secure form data should linger - * @var int - */ - const SECURE_TIMEOUT = 20; - /** * @var array ($cacheKey => $cacheValue) */ @@ -313,7 +307,6 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { public static function cleanup($session = FALSE, $table = FALSE, $prevNext = FALSE) { // first delete all sessions more than 20 minutes old which are related to any potential transaction $timeIntervalMins = (int) Civi::settings()->get('secure_cache_timeout_minutes'); - $timeIntervalMins = empty($timeIntervalMins) ? self::SECURE_TIMEOUT : $timeIntervalMins; if (TRUE) { $transactionPages = array( 'CRM_Contribute_Controller_Contribution', diff --git a/settings/Core.setting.php b/settings/Core.setting.php index 6430d873b8..babe57747d 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -797,6 +797,25 @@ return array( 'description' => 'CiviCRM will use this setting as path to bootstrap WP.', 'help_text' => NULL, ), + 'secure_cache_timeout_minutes' => array( + 'group_name' => 'CiviCRM Preferences', + 'group' => 'core', + 'name' => 'secure_cache_timeout_minutes', + 'type' => 'Integer', + 'quick_form_type' => 'Element', + 'html_type' => 'text', + 'html_attributes' => array( + 'size' => 2, + 'maxlength' => 8, + ), + 'default' => 20, + 'add' => '4.7', + 'title' => 'Secure Cache Timeout', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'Maximum number of minutes that secure form data should linger', + 'help_text' => NULL, + ), 'site_id' => array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', -- 2.25.1