This will fix an issue with templates of other users being applied to different users logged in. Basically the first cached page would be displayed for all users. Created a new cache key for smarty to allow the user ID to be reference in the cache key. Hence each user has their own cached file which will be used. Improved caching by creating subdirectories for cached files. This way we won't run into a file limit per directory with a lot of cached files. This fixes #430 and the mentioned issue in that report.
20 lines
650 B
PHP
20 lines
650 B
PHP
<?php
|
|
|
|
// Make sure we are called from index.php
|
|
if (!defined('SECURITY')) die('Hacking attempt');
|
|
|
|
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
|
$debug->append('No cached version available, fetching from backend', 3);
|
|
if ($user->isAuthenticated()) {
|
|
$aHourlyHashRates = $statistics->getHourlyHashrateByAccount($_SESSION['USERDATA']['id']);
|
|
$aPoolHourlyHashRates = $statistics->getHourlyHashrateByPool();
|
|
}
|
|
$smarty->assign("YOURHASHRATES", @$aHourlyHashRates);
|
|
$smarty->assign("POOLHASHRATES", @$aPoolHourlyHashRates);
|
|
} else {
|
|
$debug->append('Using cached page', 3);
|
|
}
|
|
|
|
$smarty->assign("CONTENT", "default.tpl");
|
|
?>
|