Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 483 → Rev 484

/web/intercept.php
28,11 → 28,12
$uamsecret = "Mkb0pAEE";
 
# URL loaded after success authenticates (let blank for browser defaults)
$adminurl = "";
$adminurl = "http://www.sfr.fr";
 
# Our own path
$loginpath = $_SERVER['PHP_SELF'];
$loginpath = $_SERVER['PHP_SELF'];
$statuspath = "http://alcasar/status.php";
$debug = true;
 
# Choice of language
$Language = 'en';
326,7 → 327,7
 
# Otherwise it was not a form request
# Send out an error message
if ($result == 0) {
if ($result == 0) { //erreur
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
353,115 → 354,59
<title>$R_loggingin</title>
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
<meta http-equiv=\"Pragma\" content=\"no-cache\">
<SCRIPT LANGUAGE=\"JavaScript\">
var blur = 0;
var starttime = new Date();
var startclock = starttime.getTime();
var mytimeleft = 0;
 
function doTime() {
window.setTimeout( \"doTime()\", 1000 );
t = new Date();
time = Math.round((t.getTime() - starttime.getTime())/1000);
if (mytimeleft) {
time = mytimeleft - time;
if (time <= 0) {
window.location = \"$statuspath?res=popup3&uamip=$uamip&uamport=$uamport\";
}
}
if (time < 0) time = 0;
hours = (time - (time % 3600)) / 3600;
time = time - (hours * 3600);
mins = (time - (time % 60)) / 60;
secs = time - (mins * 60);
if (hours < 10) hours = \"0\" + hours;
if (mins < 10) mins = \"0\" + mins;
if (secs < 10) secs = \"0\" + secs;
title = \"$R_online_time : \" + hours + \":\" + mins + \":\" + secs;
if (mytimeleft) {
title = \"$R_remaining_time : \" + hours + \":\" + mins + \":\" + secs;
}
if(document.all || document.getElementById){
document.title = title;
}
else {
self.status = title;
}
}
 
<script type=\"text/javascript\" language=\"JavaScript\">
var blur = 0; // not un use
var mytimeleft = 0; // not un use
alcasar_popup = null;
function popUp(URL) {
if (self.name != \"chillispot_popup\") {
chillispot_popup = window.open(URL, 'chillispot_popup', 'width=500,height=250,resizable,scrollbars=yes,location=yes,toolbar=no,statusbar=no,menubar=no');
if (self.name != \"alcasar_popup\") {
alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=250,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
}
}
 
function doOnLoad(result, URL, userurl, redirurl, timeleft) {
URL = \"$statuspath\";
if (timeleft) {
function doOnLoad(result, userurl, redirurl, timeleft) {
if (timeleft) { // not in use
mytimeleft = timeleft;
}
if ((result == 1) && (self.name == \"chillispot_popup\")) {
doTime();
window.onbeforeunload = DecO($result);
}
if ((result == 1) && (self.name != \"chillispot_popup\")) {
// popUp(URL);
window.location = userurl;
}
if ((result == 2) || result == 5) {
document.form1.UserName.focus()
}
if ((result == 2) && (self.name != \"chillispot_popup\")) {
popUp();
chillispot_popup.close();
}
if ((result == 12) && (self.name == \"chillispot_popup\")) {
doTime();
";
if ($adminurl) { echo "opener.location = \"$adminurl\";";}
else if ($redirurl) { echo "opener.location = \"$redirurl\";";}
else if ($userurl) { echo "opener.location = \"$userurl\";";}
else echo "opener.home();";
if (result == 1) { //success
//window.location = userurl;
if (alcasar_popup != null) alcasar_popup.focus();
";
if ($adminurl) { echo "window.location = \"$adminurl\";";}
else if ($redirurl) { echo "window.location = \"$redirurl\";";}
else if ($userurl) { echo "window.location = \"$userurl\";";}
else echo "window.home();";
echo "
self.focus();
blur = 0;
}
if ((result == 13) && (self.name == \"chillispot_popup\")) {
self.focus();
blur = 1;
if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
if (alcasar_popup != null) alcasar_popup.close();
document.form1.UserName.focus();
}
}
 
function DecO(result) {
if ((result == 12) && (self.name == \"chillispot_popup\")) {
window.location = \"http://$uamip:$uamport/logoff \";
self.focus();
blur = 1;
//alert ('$R_loggedout');
}
}
</script>
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
</head>
<body onLoad=\"javascript:doOnLoad($result,'$loginpath?res=popup2&uamip=$uamip&uamport=$uamport&userurl=$userurl&redirurl=$redirurl&timeleft=$timeleft','$userurl','$redirurl','$timeleft')\" OnbeforeUnload=\"javascript:DecO($result)\">
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$timeleft')\">
<center>";
#Modifications par stephane ERARD le 30 11 2010
#Modifications par steweb57 le 06 02 2011
if ($debug){
# begin debugging
# print "<center>THE INPUT by GET method (for debugging):<br>";
# foreach ($_GET as $key => $value) {
# print $key . "=" . $value . "<br>";
# }
# print "<br>";
# print "<center>THE INPUT by POST method (for debugging):<br>";
# foreach ($_POST as $key => $value) {
# print $key . "=" . $value . "<br>";
# }
# print "<br></center>";
print "<center>THE INPUT by GET method (for debugging):<br>";
foreach ($_GET as $key => $value) {
print $key . "=" . $value . "<br>";
}
print "<br>";
print "<center>THE INPUT by POST method (for debugging):<br>";
foreach ($_POST as $key => $value) {
print $key . "=" . $value . "<br>";
}
print "<br></center>";
# end debugging
}
 
if ($result == 2) {
if ($result == 2) { //failed
echo "
<DIV id=\"logon\">
<h2>$R_loginfailed</h2>";
471,14 → 416,14
}
}
 
if ($result == 5) {
if ($result == 3 || $result == 5) { //logoff or notyet
echo "
<DIV id=\"logon\">
<h1>$organisme</h1>
<h2>$R_loggedcont</h2>";
}
 
if ($result == 2 || $result == 5) {
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
echo "
<IMG id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
<form name=\"form1\" method=\"post\" action=\"$loginpath\">
497,18 → 442,18
<TD align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\"></TD>
</TR>
<TR>
<TD height=\"23\" colSpan=\"2\" align=\"middle\"><INPUT value=\"$R_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></TD>
<TD height=\"23\" colSpan=\"2\" align=\"center\"><INPUT value=\"$R_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></TD>
</TR>
<TR>
<TD colSpan=2 align=middle><H6><A href=\"https://$uamip/pass/\">$R_passwordchg</A></H6></TD>
<TD colSpan=2 align=center><H6><A href=\"https://$uamip/pass/\">$R_passwordchg</A></H6></TD>
</TR>
</TABLE>
<TABLE id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\">
<TR>
<TD align=\"middle\"><FONT color=\"red\"><B>$R_loggedin_stringl0</B></FONT></TD>
<TD align=\"center\"><FONT color=\"red\"><B>$R_loggedin_stringl0</B></FONT></TD>
</TR>
<TR>
<TD align=\"middle\"><FONT color=\"black\"><B>$R_loggedin_stringl1</B></FONT></TD>
<TD align=\"center\"><FONT color=\"black\"><B>$R_loggedin_stringl1</B></FONT></TD>
</TR>
<TR>
<TD align=\"left\">
524,14 → 469,15
</TD>
</TR>
</TABLE>
</DIV>
</center>
</form>
</DIV>
</body>
</html>";
}
#Fin des modifications
if ($result == 1) {
if ($result == 1) { //sucess
echo "
<table id=\"auth_reussi\">
<tr>
541,39 → 487,23
<td>
<p class=\"text_auth\">$R_login</p>
</td>
</tr>";
</tr>
<tr>
<td></td>
<td>";
if ($reply) {
## traitement reply
echo "<center> $reply </br></br></center>";
echo "$reply</br></br>";
}
echo "
<center>
<a href=\"http://$uamip:$uamport/logoff\">$R_logout</a>
</center>
</body>
</html>";
}
 
if (($result == 4) || ($result == 12)) {
echo "
<table id=\"auth_reussi\">
<tr>
<td>
<img height=\"150\" src=\"/images/logo-alcasar.png\">
<a href=\"http://$uamip:$uamport/logoff\">$R_logout</a>
</td>
<td>
<p class=\"text_auth\">$R_login</p>
</td>
</tr>
<tr><td colspan=2><center>
<p class=\"lien_deco\"><a href=\"http://$uamip:$uamport/logoff\">$R_logout</a></p>
</center></td></tr>
</table>
</body>
</html>";
</body>
</html>";
}
 
if ($result == 11) {
if ($result == 11) { //popup 1 (login)
echo "
<h2 style=\"text-align: center;\">$R_loggingin</h2>
<center>$R_wait</center>
580,17 → 510,5
</body>
</html>";
}
 
if (($result == 3) || ($result == 13)) {
echo "
<center>
<p class=\"log_out\">$R_loggedout</p>
<FORM>
<INPUT TYPE=\"button\" VALUE=\"$R_boutonF\" onClick=\"window.close()\">
</FORM></CENTER>
</body>
</html>";
}
 
exit(0);
?>