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.
27 lines
903 B
PHP
27 lines
903 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 ($bitcoin->can_connect() === true){
|
|
$dDifficulty = $bitcoin->query('getdifficulty');
|
|
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
|
$dDifficulty = $dDifficulty['proof-of-work'];
|
|
$iBlock = $bitcoin->query('getblockcount');
|
|
} else {
|
|
$dDifficulty = 1;
|
|
$iBlock = 0;
|
|
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to litecoind RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'errormsg');
|
|
}
|
|
$smarty->assign("CURRENTBLOCK", $iBlock);
|
|
$smarty->assign("DIFFICULTY", $dDifficulty);
|
|
} else {
|
|
$debug->append('Using cached page', 3);
|
|
}
|
|
|
|
$smarty->assign("CONTENT", "default.tpl");
|
|
?>
|