Pfsense sgerror page custom - Hata sayfası özelleştirme

Steps to get custom Page to work with transparent proxy with GUI on a http standard and nonstandard port

1. Kurulu olması gerekiyor bu paketlerin  squid, Squidguard, Lightsquid
2. güncelleyin blacklisti
3. squidguard ayarlarınızı kendinize uygun yapın ve birkaç kategori ekleyebilirsiniz.
4. bir kullanıcıda test edin yasak adreslerin çalışıp çalışmadığını
5. Editlenecek dosya buradadır. /usr/local/www/sgerror.php

 

SİLİN;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# IE displayed self-page, if them size > 1024
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function get_error_page($er_code_id, $err_msg='') {
        global $err_code;
        global $cl;
        $str = Array();

        header("HTTP/1.1 " . $err_code[$er_code_id]);

        $str[] = '<html>';
        $str[] = '<body>';
        $str[] = '<h3>Request denied by pfSense proxy: ' . $err_code[$er_code_id] . '</h3>';
        if ($err_msg) $str[] = " Reason: $err_msg";
        $str[] = '<hr size="1" noshade>';
        if ($cl['a'])        $str[] = " Client address: {$cl['a']} 
";
        if ($cl['n'])        $str[] = " Client name:     {$cl['n']} 
";
        if ($cl['i'])        $str[] = " Client user:     {$cl['i']} 
";
        if ($cl['s'])        $str[] = " Client group:   {$cl['s']} 
";
        if ($cl['t'])        $str[] = " Target group:   {$cl['t']} 
";
        if ($cl['u'])        $str[] = " URL:             {$cl['u']} 
";
        $str[] = '<hr size="1" noshade>';
        $str[] = "</body>";
        $str[] = "</html>";

        return implode("\n", $str);
}

YAPIŞTIRIN;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# IE displayed self-page, if them size > 1024
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function get_error_page($er_code_id, $err_msg='') {
        global $err_code;
        global $cl;
        $str = Array();

        header("HTTP/1.1 " . $err_code[$er_code_id]);
   $str[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">';
        $str[] = '<html>';
      $str[] = '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title></head>';
        $str[] = '<body style="background-color:#FFFFFF; font-family:verdana, arial, sans serif;">';
      $str[] = '<div style="width:70%; margin:20px auto;">';
      $str[] = '<div style="padding:5px; background-color:#C0C0C0; text-align:right; font-weight:bold; font-family:verdana,arial,sans serif; color:#000000; font-size:60%;">';
                if ($cl['n'])        $str[] = "Client Name: {$cl['n']} | ";
                if ($cl['a'])        $str[] = "Client IP: {$cl['a']} | ";
                if ($cl['i'])        $str[] = "Client User: {$cl['i']} | ";
                if ($cl['s'])        $str[] = "Group: {$cl['s']} | ";
                if ($cl['t'])        $str[] = "Category: {$cl['t']} ";
      $str[] = '</div><div style="background-color:#F4F4F4; text-align:center; padding:20px;">';

    $str[] = '<div style="letter-spacing:0.5em; word-spacing:1em; padding:20px; background-color:#FF0000; text-align:center; color:#FFFFFF; font-size:200%; font-weight: bold;">Site Engellendi!</div>';
    $str[] = '<div style="padding:20px; margin-top:20px; background-color:#E2E2E2; text-align:center; color:#000000; font-family:verdana, arial, sans serif; font-size:80%;">';
    if ($err_msg) $str[] = '<p style="font-weight:bold; font-size:150%;">- '. $err_msg.' -</p>';
    if ($cl['u'])        $str[] = "<p>URL: {$cl['u']}</p>";
    $str[] = '<p>Girmeye calistiginiz sayfa icerigi zararli veya yasak listesindedir.Girmeniz gerektigini dusunuyorsaniz Bilgi Teknolojilerine haber veriniz.</p>';
     $str[] = '<p><img style="padding-top:20px;display: block;margin: 0px auto" src="http://'. $_SERVER['HTTP_HOST'] .'/banner.png" alt="geblockt"></p></div></div>';
        $str[] = '<div style="padding:5px; background-color:#C0C0C0; text-align:right; color:#FFFFFF; font-size:60%; font-family:verdana,arial,sans serif;">Web Filtering by <a style="color:#FFFFFF;">PfSense[/url] and <a style="color:#FFFFFF;">SquidGuard[/url]</div></div>';
        $str[] = "</body>";
        $str[] = "</html>";

        return implode("\n", $str);
}

 

not: her ihtimale karşı dosyayı editlemeden önce bir kenara yedegini alın
Pfsense sgerror page custom - Hata sayfası özelleştirme Pfsense sgerror page custom - Hata sayfası özelleştirme Reviewed by Admin on 13:53 Rating: 5

2 yorum:

Yorumunuz için teşekkürler

Blogger tarafından desteklenmektedir.