| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
# $Id: intercept.php 2238 2017-05-20 20:54:43Z tom.houdayer $
|
2 |
# $Id: intercept.php 2239 2017-05-20 21:22:48Z tom.houdayer $
|
| 3 |
#
|
3 |
#
|
| 4 |
# intercept.php for ALCASAR captive portal
|
4 |
# intercept.php for ALCASAR captive portal
|
| 5 |
# Copyright (C) 2003, 2004 Mondru AB.
|
5 |
# Copyright (C) 2003, 2004 Mondru AB.
|
| 6 |
# Modify by REXY & steweb57
|
6 |
# Modify by REXY & steweb57
|
| 7 |
# UI & css style by stephane ERARD
|
7 |
# UI & css style by stephane ERARD
|
| Line 388... |
Line 388... |
| 388 |
if (isset($_GET['reply'])) $reply = htmlspecialchars($_GET['reply']); else $reply = '';
|
388 |
if (isset($_GET['reply'])) $reply = htmlspecialchars($_GET['reply']); else $reply = '';
|
| 389 |
if (isset($_GET['userurl'])) $userurl = htmlspecialchars($_GET['userurl']);
|
389 |
if (isset($_GET['userurl'])) $userurl = htmlspecialchars($_GET['userurl']);
|
| 390 |
if (isset($_GET['timeleft'])) $timeleft = htmlspecialchars($_GET['timeleft']);
|
390 |
if (isset($_GET['timeleft'])) $timeleft = htmlspecialchars($_GET['timeleft']);
|
| 391 |
if (isset($_GET['redirurl'])) $redirurl = htmlspecialchars($_GET['redirurl']);
|
391 |
if (isset($_GET['redirurl'])) $redirurl = htmlspecialchars($_GET['redirurl']);
|
| 392 |
|
392 |
|
| - |
|
393 |
// Get required parameters from CoovaChilli config file if missing
|
| - |
|
394 |
if (empty($uamip)) {
|
| - |
|
395 |
$uamip = trim(exec('grep uamlisten /etc/chilli.conf | sed -e "s/uamlisten//"'));
|
| - |
|
396 |
}
|
| - |
|
397 |
if (empty($uamport)) {
|
| - |
|
398 |
$uamport = trim(exec('grep uamport /etc/chilli.conf | sed -e "s/uamport//"'));
|
| - |
|
399 |
}
|
| - |
|
400 |
|
| 393 |
# translation of radius replies
|
401 |
# translation of radius replies
|
| 394 |
if (isset($reply)) {
|
402 |
if (isset($reply)) {
|
| 395 |
switch (trim($reply)) {
|
403 |
switch (trim($reply)) {
|
| 396 |
case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1; break;
|
404 |
case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1; break;
|
| 397 |
case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2; break;
|
405 |
case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2; break;
|
| Line 424... |
Line 432... |
| 424 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
432 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
| 425 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
433 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
| 426 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
434 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
| 427 |
header('Pragma: no-cache');
|
435 |
header('Pragma: no-cache');
|
| 428 |
|
436 |
|
| 429 |
header('Location: http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl');
|
437 |
header("Location: http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl");
|
| 430 |
?>
|
438 |
?>
|
| 431 |
<!DOCTYPE html>
|
439 |
<!DOCTYPE html>
|
| 432 |
<html>
|
440 |
<html>
|
| 433 |
<head>
|
441 |
<head>
|
| 434 |
<meta charset="utf-8">
|
442 |
<meta charset="utf-8">
|
| Line 487... |
Line 495... |
| 487 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
495 |
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
| 488 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
496 |
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
| 489 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
497 |
header('Cache-Control: post-check=0, pre-check=0', false);
|
| 490 |
header('Pragma: no-cache');
|
498 |
header('Pragma: no-cache');
|
| 491 |
|
499 |
|
| 492 |
header('Location: http://$uamip:$uamport/prelogin');
|
500 |
header("Location: http://$uamip:$uamport/prelogin");
|
| 493 |
?>
|
501 |
?>
|
| 494 |
<!DOCTYPE html>
|
502 |
<!DOCTYPE html>
|
| 495 |
<html>
|
503 |
<html>
|
| 496 |
<head>
|
504 |
<head>
|
| 497 |
<meta charset="utf-8">
|
505 |
<meta charset="utf-8">
|