Subversion Repositories ALCASAR

Rev

Rev 509 | Rev 536 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 509 Rev 522
Line 6... Line 6...
6
 
6
 
7
$direct_access = False;
7
$direct_access = False;
8
$diagnostic = "eth0 link down";
8
$diagnostic = "eth0 link down";
9
$remote_ip = ($_SERVER['REMOTE_ADDR']);
9
$remote_ip = ($_SERVER['REMOTE_ADDR']);
10
$tab = array();$user = array();
10
$tab = array();$user = array();
-
 
11
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso)
-
 
12
if (($_SERVER['HTTP_HOST'] == $private_ip) || preg_match ("/^alcasar/", $_SERVER['HTTP_HOST']) || preg_match ("/^$hostname/", $_SERVER['HTTP_POST']))
-
 
13
	{
-
 
14
	$direct_access=True;
11
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
15
	exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
12
$user = explode (" ", $tab[0]);
16
	$user = explode (" ", $tab[0]);
13
# on discrimine les accès directs sur Alcasar par rapport aux redirections
-
 
14
if (($_SERVER['HTTP_HOST'] == $private_ip) || ($_SERVER['HTTP_HOST'] == "alcasar")  || ($_SERVER['HTTP_HOST'] == $hostname)){$direct_access=True;}
-
 
-
 
17
	}
15
 
18
 
16
#### Connexion  DB à faire !
19
#### Connexion  DB à faire !
17
#### Avec retour 3 dernière connexion de $user[5]
20
#### Avec retour 3 dernière connexion de $user[5]
18
$result_user =  "3 dernières connexions :";
21
$result_user =  "3 dernières connexions :";
19
 
22