append_sid()
hook that is preventing the function from continuing? If all you're doing is making sure that no SID is actually added to a URL then you ought to be able to do this by simply doing:
Code: Select all
$SID = '?sid=';
$user->session_id = $_SID = '';
append_sid()
function to execute normally, or you could set those values somewhere further up in the script's execution; basically anywhere after the line $user->session_begin()
on support scripts, which would remove the need for a hook entirely. I've done it in my mod using my clear_session()
method).$_EXTRA_URL
array, which should be much easier for my mod overall, and should work fine with your hook as long as it appends $_EXTRA_URL
values.$SID
and $_SID
is better than returning whole string. I'll change it after mod validation finishing.$_EXTRA_URL
to add its parameter, and has a routine for stripping parameters from links that shouldn't have them (most notably redirects during login). This also greatly simplifies changes to the append_sid() function (only a single block is inserted, no fiddly in-line additions).No, I haven't been bothering since the mod's been in development, and I've made more than enough copy/paste mistakes just with a single install fileKot Matroskin wrote:Do you have MODX update from 0.2.0 within the archive?
Code: Select all
<?php
/* BEGIN mod_http_guest_cache */
/**
*
* @package phpBB Guest Cache Russian Pthelovod 2013
* @copyright (c) 2013 Haravikk (haravikk.com)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
// Compatibility
'CGP_CAT_NAME' => 'Кеш страницы',
// ACP Module
'ACP_MOD_HTTP_GUEST_CACHE' => 'HTTP кеш Гостям',
'ACP_MOD_HTTP_GUEST_CACHE_EXP' => 'Включение и настройка Промежуточного HTTP Кеширования страниц Гостям. Настройки действуют при правах запрещающих написание ответов и создания тем гостями. <strong>Важно</strong>: для проверки изменений для гостей при установке различных модов данную опцию необходимо отключать для того, что бы появилась возможность отслеживать изменения от установленных новых модов.',
// ACP Settings
'ACP_MOD_HTTP_GUEST_CACHE_GENERAL_INFO' => 'Основные настройки',
'ACP_MOD_HTTP_GUEST_CACHE_ENABLE' => 'Включить HTTP кеш Гостям',
'ACP_MOD_HTTP_GUEST_CACHE_PARAM' => 'Путь к папке кеша',
'ACP_MOD_HTTP_GUEST_CACHE_PARAM_EXP' => 'Указать путь в папке кеша форума (cache) относительно корневой папки форума.',
'ACP_MOD_HTTP_GUEST_CACHE_TIME' => 'Интервал времени',
'ACP_MOD_HTTP_GUEST_CACHE_TIME_EXP' => 'Интервал времени для сохранения Промежуточных Кешированных страниц в минутах. Минимальное время минута, но возрастает нагрузка на ресурсы сервера. Максимально значение - 999 минут. По умолчанию стоит 15 минут.',
// ACP Features
'ACP_MOD_HTTP_GUEST_CACHE_FEATURES_INFO' => 'Особенности',
'ACP_MOD_HTTP_GUEST_CACHE_SEARCH' => 'Включение HTTP кеша в search.php',
'ACP_MOD_HTTP_GUEST_CACHE_JSTIME' => 'Показ времени через Javascript',
'ACP_MOD_HTTP_GUEST_CACHE_JSTIME_EXP' => 'Данная настройка позволяет заменять действительное время на форуме через Javascript на время создания файлов Промежуточного Кеша. Действительное время будет заменено на время создания Промежуточых Кешированых страниц для всех пользователей, независимо от прав. При отключении данной опции время будет отображаться в соответствии с настройками каждого пользователя. <strong>Важно</strong>: при отсутствии поддержки Javascript в браузерах пользователей время страниц будет выводиться в соответствии с настройками сервера и личных настроек каждого.',
'ACP_MOD_HTTP_GUEST_CACHE_SET_COOKIE' => 'Игнорировать директиву no-cache="set-cookie".',
'ACP_MOD_HTTP_GUEST_CACHE_SET_COOKIE_EXP' => 'Некоторые HTTP кеши не обрабатывают "no-cache" в заголовках и просто трактуют любое значение как некешируемое. В этом случае Вы можете пропускать этот заголовок для совместимости.',
// Load Settings
'ACP_MOD_HTTP_GUEST_CACHE_LOAD_INFO' => 'Слежение за Маркировкой',
'ACP_MOD_HTTP_GUEST_CACHE_MARK' => 'Слежение за Использованием Маркировки тем и сообщений для гостей',
'ACP_MOD_HTTP_GUEST_CACHE_MARK_EXP' => 'Включение слежения за Маркировкой тем для гостей требует использование дополнительных мощностей сервера и предотвращает быстрое HTTP кеширование главной, списков форумов и тем. Рекомендуется не использовать слежение за Маркировкой тем для гостей.',
// Logs
'LOG_MOD_HTTP_GUEST_CACHE_CONFIG' => '<strong>Изменены настройки HTTP кеш Гостей</strong><br />» %s',
/**
* A copy of Handyman` s MOD version check, to view it on the portal overview
*/
'ANNOUNCEMENT_TOPIC' => 'Сообщение о новом выпуске',
'CURRENT_VERSION' => 'Текущая версия',
'DOWNLOAD_LATEST' => 'Обновление текущей версии',
'LATEST_VERSION' => 'Последняя версия',
'NO_INFO' => 'Не удалось связаться с сервером для определения имеющейся новой версии',
'NOT_UP_TO_DATE' => '%s не по дате',
'RELEASE_ANNOUNCEMENT' => 'Важное сообщение',
'UP_TO_DATE' => '%s на текущее время',
'VERSION_CHECK' => 'MOD Проверка версии',
));
DirectoryIndex home.php index.php index.html index.htm
append_sid
function, and if you are viewing a cacheable page then my mod ensures that the cache parameter is added by this function so that all pages you visit are also pulled from caches (if possible).The ip' of course is cloudflare but I'm thinking it would probably be best to use phpbb3's user IP? that error happens when I go to my home.php and gives me a cached logged out version of the page( am I right?) since I am able to go back or click back to other pages and remain logged in.. this is with or without your MOD edit to my custom page.Session IP/browser/X_FORWARDED_FOR check failed
»User IP “108.162.217” checked against session IP “108.162.216”, user browser string “” checked against session browser string “” and user X_FORWARDED_FOR string “” checked against session X_FORWARDED_FOR string “”.
My problem was that I had an additional rule set up that used a different pattern but was basically the same.Haravikk wrote:I'm not sure you need to do this? My site uses CloudFlare but I still see the correct IP addresses if I look at post info (the question mark in a triangle icon on prosilver); CloudFlare should function as a transparent proxy in that the server shouldn't know it's there unless it specifically looks for CloudFlare specific headers.
Are you definitely receiving unexpected IP addresses? As I say I didn't have to change anything personally, I just activated CloudFlare and once the DNS changes went through it just worked. Only issue I had was that it wasn't caching pages, hence my need to create this mod
Code: Select all
$this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? (string) $_SERVER['REMOTE_ADDR'] : '';
Code: Select all
$this->ip = (!empty($_SERVER['HTTP_CF_CONNECTING_IP']))
? (string) $_SERVER['HTTP_CF_CONNECTING_IP']
: ((!empty($_SERVER['REMOTE_ADDR'])) ? (string) $_SERVER['REMOTE_ADDR'] : '');
I can't say for sure as I don't have nginx setup to test it, but I don't see any reason why it shouldn't work as the mod doesn't use any features that phpBB doesn't already require in order to run. So if you can run phpBB then this mod should work.SuperFedya wrote:This mod works fine with Nginx server without Apache?