-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwatussi_log.php
executable file
·74 lines (59 loc) · 3.2 KB
/
watussi_log.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/php
<?php
/* watussi_log.php
* Première version : 30 novembre 2012
* Dernière modification : 3 décembre 2012
.---------------------------------------------------------------------------.
| Software: WatussiBox Free |
| Version: 0.1 |
| Contact: [email protected] |
| Info: http://www.watussi.fr |
| Support: http://www.watussi.fr |
| ------------------------------------------------------------------------- |
| Author: Jean-Benoît MOINGT |
| ------------------------------------------------------------------------- |
| License: Distributed under the Creative Commons license (BY-NC-SA ) |
| http://creativecommons.org/licenses/by-nc-sa/3.0/ |
| |
| This program is distributed in the hope that it will be useful - WITHOUT |
| ANY WARRANTY. |
| ------------------------------------------------------------------------- |
| Licence: Distribué sous licence Creative Commons (BY-NC-SA) |
| http://creativecommons.org/licenses/by-nc-sa/3.0/fr/ |
| |
| Ce programme est distribué dans l'espoir qu'il sera utile - SANS AUCUNE |
| GARANTIE. |
| ------------------------------------------------------------------------- |
| Nous offrons un certain nombre de services complémentaire : |
| - Versions enrichies en fonctionnalitées |
| - Support |
| - Formation |
| - Conseil |
| - Développements spécifiques |
| --> Contactez-nous : [email protected] |
'---------------------------------------------------------------------------'
*/
include_once('inc/connect.inc.php');
include_once('inc/fonctions.inc.php');
//error_log("test insert", 1, "[email protected]");
$link = mysql_connect($CONFIG_TAB['host'], $CONFIG_TAB['login_db'], $CONFIG_TAB['password_db']);
mysql_select_db($CONFIG_TAB['database']);
//error_log("apres insert", 1, "[email protected]");
$stdin = fopen("php://stdin", "r");
ob_implicit_flush (true); // Use unbuffered output
while ($line = fgets ($stdin))
{
$tmp = explode('|||', $line);
$adresse_ip = $tmp[0];
$referer = $tmp[1];
$user_agent = $tmp[2];
$dom = $tmp[3];
$path = $tmp[4];
$tmp2 = explode(" ", $path);
$path = $tmp2[1];
$url = $dom . $path;
$RES_CODE = $tmp[5];
$RESPONSE_TIME = $tmp[6];
add_log($adresse_ip, $referer, $user_agent, $url, $RES_CODE, $RESPONSE_TIME);
}
mysql_close($link);