Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
CSFR Token expire cache
  • Loading branch information
remdex committed Dec 17, 2021
1 parent 0f45fe4 commit 3b5d0a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
@@ -1,3 +1,3 @@
<?php if ($currentUser->hasAccessTo('lhsystem','expirecache')) : ?>
<li><a href="<?php echo erLhcoreClassDesign::baseurl('system/expirecache')?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Clean cache');?></a></li>
<li><a class="csfr-required" href="<?php echo erLhcoreClassDesign::baseurl('system/expirecache')?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Clean cache');?></a></li>
<?php endif; ?>
6 changes: 6 additions & 0 deletions lhc_web/modules/lhsystem/expirecache.php
@@ -1,5 +1,11 @@
<?php

$currentUser = erLhcoreClassUser::instance();

if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
die('Invalid CSFR Token');
exit;
}

$CacheManager = erConfigClassLhCacheConfig::getInstance();
$CacheManager->expireCache(true);
Expand Down
3 changes: 2 additions & 1 deletion lhc_web/modules/lhsystem/module.php
Expand Up @@ -36,7 +36,8 @@

$ViewList['expirecache'] = array(
'params' => array(),
'functions' => array( 'expirecache' )
'functions' => array( 'expirecache' ),
'uparams' => array('csfr')
);

$ViewList['smtp'] = array(
Expand Down

0 comments on commit 3b5d0a8

Please sign in to comment.