Skip to content

Commit 3b5d0a8

Browse files
committed
CSFR Token expire cache
1 parent 0f45fe4 commit 3b5d0a8

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php if ($currentUser->hasAccessTo('lhsystem','expirecache')) : ?>
2-
<li><a href="<?php echo erLhcoreClassDesign::baseurl('system/expirecache')?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Clean cache');?></a></li>
2+
<li><a class="csfr-required" href="<?php echo erLhcoreClassDesign::baseurl('system/expirecache')?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Clean cache');?></a></li>
33
<?php endif; ?>

lhc_web/modules/lhsystem/expirecache.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
$currentUser = erLhcoreClassUser::instance();
4+
5+
if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
6+
die('Invalid CSFR Token');
7+
exit;
8+
}
39

410
$CacheManager = erConfigClassLhCacheConfig::getInstance();
511
$CacheManager->expireCache(true);

lhc_web/modules/lhsystem/module.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636

3737
$ViewList['expirecache'] = array(
3838
'params' => array(),
39-
'functions' => array( 'expirecache' )
39+
'functions' => array( 'expirecache' ),
40+
'uparams' => array('csfr')
4041
);
4142

4243
$ViewList['smtp'] = array(

0 commit comments

Comments
 (0)