Subversion Repositories ALCASAR

Rev

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

Rev 2346 Rev 2370
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: status.php 2346 2017-07-21 23:09:06Z tom.houdayer $
2
# $Id: status.php 2370 2017-08-09 23:20:58Z tom.houdayer $
3
#
3
#
4
# status.php for ALCASAR captive portal
4
# status.php for ALCASAR captive portal
5
# by steweb57 & Rexy
5
# by steweb57 & Rexy
6
# 
6
# 
7
/****************************************************************
7
/****************************************************************
Line 42... Line 42...
42
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
42
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
43
$cn = '';
43
$cn = '';
44
$connection_history = '';
44
$connection_history = '';
45
$nb_connection_history = 3;
45
$nb_connection_history = 3;
46
$homepage_url = (($conf['HTTPS_LOGIN'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/';
46
$homepage_url = (($conf['HTTPS_LOGIN'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/';
-
 
47
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
47
 
48
 
48
// Wait for chilli (update its tables)
49
// Wait for chilli (update its tables)
49
sleep(1); // TODO: wait after login only?
50
sleep(1); // TODO: wait after login only?
50
// Retrieve user info in tab $user[]
51
// Retrieve user info in tab $user[]
51
exec("sudo /usr/sbin/chilli_query list | grep 'pass' | grep -Ew '($remote_ip)'" , $tab);
52
exec("sudo /usr/sbin/chilli_query list | grep 'pass' | grep -Ew '($remote_ip)'" , $tab);
Line 352... Line 353...
352
	<head>
353
	<head>
353
		<meta charset="UTF-8">
354
		<meta charset="UTF-8">
354
		<title>ALCASAR - <?= $organisme ?></title>
355
		<title>ALCASAR - <?= $organisme ?></title>
355
		<link type="text/css" href="css/status.css" rel="stylesheet">
356
		<link type="text/css" href="css/status.css" rel="stylesheet">
356
		<script src="js/ChilliLibrary.js"></script>
357
		<script src="js/ChilliLibrary.js"></script>
-
 
358
		<script>
-
 
359
			chilliController.host = '<?= $conf['HOSTNAME'].'.'.$conf['DOMAIN'] ?>';
-
 
360
			chilliController.port = <?= (($useHTTPS) ? 3991 : 3990) ?>;
-
 
361
			chilliController.ssl  = <?= (($useHTTPS) ? 'true' : 'false') ?>;
-
 
362
		</script>
357
		<script src="js/statusControler.js"></script>
363
		<script src="js/statusControler.js"></script>
358
	</head>
364
	</head>
359
	<body>
365
	<body>
360
		<div id="Chilli">
366
		<div id="Chilli">
361
			<div id="locationName"></div>
367
			<div id="locationName"></div>