From: Tim Otten Date: Thu, 18 Aug 2016 21:40:48 +0000 (-0700) Subject: CRM-12132 - Declare `secure_cache_timeout_minutes` setting X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d976a712b36f130f311ea3bef855fdbd09871144;p=civicrm-core.git CRM-12132 - Declare `secure_cache_timeout_minutes` setting --- diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index 012abb8334..a901331290 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -38,12 +38,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) */ @@ -312,7 +306,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 1484bc778a..797818ad3f 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -765,6 +765,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',