Subversion Repositories ALCASAR

Rev

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

Rev 2930 Rev 2935
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: status.php 2930 2021-03-20 14:26:14Z rexy $
2
# $Id: status.php 2935 2021-03-28 22:14:58Z rexy $
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 43... Line 43...
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
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
-
 
48
$service_wifi4eu_status = ($conf['WIFI4EU'] === 'on');
-
 
49
$service_wifi4eu_code = $conf['WIFI4EU_CODE'];
-
 
50
$service_wifi4eu_server = 'https://collection.wifi4eu.ec.europa.eu/wifi4eu.min.js';
48
 
51
 
49
// Wait for chilli (update its tables)
52
// Wait for chilli (update its tables)
50
sleep(1); // TODO: wait after login only?
53
sleep(1); // TODO: wait after login only?
51
// Retrieve user info in tab $user[]
54
// Retrieve user info in tab $user[]
52
exec("sudo /usr/sbin/chilli_query list | grep 'pass' | grep -Ew '($remote_ip)'" , $tab);
55
exec("sudo /usr/sbin/chilli_query list | grep 'pass' | grep -Ew '($remote_ip)'" , $tab);
Line 339... Line 342...
339
		<meta charset="UTF-8">
342
		<meta charset="UTF-8">
340
		<title>ALCASAR - <?= $organisme ?></title>
343
		<title>ALCASAR - <?= $organisme ?></title>
341
		<link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css">
344
		<link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css">
342
		<link type="text/css" href="/css/status.css" rel="stylesheet">
345
		<link type="text/css" href="/css/status.css" rel="stylesheet">
343
		<link rel="icon" href="/images/favicon-48.ico" type="image/ico">
346
		<link rel="icon" href="/images/favicon-48.ico" type="image/ico">
-
 
347
<? if ($service_wifi4eu_status): ?>
-
 
348
		<script type="text/javascript">
-
 
349
			var wifi4euTimerStart = Date.now();
-
 
350
			var wifi4euNetworkIdentifier = '<?= $service_wifi4eu_code ?>';
-
 
351
			var wifi4euLanguage = '<?= $Language ?>';
-
 
352
			//var selftestModus = true;
-
 
353
		</script>
-
 
354
		<script type="text/javascript" src="<?= $service_wifi4eu_server ?>"></script>
-
 
355
<? endif; ?>
344
		<script src="js/ChilliLibrary.js"></script>
356
		<script src="js/ChilliLibrary.js"></script>
345
		<script>
357
		<script>
346
			chilliController.host = '<?= $conf['HOSTNAME'].'.'.$conf['DOMAIN'] ?>';
358
			chilliController.host = '<?= $conf['HOSTNAME'].'.'.$conf['DOMAIN'] ?>';
347
			chilliController.port = <?= (($useHTTPS) ? 3991 : 3990) ?>;
359
			chilliController.port = <?= (($useHTTPS) ? 3991 : 3990) ?>;
348
			chilliController.ssl  = <?= (($useHTTPS) ? 'true' : 'false') ?>;
360
			chilliController.ssl  = <?= (($useHTTPS) ? 'true' : 'false') ?>;
Line 369... Line 381...
369
						<div class="row header_background">
381
						<div class="row header_background">
370
							<div class="header_img hidden-xs col-sm-2">	
382
							<div class="header_img hidden-xs col-sm-2">	
371
								<img class="img-responsive image-resize" src="images/organisme.png" alt="logo">
383
								<img class="img-responsive image-resize" src="images/organisme.png" alt="logo">
372
							</div>
384
							</div>
373
							<div class="header_title col-xs-12 col-sm-8">
385
							<div class="header_title col-xs-12 col-sm-8">
-
 
386
							<?php if ($service_wifi4eu_status): ?>
-
 
387
								<img id="wifi4eubanner">
-
 
388
							<?php else: ?>
374
								<p class="login-status"><?= $l_login1 ?></p>
389
								<p class="login-status"><?= $l_login1 ?></p>
-
 
390
							<?php endif; ?>
375
							</div>
391
							</div>
376
							<div class="header_img hidden-xs col-sm-2">	
392
							<div class="header_img hidden-xs col-sm-2">	
377
								<img class="img-responsive image-resize" src="images/logo-alcasar.png" alt="logo">
393
								<img class="img-responsive image-resize" src="images/logo-alcasar.png" alt="logo">
378
							</div>
394
							</div>
379
						</div>
395
						</div>