| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
# $Id: intercept.php 3228 2024-10-22 11:59:33Z rexy $
|
2 |
# $Id: intercept.php 3326 2026-03-01 22:35:33Z rexy $
|
| 3 |
#
|
3 |
#
|
| 4 |
# intercept.php for ALCASAR captive portal
|
4 |
# intercept.php for ALCASAR captive portal
|
| 5 |
# by Rexy & steweb57
|
5 |
# by Rexy & steweb57
|
| 6 |
# UI & css style by Stéphane ERARD & Alexandre VEZIN
|
6 |
# UI & css style by Stéphane ERARD & Alexandre VEZIN
|
| 7 |
# Help for language translation by B. AUBARD (thanks)
|
7 |
# Help for language translation by B. AUBARD (thanks)
|
| Line 64... |
Line 64... |
| 64 |
|
64 |
|
| 65 |
// Our own path
|
65 |
// Our own path
|
| 66 |
$loginpath = htmlspecialchars($_SERVER['PHP_SELF']);
|
66 |
$loginpath = htmlspecialchars($_SERVER['PHP_SELF']);
|
| 67 |
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
|
67 |
$useHTTPS = ((isset($_SERVER['HTTPS'])) && (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off'));
|
| 68 |
$alcasarpath = (($useHTTPS) ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'];
|
68 |
$alcasarpath = (($useHTTPS) ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'];
|
| 69 |
$statuspath = (($conf['HTTPS_CHILLI'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/status.php';
|
69 |
$statuspath = (($conf['HTTPS_LOGIN'] === 'on') ? 'https' : 'http' ).'://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/status.php';
|
| 70 |
|
70 |
|
| 71 |
# Redirection if HTTPS needed and not used
|
71 |
# Redirection if HTTPS needed and not used
|
| 72 |
if (($conf['HTTPS_LOGIN'] === 'on') && (!$useHTTPS)) {
|
72 |
if (($conf['HTTPS_LOGIN'] === 'on') && (!$useHTTPS)) {
|
| 73 |
header('HTTP/1.1 301 Moved Permanently');
|
73 |
header('HTTP/1.1 301 Moved Permanently');
|
| 74 |
header('Location: https://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/intercept.php');
|
74 |
header('Location: https://'.$conf['HOSTNAME'].'.'.$conf['DOMAIN'].'/intercept.php');
|
| Line 391... |
Line 391... |
| 391 |
if (isset($_GET['userurl'])) $userurl = htmlspecialchars($_GET['userurl']);
|
391 |
if (isset($_GET['userurl'])) $userurl = htmlspecialchars($_GET['userurl']);
|
| 392 |
|
392 |
|
| 393 |
// TODO: clean unused query params
|
393 |
// TODO: clean unused query params
|
| 394 |
|
394 |
|
| 395 |
$uamip = $conf['HOSTNAME'].'.'.$conf['DOMAIN'];
|
395 |
$uamip = $conf['HOSTNAME'].'.'.$conf['DOMAIN'];
|
| 396 |
if (($conf['HTTPS_CHILLI'] === 'on') && $useHTTPS) {
|
396 |
if (($conf['HTTPS_LOGIN'] === 'on') && $useHTTPS) {
|
| 397 |
$uamproto = 'https';
|
397 |
$uamproto = 'https';
|
| 398 |
$uamport = 3991;
|
398 |
$uamport = 3991;
|
| 399 |
} else {
|
399 |
} else {
|
| 400 |
$uamproto = 'http';
|
400 |
$uamproto = 'http';
|
| 401 |
$uamport = 3990;
|
401 |
$uamport = 3990;
|