Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
# $Id: intercept.php 2201 2017-05-05 20:05:47Z tom.houdayer $
|
2 |
# $Id: intercept.php 2205 2017-05-06 14:07:27Z 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 360... |
Line 360... |
360 |
exit();
|
360 |
exit();
|
361 |
}
|
361 |
}
|
362 |
|
362 |
|
363 |
# Read form parameters which we care about
|
363 |
# Read form parameters which we care about
|
364 |
# avoid the "user as a MAC address" attempts
|
364 |
# avoid the "user as a MAC address" attempts
|
365 |
if ((isset($_POST['UserName'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/', $_POST['UserName']) !== 1)) {
|
365 |
if ((isset($_POST['UserName'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/', $_POST['UserName']) !== 1))
|
366 |
$username = $_POST['UserName'];} else {$username="";}
|
366 |
$username = htmlspecialchars($_POST['UserName']); else $username = '';
|
367 |
if (isset($_POST['Password'])){ $password = $_POST['Password'];} else {$password="";}
|
367 |
if (isset($_POST['Password'])) $password = htmlspecialchars($_POST['Password']); else $password = '';
|
368 |
if (isset($_POST['challenge'])){$challenge = $_POST['challenge'];} else {$challenge="";}
|
368 |
if (isset($_POST['challenge']))$challenge = htmlspecialchars($_POST['challenge']); else $challenge = '';
|
369 |
if (isset($_POST['button'])){ $button = $_POST['button'];} else {$button="";}
|
369 |
if (isset($_POST['button'])) $button = htmlspecialchars($_POST['button']); else $button = '';
|
370 |
// if (isset($_POST['logout'])){ $logout = $_POST['logout'];} else {$logout="";}
|
370 |
// if (isset($_POST['logout'])) $logout = htmlspecialchars($_POST['logout']); else $logout = '';
|
371 |
// if (isset($_POST['prelogin'])){ $prelogin = $_POST['prelogin'];} else {$prelogin="";}
|
371 |
// if (isset($_POST['prelogin'])) $prelogin = htmlspecialchars($_POST['prelogin']); else $prelogin = '';
|
372 |
if (isset($_POST['res'])){ $res = $_POST['res'];} else {$res="";}
|
372 |
if (isset($_POST['res'])) $res = htmlspecialchars($_POST['res']); else $res = '';
|
373 |
if (isset($_POST['uamip'])){ $uamip = $_POST['uamip'];} else {$uamip="";}
|
373 |
if (isset($_POST['uamip'])) $uamip = htmlspecialchars($_POST['uamip']); else $uamip = '';
|
374 |
if (isset($_POST['uamport'])){ $uamport = $_POST['uamport'];} else {$uamport="";}
|
374 |
if (isset($_POST['uamport'])) $uamport = htmlspecialchars($_POST['uamport']); else $uamport = '';
|
375 |
if (isset($_POST['userurl'])){ $userurl = $_POST['userurl'];} else {$userurl="";}
|
375 |
if (isset($_POST['userurl'])) $userurl = htmlspecialchars($_POST['userurl']); else $userurl = '';
|
376 |
if (isset($_POST['timeleft'])){ $timeleft = $_POST['timeleft'];} else {$timeleft="";}
|
376 |
if (isset($_POST['timeleft'])) $timeleft = htmlspecialchars($_POST['timeleft']); else $timeleft = '';
|
377 |
if (isset($_POST['redirurl'])){ $redirurl = $_POST['redirurl'];} else {$redirurl="";}
|
377 |
if (isset($_POST['redirurl'])) $redirurl = htmlspecialchars($_POST['redirurl']); else $redirurl = '';
|
378 |
|
378 |
|
379 |
# Read query parameters which we care about
|
379 |
# Read query parameters which we care about
|
380 |
if (isset($_GET['res'])) $res = $_GET['res'];
|
380 |
if (isset($_GET['res'])) $res = htmlspecialchars($_GET['res']);
|
381 |
if (isset($_GET['challenge'])) $challenge = $_GET['challenge'];
|
381 |
if (isset($_GET['challenge'])) $challenge = htmlspecialchars($_GET['challenge']);
|
382 |
if (isset($_GET['uamip'])) $uamip = $_GET['uamip'];
|
382 |
if (isset($_GET['uamip'])) $uamip = htmlspecialchars($_GET['uamip']);
|
383 |
if (isset($_GET['uamport'])) $uamport = $_GET['uamport'];
|
383 |
if (isset($_GET['uamport'])) $uamport = htmlspecialchars($_GET['uamport']);
|
384 |
if (isset($_GET['reply'])){ $reply = $_GET['reply'];} else {$reply="";}
|
384 |
if (isset($_GET['reply'])) $reply = htmlspecialchars($_GET['reply']); else $reply = '';
|
385 |
if (isset($_GET['userurl'])) $userurl = $_GET['userurl'];
|
385 |
if (isset($_GET['userurl'])) $userurl = htmlspecialchars($_GET['userurl']);
|
386 |
if (isset($_GET['timeleft'])) $timeleft = $_GET['timeleft'];
|
386 |
if (isset($_GET['timeleft'])) $timeleft = htmlspecialchars($_GET['timeleft']);
|
387 |
if (isset($_GET['redirurl'])) $redirurl = $_GET['redirurl'];
|
387 |
if (isset($_GET['redirurl'])) $redirurl = htmlspecialchars($_GET['redirurl']);
|
388 |
|
388 |
|
389 |
# translation of radius replies
|
389 |
# translation of radius replies
|
390 |
if (isset($reply)) {
|
390 |
if (isset($reply)) {
|
391 |
switch (trim ($reply)) {
|
391 |
switch (trim($reply)) {
|
392 |
case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
|
392 |
case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1; break;
|
393 |
case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
|
393 |
case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2; break;
|
394 |
case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
|
394 |
case 'You are calling outside your allowed timespan' : $reply = $l_reply_3; break;
|
395 |
case 'Password Has Expired' : $reply = $l_reply_4 ; break;
|
395 |
case 'Password Has Expired' : $reply = $l_reply_4; break;
|
396 |
case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
|
396 |
case 'You are already logged in - access denied' : $reply = $l_reply_5; break;
|
397 |
case 'Your maximum never usage time has been reached' : $reply = $l_reply_6 ; break;
|
397 |
case 'Your maximum never usage time has been reached' : $reply = $l_reply_6; break;
|
398 |
}
|
398 |
}
|
399 |
}
|
399 |
}
|
400 |
|
400 |
|
401 |
// If attempt to login
|
401 |
// If attempt to login
|
402 |
if ($button === $l_boutonO) {
|
402 |
if ($button === $l_boutonO) {
|