@@ -86,14 +86,16 @@ class Config extends AbstractHelper
8686 public const XML_PATH_ADVANCED_CACHE_MEMCACHED_DSN = self ::SECTION . '/advanced/cache/memcached_dsn ' ;
8787 public const XML_PATH_ADVANCED_CACHE_CLEAN = self ::SECTION . '/advanced/cache/clean_ip_cache_duration ' ;
8888 public const XML_PATH_ADVANCED_CACHE_BAD = self ::SECTION . '/advanced/cache/bad_ip_cache_duration ' ;
89+ public const XML_PATH_ADVANCED_CACHE_CAPTCHA = self ::SECTION . '/advanced/cache/captcha_cache_duration ' ;
90+ public const XML_PATH_ADVANCED_CACHE_GEO = self ::SECTION . '/advanced/cache/geolocation_cache_duration ' ;
8991 public const XML_PATH_ADVANCED_DEBUG_LOG = self ::SECTION . '/advanced/debug/log ' ;
9092 public const XML_PATH_ADVANCED_DISPLAY_ERRORS = self ::SECTION . '/advanced/debug/display_errors ' ;
9193 public const XML_PATH_ADVANCED_DISABLE_PROD_LOG = self ::SECTION . '/advanced/debug/disable_prod_log ' ;
9294 public const XML_PATH_ADVANCED_FORCED_TEST_IP = self ::SECTION . '/advanced/debug/forced_test_ip ' ;
9395
9496 public const XML_PATH_ADVANCED_GEOLOCATION_ENABLED = self ::SECTION . '/advanced/geolocation/enabled ' ;
9597 public const XML_PATH_ADVANCED_GEOLOCATION_TYPE = self ::SECTION . '/advanced/geolocation/type ' ;
96- public const XML_PATH_ADVANCED_GEOLOCATION_SAVE_SESSION = self ::SECTION . '/advanced/geolocation/save_in_session ' ;
98+ public const XML_PATH_ADVANCED_GEOLOCATION_SAVE_RESULT = self ::SECTION . '/advanced/geolocation/save_result ' ;
9799 public const XML_PATH_ADVANCED_GEOLOCATION_MAXMIND_DB_TYPE = self ::SECTION .
98100 '/advanced/geolocation/maxmind_database_type ' ;
99101 public const XML_PATH_ADVANCED_GEOLOCATION_MAXMIND_DB_PATH = self ::SECTION .
@@ -140,6 +142,8 @@ class Config extends AbstractHelper
140142 'memcached_dsn ' => null ,
141143 'clean_ip_duration ' => null ,
142144 'bad_ip_duration ' => null ,
145+ 'captcha_duration ' => null ,
146+ 'geolocation_duration ' => null ,
143147 'trusted_forwarded_ip ' => null ,
144148 'geolocation ' => null ,
145149 ];
@@ -344,8 +348,8 @@ public function getGeolocation(): array
344348 $ result = ['enabled ' => false ];
345349 if ($ this ->scopeConfig ->getValue (self ::XML_PATH_ADVANCED_GEOLOCATION_ENABLED )) {
346350 $ result ['enabled ' ] = true ;
347- $ result ['save_in_session ' ] =
348- (bool )$ this ->scopeConfig ->getValue (self ::XML_PATH_ADVANCED_GEOLOCATION_SAVE_SESSION );
351+ $ result ['save_result ' ] =
352+ (bool )$ this ->scopeConfig ->getValue (self ::XML_PATH_ADVANCED_GEOLOCATION_SAVE_RESULT );
349353 $ type = (string )$ this ->scopeConfig ->getValue (self ::XML_PATH_ADVANCED_GEOLOCATION_TYPE );
350354 $ result ['type ' ] = $ type ;
351355 if ($ type === Constants::GEOLOCATION_TYPE_MAXMIND ) {
@@ -506,6 +510,38 @@ public function getBadIpCacheDuration(): int
506510 return (int ) $ this ->_globals ['bad_ip_duration ' ];
507511 }
508512
513+ /**
514+ * Get captcha cache duration config
515+ *
516+ * @return int
517+ */
518+ public function getCaptchaCacheDuration (): int
519+ {
520+ if (!isset ($ this ->_globals ['captcha_duration ' ])) {
521+ $ this ->_globals ['captcha_duration ' ] = (int )$ this ->scopeConfig ->getValue (
522+ self ::XML_PATH_ADVANCED_CACHE_CAPTCHA
523+ );
524+ }
525+
526+ return (int ) $ this ->_globals ['captcha_duration ' ];
527+ }
528+
529+ /**
530+ * Get geolocation cache duration config
531+ *
532+ * @return int
533+ */
534+ public function getGeolocationCacheDuration (): int
535+ {
536+ if (!isset ($ this ->_globals ['geolocation_duration ' ])) {
537+ $ this ->_globals ['geolocation_duration ' ] = (int )$ this ->scopeConfig ->getValue (
538+ self ::XML_PATH_ADVANCED_CACHE_GEO
539+ );
540+ }
541+
542+ return (int ) $ this ->_globals ['geolocation_duration ' ];
543+ }
544+
509545 /**
510546 * Get bouncing level config
511547 *
0 commit comments