Subversion Repositories ALCASAR

Rev

Rev 1867 | Rev 1978 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1867 Rev 1878
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: index.php 1867 2016-05-04 12:22:08Z raphael.pion $
2
# $Id: index.php 1878 2016-05-09 13:09:13Z raphael.pion $
3
#
3
#
4
# index.php for ALCASAR captive portal
4
# index.php for ALCASAR captive portal
5
# by REXY
5
# by REXY
6
# UI & css style by stephane ERARD
6
# UI & css style by stephane ERARD
7
# The contents of this file may be used under the terms of the GNU
7
# The contents of this file may be used under the terms of the GNU
Line 57... Line 57...
57
# Obtenir l'état de connexion de l'utilisateur. 1 si connecté sinon 0.
57
# Obtenir l'état de connexion de l'utilisateur. 1 si connecté sinon 0.
58
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
58
exec ("sudo /usr/sbin/chilli_query list|grep $remote_ip" , $tab);
59
$user = explode (" ", $tab[0]);
59
$user = explode (" ", $tab[0]);
60
 
60
 
61
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso)
61
# on discrimine les accès directs sur Alcasar par rapport aux redirections (blacklist ou pannes rso)
62
if (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || preg_match ("/^alcasar$/", $_SERVER['HTTP_HOST']) || preg_match ("/^$hostname$/", $_SERVER['HTTP_HOST']) || preg_match ("/^$organisme$/", $_SERVER['HTTP_HOST']))
62
if (isset($_SERVER['HTTP_HOST']) && (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || preg_match ("/^alcasar$/", $_SERVER['HTTP_HOST']) || preg_match ("/^$hostname$/", $_SERVER['HTTP_HOST']) || preg_match ("/^$organisme$/", $_SERVER['HTTP_HOST'])))
63
	{
63
	{
64
	$direct_access=True;
64
	$direct_access=True;
65
	}
65
	}
66
#### Affichage des 3 dernières connexions de $user[5]
66
#### Affichage des 3 dernières connexions de $user[5]
67
function secondsToDuration($seconds = null){
67
function secondsToDuration($seconds = null){