[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
1 changed files with 3 additions and 5 deletions

View File

@ -26,6 +26,8 @@ $GLOBALS['config']['IPBANS_FILENAME'] = $GLOBALS['config']['DATADIR'].'/ipbans.p
$GLOBALS['config']['BAN_AFTER'] = 4;
// Ban duration for IP address after login failures (in seconds) (1800 sec. = 30 minutes)
$GLOBALS['config']['BAN_DURATION'] = 1800;
// Use cache
$GLOBALS['config']['USECACHE'] = false;
// Page cache directory.
$GLOBALS['config']['PAGECACHE'] = 'pagecache';
// Download method
@ -147,10 +149,6 @@ function genToken() {
}
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) {
ban();
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>
<?php
$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']);
}
if (!empty($cache)) {