| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
# $Id: intercept.php 1331 2014-04-15 17:05:31Z richard $
|
2 |
# $Id: intercept.php 1346 2014-05-10 11:05:39Z richard $
|
| 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 64... |
Line 64... |
| 64 |
# URL loaded after success authenticates (let blank for browser defaults)
|
64 |
# URL loaded after success authenticates (let blank for browser defaults)
|
| 65 |
$adminurl = "";
|
65 |
$adminurl = "";
|
| 66 |
|
66 |
|
| 67 |
# Our own path
|
67 |
# Our own path
|
| 68 |
$loginpath = $_SERVER['PHP_SELF'];
|
68 |
$loginpath = $_SERVER['PHP_SELF'];
|
| 69 |
$alcasarpath = "http://alcasar.".trim($conf["DOMAIN"]);
|
69 |
$alcasarpath = "http://alcasar.".trim($conf["DOMAIN"]);
|
| 70 |
$statuspath = $alcasarpath."/status.php";
|
70 |
$statuspath = $alcasarpath."/status.php";
|
| 71 |
$debug = false;
|
71 |
$debug = false;
|
| 72 |
|
72 |
|
| 73 |
# Choice of language
|
73 |
# Choice of language
|
| 74 |
$Language = 'en';
|
74 |
$Language = 'en';
|
| 75 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
75 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
| Line 387... |
Line 387... |
| 387 |
# Generate the output
|
387 |
# Generate the output
|
| 388 |
echo "<!DOCTYPE html>
|
388 |
echo "<!DOCTYPE html>
|
| 389 |
<html>
|
389 |
<html>
|
| 390 |
<head>
|
390 |
<head>
|
| 391 |
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
391 |
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
| 392 |
<title>$l_loggingin</title>
|
392 |
<title>$l_loggingin</title>
|
| 393 |
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
|
393 |
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
|
| 394 |
<meta http-equiv=\"Pragma\" content=\"no-cache\">
|
394 |
<meta http-equiv=\"Pragma\" content=\"no-cache\">
|
| 395 |
<script type=\"text/javascript\" language=\"JavaScript\">
|
395 |
<script type=\"text/javascript\" language=\"JavaScript\">
|
| 396 |
var blur = 0; // not un use
|
- |
|
| 397 |
var mytimeleft = 0; // not un use
|
- |
|
| 398 |
alcasar_popup = null;
|
396 |
alcasar_popup = null;
|
| 399 |
|
- |
|
| 400 |
function popUp(URL) {
|
397 |
function popUp(URL) {
|
| 401 |
if (self.name != \"alcasar_popup\") {
|
398 |
if (self.name != \"alcasar_popup\") {
|
| 402 |
alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=460,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
|
399 |
alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=460,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
|
| 403 |
}
|
- |
|
| 404 |
}
|
400 |
}
|
| 405 |
|
401 |
}
|
| 406 |
function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
|
402 |
function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
|
| 407 |
if (timeleft) { // not in use
|
- |
|
| 408 |
mytimeleft = timeleft;
|
- |
|
| 409 |
}
|
- |
|
| 410 |
if ((result == 1)||(result == 4)) { //success or already
|
403 |
if ((result == 1)||(result == 4)) { //success or already
|
| 411 |
//window.location = userurl;
|
404 |
//window.location = userurl;
|
| 412 |
if (alcasar_popup != null) alcasar_popup.focus();
|
405 |
if (alcasar_popup != null) alcasar_popup.focus();
|
| 413 |
|
- |
|
| 414 |
if (adminurl != ''){
|
406 |
if (adminurl != ''){
|
| 415 |
window.location = adminurl;
|
407 |
window.location = adminurl;
|
| 416 |
} else if (redirurl != '') {
|
408 |
} else if (redirurl != '') {
|
| 417 |
window.location = redirurl;
|
409 |
window.location = redirurl;
|
| 418 |
} else if (userurl != '') {
|
410 |
} else if (userurl != '') {
|
| 419 |
window.location = userurl;
|
411 |
window.location = userurl;
|
| 420 |
} else {
|
412 |
} else {
|
| 421 |
window.home();
|
413 |
window.home();
|
| 422 |
}
|
414 |
}
|
| 423 |
}
|
415 |
}
|
| 424 |
if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
|
416 |
if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
|
| 425 |
if (alcasar_popup != null) alcasar_popup.close();
|
417 |
if (alcasar_popup != null) alcasar_popup.close();
|
| 426 |
document.form1.UserName.focus();
|
418 |
document.form1.UserName.focus();
|
| 427 |
}
|
419 |
}
|
| 428 |
}
|
420 |
}
|
| 429 |
</script>
|
421 |
</script>
|
| 430 |
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
|
422 |
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
|
| 431 |
</head>
|
423 |
</head>
|
| 432 |
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
|
424 |
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
|
| 433 |
<center>";
|
425 |
<center>";
|
| 434 |
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
|
426 |
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
|
| Line 442... |
Line 434... |
| 442 |
if ($reply) {
|
434 |
if ($reply) {
|
| 443 |
#traitement du reply ...
|
435 |
#traitement du reply ...
|
| 444 |
echo "<center> $reply <br /><br /></center>";
|
436 |
echo "<center> $reply <br /><br /></center>";
|
| 445 |
}
|
437 |
}
|
| 446 |
}
|
438 |
}
|
| - |
|
439 |
if ($userurl == "http://logout/") $userurl="http://www.qwant.com"; //avoid cyclic logout
|
| 447 |
echo "
|
440 |
echo "
|
| 448 |
<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
|
441 |
<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
|
| 449 |
<form name=\"form1\" method=\"post\" action=\"$loginpath\">
|
442 |
<form name=\"form1\" method=\"post\" action=\"$loginpath\">
|
| 450 |
<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
|
443 |
<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
|
| 451 |
<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
|
444 |
<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
|