From 37ea2daf168d0b12ce7196f224bc67bcc17cfebd Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Thu, 10 May 2012 15:44:25 -0300 Subject: imspector-dev - fix report files --- config/imspector-dev/services_imspector_logs2.php | 38 ++++++++++++++--------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'config/imspector-dev/services_imspector_logs2.php') diff --git a/config/imspector-dev/services_imspector_logs2.php b/config/imspector-dev/services_imspector_logs2.php index a90ae6ca..368edeec 100644 --- a/config/imspector-dev/services_imspector_logs2.php +++ b/config/imspector-dev/services_imspector_logs2.php @@ -62,23 +62,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") { @@ -105,7 +113,7 @@ if ($_POST['mode'] == "render") { $satir_oku = fgets($fd); $ipsinibulduk = explode(':',$satir_oku); - print("\n"); + print("
kullanilan [$localuser] adresine ait local ip: [$ipsinibulduk[0]]
\n"); while (!feof($fd)) { $line = fgets($fd); if(feof($fd)) continue; @@ -196,7 +204,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() { @@ -247,7 +255,7 @@ function updatepage(str) /* determine the title of this conversation */ var details = parts[1].split(","); - var title = "
user [$localuser] at local ip: [$ipsinibulduk[0]]
"+ details[3]+ " tarihli " + "[" + details[1]+ " ]"+ " ile " + "[ " + details[2] + " ] " + details[0] + " görüsme kaydi
"; + var title = "
"+ details[3]+ " dated " + "[" + details[1]+ " ]"+ " with " + "[ " + details[2] + " ] " + details[0] + " records
"; if (!details[1]) title = " "; if (!parts[2]) parts[2] = " "; @@ -285,7 +293,7 @@ print($zz);
-
 
+
 
-- cgit v1.2.3