diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2012-04-03 11:30:45 -0300 |
---|---|---|
committer | Marcello Coutinho <marcellocoutinho@gmail.com> | 2012-04-03 11:30:45 -0300 |
commit | 696e201450f9ca8de457df305b30c4766bf13712 (patch) | |
tree | accc4c07c29813356da50db4804d913d5bf9d225 /config/sarg/sarg_reports.php | |
parent | 0737b58f4d8a8d676342bd6cc9757d167f6dcbb9 (diff) | |
download | pfsense-packages-696e201450f9ca8de457df305b30c4766bf13712.tar.gz pfsense-packages-696e201450f9ca8de457df305b30c4766bf13712.tar.bz2 pfsense-packages-696e201450f9ca8de457df305b30c4766bf13712.zip |
sarg - fix images on report and improve file tests
Diffstat (limited to 'config/sarg/sarg_reports.php')
-rwxr-xr-x | config/sarg/sarg_reports.php | 60 |
1 files changed, 1 insertions, 59 deletions
diff --git a/config/sarg/sarg_reports.php b/config/sarg/sarg_reports.php index 9eee5302..bad7ba05 100755 --- a/config/sarg/sarg_reports.php +++ b/config/sarg/sarg_reports.php @@ -28,64 +28,7 @@ */ require("guiconfig.inc"); -function get_cmd(){ - global $config,$g; - if ($_REQUEST['cmd'] =='sarg'){ - - #Check report xml info - if (!is_array($config['installedpackages']['sargrealtime'])){ - $config['installedpackages']['sargrealtime']['config'][0]['realtime_types']= ""; - $config['installedpackages']['sargrealtime']['config'][0]['realtime_users']= ""; - } - #Check report http actions to show - if ($config['installedpackages']['sargrealtime']['config'][0]['realtime_types'] != $_REQUEST['qshape']){ - $config['installedpackages']['sargrealtime']['config'][0]['realtime_types']= $_REQUEST['qshape']; - $update_config++; - } - - #Check report users show - if ($config['installedpackages']['sargrealtime']['config'][0]['realtime_users'] != $_REQUEST['qtype']){ - $config['installedpackages']['sargrealtime']['config'][0]['realtime_users']= $_REQUEST['qtype']; - $update_config++; - } - - if($update_config > 0){ - write_config; - #write changes to sarg_file - $sarg_config=file_get_contents('/usr/local/etc/sarg/sarg.conf'); - $pattern[0]='/realtime_types\s+[A-Z,,]+/'; - $pattern[1]='/realtime_unauthenticated_records\s+\w+/'; - $replace[0]="realtime_types ".$_REQUEST['qshape']; - $replace[1]="realtime_unauthenticated_records ".$_REQUEST['qtype']; - file_put_contents('/usr/local/etc/sarg/sarg.conf', preg_replace($pattern,$replace,$sarg_config),LOCK_EX); - } - exec("/usr/local/bin/sarg -r", $sarg); - $patern[0]="/<?(html|head|style)>/"; - $replace[0]=""; - $patern[1]="/header_\w/"; - $replace[1]="listtopic"; - $patern[2]="/class=.data./"; - $replace[2]='class="listlr"'; - $patern[3]="/cellpadding=.\d./"; - $replace[3]='cellpadding="0"'; - $patern[4]="/cellspacing=.\d./"; - $replace[4]='cellspacing="0"'; - $patern[5]="/sarg/"; - $replace[5]='cellspacing="0"'; - - foreach ($sarg as $line){ - if (preg_match("/<.head>/",$line)) - $print ="ok"; - if ($print =="ok" && !preg_match("/(sarg realtime|Auto Refresh)/i",$line)) - print preg_replace($patern,$replace,$line); - } - } -} -if ($_REQUEST['cmd']!=""){ - get_cmd(); - } -else{ $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); if(strstr($pfSversion, "1.2")) $one_two = true; @@ -103,7 +46,7 @@ else{ <?php if ($savemsg) print_info_box($savemsg); ?> - <form action="postfix_view_config.php" method="post"> + <form> <div id="mainlevel"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> @@ -139,7 +82,6 @@ else{ </form> <?php include("fend.inc"); - } ?> </body> </html> |