[add] option for active or not the cache

[fix] not possible to login
This commit is contained in:
Knah Tsaeb 2013-08-09 10:21:40 +02:00
parent 26dd5d9d9d
commit 77b6fe53a2

View file

@ -26,6 +26,8 @@ $GLOBALS['config']['IPBANS_FILENAME'] = $GLOBALS['config']['DATADIR'].'/ipbans.p
$GLOBALS['config']['BAN_AFTER'] = 4; $GLOBALS['config']['BAN_AFTER'] = 4;
// Ban duration for IP address after login failures (in seconds) (1800 sec. = 30 minutes) // Ban duration for IP address after login failures (in seconds) (1800 sec. = 30 minutes)
$GLOBALS['config']['BAN_DURATION'] = 1800; $GLOBALS['config']['BAN_DURATION'] = 1800;
// Use cache
$GLOBALS['config']['USECACHE'] = false;
// Page cache directory. // Page cache directory.
$GLOBALS['config']['PAGECACHE'] = 'pagecache'; $GLOBALS['config']['PAGECACHE'] = 'pagecache';
// Download method // Download method
@ -147,10 +149,6 @@ function genToken() {
} }
function verifToken($token) { function verifToken($token) {
if (empty($_SESSION['log']) || $_SESSION['log'] !== true) {
ban();
die('Tinker say : Ooh! They never miss!');
}
if ($token !== $_SESSION['token'] || $_SESSION['tokenTime'] <= time() - 24000) { if ($token !== $_SESSION['token'] || $_SESSION['tokenTime'] <= time() - 24000) {
ban(); ban();
die('Tinker say : I have several theories I would like to put into practice.'); die('Tinker say : I have several theories I would like to put into practice.');
@ -627,7 +625,7 @@ if (isset($ci['dl']) && !empty($ci['dl'])) {
<body> <body>
<?php <?php
$token = genToken(); $token = genToken();
if ((empty($_SESSION['log']) || $_SESSION['log'] === false) && $ci['ac'] !== 'login') { if ((empty($_SESSION['log']) || $_SESSION['log'] === false) && $ci['ac'] !== 'login' && $GLOBALS['config']['USECACHE'] === true) {
$cache = cache($ci['bc'], $ci['file'], $ci['sort']); $cache = cache($ci['bc'], $ci['file'], $ci['sort']);
} }
if (!empty($cache)) { if (!empty($cache)) {