diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2012-05-10 15:44:25 -0300 |
---|---|---|
committer | marcelloc <marcellocoutinho@gmail.com> | 2012-05-10 15:44:25 -0300 |
commit | 37ea2daf168d0b12ce7196f224bc67bcc17cfebd (patch) | |
tree | 79ed019326eebbadc84ceadb512446f971861561 /config/imspector-dev/services_imspector_logs.php | |
parent | 026fdf7b9de180f2d92b5796421848e82be6e5f4 (diff) | |
download | pfsense-packages-37ea2daf168d0b12ce7196f224bc67bcc17cfebd.tar.gz pfsense-packages-37ea2daf168d0b12ce7196f224bc67bcc17cfebd.tar.bz2 pfsense-packages-37ea2daf168d0b12ce7196f224bc67bcc17cfebd.zip |
imspector-dev - fix report files
Diffstat (limited to 'config/imspector-dev/services_imspector_logs.php')
-rw-r--r-- | config/imspector-dev/services_imspector_logs.php | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/config/imspector-dev/services_imspector_logs.php b/config/imspector-dev/services_imspector_logs.php index aa6a9a9b..e44ef35f 100644 --- a/config/imspector-dev/services_imspector_logs.php +++ b/config/imspector-dev/services_imspector_logs.php @@ -61,23 +61,31 @@ $convo_remote_bgcolor = '#eeeeee'; /* functions */ function convert_dir_list ($topdir) { - if (!is_dir($topdir)) return; + global $config; + if (!is_dir($topdir)) + return; + $imspector_config = $config['installedpackages']['imspector']['config'][0]; + $limit=(preg_match("/\d+/",$imspector_config['reportlimit'])?$imspector_config['reportlimit']:"50"); + file_put_contents("/tmp/teste.txt",$limit." teste",LOCK_EX); + $count=0; if ($dh = opendir($topdir)) { - $limit=(is_numericint($imspector_config['limit'])?$imspector_config['limit']:"1000"); - $count=0; - while (($file = readdir($dh)) !== false && $count < $limit) { - if(!preg_match('/^\./', $file) == 0) continue; - if (is_dir("$topdir/$file")) { + while (($file = readdir($dh)) !== false) { + if(!preg_match('/^\./', $file) == 0) + continue; + if (is_dir("$topdir/$file")) $list .= convert_dir_list("$topdir/$file"); - } else { + else $list .= "$topdir/$file\n"; + $count ++; + if($count >= $limit){ + closedir($dh); + return $list; + } } - $count ++; - } closedir($dh); - } + } return $list; -} + } /* ajax response */ if ($_POST['mode'] == "render") { @@ -188,7 +196,7 @@ function xmlhttpPost() else if (window.ActiveXObject) self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); - self.xmlHttpReq.open('POST', 'services_imspector_logs.php', true); + self.xmlHttpReq.open('POST', 'imspector_logs.php', true); self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpReq.onreadystatechange = function() { |