Subversion Repositories ALCASAR

Rev

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

Rev 2910 Rev 2934
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: index.php 2910 2021-01-30 14:03:44Z rexy $
2
# $Id: index.php 2934 2021-03-27 18:24:00Z rexy $
3
#
3
#
4
# index.php for ALCASAR by Rexy
4
# index.php for ALCASAR by Rexy
5
# UI & css style by stephane ERARD
5
# UI & css style by stephane ERARD
6
# The contents of this file may be used under the terms of the GNU
6
# The contents of this file may be used under the terms of the GNU
7
# General Public License Version 2, provided that the above copyright
7
# General Public License Version 2, provided that the above copyright
Line 43... Line 43...
43
}
43
}
44
fclose($file_conf);
44
fclose($file_conf);
45
 
45
 
46
$organisme = $conf["ORGANISM"];
46
$organisme = $conf["ORGANISM"];
47
$hostname  = $conf["HOSTNAME"].'.'.$conf["DOMAIN"];
47
$hostname  = $conf["HOSTNAME"].'.'.$conf["DOMAIN"];
48
$ssl_enable = ($conf['HTTPS_LOGIN'] === 'on');
48
$ssl_status = ($conf['HTTPS_LOGIN'] === 'on');
49
$protocol = ($ssl_enable) ? 'https://' : 'http://';
49
$protocol = ($ssl_status) ? 'https://' : 'http://';
50
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
50
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
51
$network_pb = false; // "alcasar-watchdog.sh" changes this value if a network issue is detected
51
$network_pb = false;
52
$diagnostic = "can't contact the default router"; // "alcasar-watchdog.sh" changes this value if a network issue is detected
52
$diagnostic = "can't contact the default router";
53
$certCa_link = (($useHTTPS) ? 'https' : 'http')."://$hostname/certs/certificat_alcasar_ca.crt";
53
$certCa_link = (($useHTTPS) ? 'https' : 'http')."://$hostname/certs/certificat_alcasar_ca.crt";
54
$logout_link = ((($conf['HTTPS_CHILLI'] === 'on') && $useHTTPS) ? 'https://'.$hostname.':3991' : 'http://'.$hostname.':3990').'/logoff';
54
$logout_link = ((($conf['HTTPS_CHILLI'] === 'on') && $useHTTPS) ? 'https://'.$hostname.':3991' : 'http://'.$hostname.':3990').'/logoff';
55
$direct_access = false;
55
$direct_access = false;
56
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
56
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
57
$connection_history = '';
57
$connection_history = '';
58
$nb_connection_history = 3;
58
$nb_connection_history = 3;
59
$redirect_link = 'www.euronews.com'; // Default redirection for HTTPS interception (beware, this website must run in HTTP)
59
$redirect_link = 'www.euronews.com'; // Default redirection for HTTP interception (beware, this website must run in HTTP)
60
 
-
 
-
 
60
$service_wifi4eu_status = ($conf['WIFI4EU'] === 'on');
61
// Check if the SMS service is enable
61
$service_wifi4eu_code = $conf['WIFI4EU_CODE'];
62
$service_SMS_status = ($conf['SMS'] === 'on');
62
$service_SMS_status = ($conf['SMS'] === 'on');
63
 
63
 
64
// Retrieve the user info behind the remote ip
64
// Retrieve the user info behind the remote ip
65
$output = [];
65
$output = [];
66
exec('sudo /usr/sbin/chilli_query list ip '.escapeshellarg($remote_ip), $output);
66
exec('sudo /usr/sbin/chilli_query list ip '.escapeshellarg($remote_ip), $output);
Line 532... Line 532...
532
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
532
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
533
		<title><?= $l_title ?></title>
533
		<title><?= $l_title ?></title>
534
		<link rel="stylesheet" type="text/css" href="<?= ((!$direct_access) ? "//$hostname" : '') ?>/css/bootstrap.min.css">
534
		<link rel="stylesheet" type="text/css" href="<?= ((!$direct_access) ? "//$hostname" : '') ?>/css/bootstrap.min.css">
535
		<link rel="stylesheet" type="text/css" href="/css/index.css">
535
		<link rel="stylesheet" type="text/css" href="/css/index.css">
536
		<link rel="icon" href="/images/favicon-48.ico" type="image/ico">
536
		<link rel="icon" href="/images/favicon-48.ico" type="image/ico">
-
 
537
		<?
-
 
538
		?>		
537
	</head>
539
	</head>
538
	<body>
540
	<body>
539
	<div class="col-xs-12 col-md-10 col-md-offset-1"> 
541
	<div class="col-xs-12 col-md-10 col-md-offset-1"> 
540
 
542
 
541
		<!-- HeaderBox -->
543
		<!-- HeaderBox -->