/web/acc/admin/services.php |
---|
149,7 → 149,6 |
fclose($file_conf); |
$wifi4eu = $conf['WIFI4EU']; |
$wifi4eu_code = $conf['WIFI4EU_CODE']; |
// Doing an action on a service (start,stop or restart) |
function serviceExec($service, $action){ |
if (($action == "start")||($action == "stop")||($action == "restart")){ |
191,7 → 190,11 |
if (isset($_POST['wifi4eu'])){ |
switch ($_POST['wifi4eu']){ |
case 'on' : |
file_put_contents(CONF_FILE, preg_replace('/WIFI4EU_CODE=.*/', 'WIFI4EU_CODE='.trim($_POST['wifi4eu_code']), file_get_contents(CONF_FILE))); |
$network_code = trim($_POST['wifi4eu_id']); |
if ($network_code == '') { |
$network_code = '123e4567-e89b-12d3-a456-426655440000'; // WIFI4EU test code |
} |
file_put_contents(CONF_FILE, preg_replace('/WIFI4EU_CODE=.*/', 'WIFI4EU_CODE='.$network_code, file_get_contents(CONF_FILE))); |
exec("sudo /usr/local/bin/alcasar-wifi4eu.sh -on"); |
break; |
case 'off' : |
335,7 → 338,7 |
<td width="80" align="center">---</td> |
<?php } else { ?> |
<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko; ?>"></td> |
<td align="center">WIFI4EU</td><td><?php echo $l_wifi4eu_id; ?> : <input type ="text" name="wifi4eu_code" value="<?php echo $wifi4eu_code; ?>" size="40"></td> |
<td align="center">WIFI4EU</td><td><?php echo $l_wifi4eu_id; ?> : <input type ="text" name="wifi4eu_id" value="<?php echo $wifi4eu_code; ?>" size="40"></td> |
<td width="80" align="center"><input type=submit value="<?echo $l_service_start;?>"><input type=hidden name="wifi4eu" value="on"></td> |
<td width="80" align="center">---</td> |
<td width="80" align="center">---</td> |
/web/index.php |
---|
59,6 → 59,7 |
$redirect_link = 'www.euronews.com'; // Default redirection for HTTP interception (beware, this website must run in HTTP) |
$service_wifi4eu_status = ($conf['WIFI4EU'] === 'on'); |
$service_wifi4eu_code = $conf['WIFI4EU_CODE']; |
$service_wifi4eu_server = 'https://collection.wifi4eu.ec.europa.eu/wifi4eu.min.js'; |
$service_SMS_status = ($conf['SMS'] === 'on'); |
// Retrieve the user info behind the remote ip |
458,8 → 459,8 |
$fileContent = file(DOMAIN_ALLOWED_LIST); if ($fileContent) { // the file isn't empty |
foreach ($fileContent as $line) { |
if (!empty(trim($line))) { |
$domain_fields = explode('#', $line); |
if (!empty(trim($domain_fields[1]))) { |
if (strpos ($line, '#')) { // the domain should be displayed |
$domain_fields = explode('#', $line); |
$domain = explode('"', $domain_fields[0]); |
$domain[1] = ltrim($domain[1], '.'); // remove every '.' from the beginning of domain |
$domainsAllowed[] = (object) [ |
534,8 → 535,15 |
<link rel="stylesheet" type="text/css" href="<?= ((!$direct_access) ? "//$hostname" : '') ?>/css/bootstrap.min.css"> |
<link rel="stylesheet" type="text/css" href="/css/index.css"> |
<link rel="icon" href="/images/favicon-48.ico" type="image/ico"> |
<? |
?> |
<? if ($service_wifi4eu_status): ?> |
<script type="text/javascript"> |
var wifi4euTimerStart = Date.now(); |
var wifi4euNetworkIdentifier = '<?= $service_wifi4eu_code ?>'; |
var wifi4euLanguage = '<?= $Language ?>'; |
//var selftestModus = true; |
</script> |
<script type="text/javascript" src="<?= $service_wifi4eu_server ?>"></script> |
<? endif; ?> |
</head> |
<body> |
<div class="col-xs-12 col-md-10 col-md-offset-1"> |
550,7 → 558,11 |
<!-- Title --> |
<div id="cadre_titre" class="titre_banner col-xs-12 col-sm-8"> |
<?php if ($direct_access): ?> |
<p id="acces_controle" class="titre_controle"><?= $l_title ?></p> |
<?php if ($service_wifi4eu_status): ?> |
<img id="wifi4eubanner"> |
<?php else: ?> |
<p id="acces_controle" class="titre_controle"><?= $l_title ?></p> |
<?php endif; ?> |
<?php if ($network_pb): ?> |
<div class="explanation_net_pb"><?= $l_explain_net_pb ?></div> |
<?php endif; ?> |
/web/intercept.php |
---|
56,6 → 56,10 |
fclose($file_conf); |
$organisme = $conf["ORGANISM"]; |
$service_SMS_status = ($conf['SMS'] === 'on'); |
$service_wifi4eu_status = ($conf['WIFI4EU'] === 'on'); |
$service_wifi4eu_code = $conf['WIFI4EU_CODE']; |
$service_wifi4eu_server = 'https://collection.wifi4eu.ec.europa.eu/wifi4eu.min.js'; |
// Shared secret used to encrypt password with coova. |
$uamsecret = ""; |
63,9 → 67,6 |
// URL loaded after success authenticates (let blank for browser defaults) |
$adminurl = ""; |
// Check if the SMS service is enable |
$service_SMS_status = ($conf['SMS'] === 'on'); |
// Our own path |
$loginpath = htmlspecialchars($_SERVER['PHP_SELF']); |
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off')); |
508,7 → 509,19 |
<head> |
<meta charset="utf-8"> |
<title><?= $l_loggingin ?></title> |
<link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css"> |
<link rel="stylesheet" href="/css/intercept.css" type="text/css"> |
<link rel="icon" href="/images/favicon-48.ico" type="image/ico"> |
<? if ($service_wifi4eu_status): ?> |
<script type="text/javascript"> |
var wifi4euTimerStart = Date.now(); |
var wifi4euNetworkIdentifier = '<?= $service_wifi4eu_code ?>'; |
var wifi4euLanguage = '<?= $Language ?>'; |
//var selftestModus = true; |
</script> |
<script type="text/javascript" src="<?= $service_wifi4eu_server ?>"></script> |
<? endif; ?> |
<script type="text/javascript"> |
function doOnLoad(result, userurl, redirurl, adminurl, timeleft) { |
if ((result === 1) || (result === 4)) { // success or already |
var url; |
537,9 → 550,6 |
} |
} |
</script> |
<link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css"> |
<link rel="stylesheet" href="/css/intercept.css" type="text/css"> |
<link rel="icon" href="/images/favicon-48.ico" type="image/ico"> |
</head> |
<body onLoad="javascript:doOnLoad(<?= $result ?>,'<?= $userurl ?>','<?= $redirurl ?>','<?= $adminurl ?>','<?= $timeleft ?>')"> |
<div class="col-xs-12"> |
548,7 → 558,11 |
<div class="col-xs-12 col-sm-10 col-sm-offset-1"> |
<div class="row banner"> |
<div class="col-xs-8 col-xs-offset-2 col-sm-12 col-sm-offset-0"> |
<h1 class="organisme"><?= $organisme ?></h1> |
<?php if ($service_wifi4eu_status): ?> |
<img id="wifi4eubanner"> |
<?php else: ?> |
<h1 class="organisme"><?= $organisme ?></h1> |
<?php endif; ?> |
</div> |
</div> |
<div class="row"> |
565,12 → 579,11 |
echo '<div id="authorized_domain">'.$l_uam_domain.'</div>'; |
echo '<ul>'; |
foreach ($tab as $line) { |
if (trim($line) !== '') { // the line isn't empty |
$domain_allowed = explode('#', $line); |
if (trim($domain_allowed[1]) !== '') { |
if (!empty(trim($line))) { // the line isn't empty |
if (strpos ($line, '#')) { // the domain should be displayed |
$domain_allowed = explode('#', $line); |
$domain = explode('"', $domain_allowed[0]); |
// remove every '.' from the beginning of domain |
$domain[1] = ltrim($domain[1], '.'); |
$domain[1] = ltrim($domain[1], '.'); // remove every '.' from the beginning of domain |
echo '<li><a href="http://'.trim($domain[1]).'">'.trim($domain_allowed[1]).'</a></li>'; |
} |
} |
678,12 → 691,11 |
echo '<div id="authorized_domain">'.$l_uam_domain.'</div>'; |
echo '<ul>'; |
foreach ($tab as $line) { |
if (trim($line) !== '') { // the line isn't empty |
$domain_allowed = explode('#', $line); |
if (trim($domain_allowed[1]) !== '') { |
if (!empty(trim($line))) { // the line isn't empty |
if (strpos ($line, '#')) { // the domain should be displayed |
$domain_allowed = explode('#', $line); |
$domain = explode('"', $domain_allowed[0]); |
// remove every '.' from the beginning of domain |
$domain[1] = ltrim($domain[1], '.'); |
$domain[1] = ltrim($domain[1], '.'); // remove every '.' from the beginning of domain |
echo '<li><a href="http://'.trim($domain[1]).'">'.trim($domain_allowed[1]).'</a></li>'; |
} |
} |
/web/status.php |
---|
45,6 → 45,9 |
$nb_connection_history = 3; |
$homepage_url = (($conf['HTTPS_LOGIN'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/'; |
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off')); |
$service_wifi4eu_status = ($conf['WIFI4EU'] === 'on'); |
$service_wifi4eu_code = $conf['WIFI4EU_CODE']; |
$service_wifi4eu_server = 'https://collection.wifi4eu.ec.europa.eu/wifi4eu.min.js'; |
// Wait for chilli (update its tables) |
sleep(1); // TODO: wait after login only? |
341,6 → 344,15 |
<link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css"> |
<link type="text/css" href="/css/status.css" rel="stylesheet"> |
<link rel="icon" href="/images/favicon-48.ico" type="image/ico"> |
<? if ($service_wifi4eu_status): ?> |
<script type="text/javascript"> |
var wifi4euTimerStart = Date.now(); |
var wifi4euNetworkIdentifier = '<?= $service_wifi4eu_code ?>'; |
var wifi4euLanguage = '<?= $Language ?>'; |
//var selftestModus = true; |
</script> |
<script type="text/javascript" src="<?= $service_wifi4eu_server ?>"></script> |
<? endif; ?> |
<script src="js/ChilliLibrary.js"></script> |
<script> |
chilliController.host = '<?= $conf['HOSTNAME'].'.'.$conf['DOMAIN'] ?>'; |
371,7 → 383,11 |
<img class="img-responsive image-resize" src="images/organisme.png" alt="logo"> |
</div> |
<div class="header_title col-xs-12 col-sm-8"> |
<?php if ($service_wifi4eu_status): ?> |
<img id="wifi4eubanner"> |
<?php else: ?> |
<p class="login-status"><?= $l_login1 ?></p> |
<?php endif; ?> |
</div> |
<div class="header_img hidden-xs col-sm-2"> |
<img class="img-responsive image-resize" src="images/logo-alcasar.png" alt="logo"> |