Changeset 14141 for trunk/FACT++
- Timestamp:
- 06/10/12 14:38:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/smartfact/index.php
r14121 r14141 64 64 if (isset($_GET['load'])) 65 65 { 66 require_once('log/Browscap.php'); 67 66 68 $d = date("Y/m"); 67 69 68 70 $path = "log/".$d; 69 71 72 if (!file_exists("log/cache")) 73 mkdir("log/cache", 0777, true); 74 70 75 if (!file_exists($path)) 71 76 mkdir($path, 0777, true); 72 77 73 $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "-";74 $user = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : "-";78 $addr = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ""; 79 $user = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : ""; 75 80 $dns = gethostbyaddr($addr); 76 81 82 $bcap = new phpbrowscap\Browscap('log/cache'); 83 $info = $bcap->getBrowser(); 84 77 85 $file = fopen($path."/smartfact.log", "a"); 78 fwrite($file, date("Y/m/d H:i:s ").$addr." ".$dns." ".$user."\n"); 86 fwrite($file, 87 date("Y-m-d H:i:s\t").$addr. 88 "\t".$dns. 89 "\t".$user. 90 "\t".$info->Platform. 91 "\t".$info->Browser. 92 "\t".$info->Version. 93 "\t".$info->isMobileDevice."\n"); 79 94 fclose($file); 80 95
Note:
See TracChangeset
for help on using the changeset viewer.