Issues with "Log Pages Denied by SquidGuard", again
-
I'm currently trying to log denied SquidGuard requests at Services -> Squid Proxy Server -> General. I've checked Log Pages Denied by SquidGuard. I'm now wanting to add some code to
sgerror.phpto allow the logging to work. The hint says:Important: This option will only work if you include the code below in your sgerror.php file. This forces the client browser to send a second request to Squid with the denied string in URL. $sge_prefix = (preg_match("/\?/", $cl['u']) ? "&" : "?"); $str[] = '< iframe > src="'. $cl['u'] . $sge_prefix . 'sgr=ACCESSDENIED" width="1" height="1" > < /iframe >'; Hint: You MUST remove extra spaces in the above iframe HTML tags.Where do I add this code to
sgerror.php(copy of file attached: sgerror.php.txt)?I know this has been covered before but none of the answers I could find online are relevant to pfSense v2.4.5.
-
@siz said in Issues with "Log Pages Denied by SquidGuard", again:
sgerror.php.txt
Segue um arquivo customizado.
Abra seu arquivo atual via WebGui
Diagnostics -> Edit File
abra o arquivo sgerror.phpSubstitua o conteúdo completo por esse arquivo Customizado
sgerror.txt -
I think after
<?php if ($cl['u']): ?> <b> URL: </b> <?= htmlspecialchars($cl['u']) ?><br/>Make it ...
<?php if ($cl['u']): ?> <b> URL: </b> <?= htmlspecialchars($cl['u']) ?><br/> <?php $sge_prefix = (preg_match("/\?/", $cl['u']) ? "&" : "?"); $str = '<iframe> src="'. $cl['u'] . $sge_prefix . 'sgr=ACCESSDENIED" width="1" height="1"> </iframe>'; ?> <?= $str ?> <?php endif; ?> <hr size="1" noshade> </body>Ref:
https://forums.phpfreaks.com/topic/313731-need-assistance-with-placement-of-code-for-php-script/ -
Make sure ..
"Hint: You MUST remove extra spaces in the above iframe HTML tags."
$sge_prefix = (preg_match("/?/", $cl['u']) ? "&" : "?");
$str[] = '<iframe> src="'. $cl['u'] . $sge_prefix . 'sgr=ACCESSDENIED" width="1" height="1"></iframe>';But it makes an array,, let me test more
-

This seems to work but the logs do not say ACCESSDENIED
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy