Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 536 → Rev 537

/web/status.php
3,7 → 3,7
# status.php for Alcasar captive portal
# by steweb57
#
$organisme = "";
$organisme = "steweb57";
 
# Choice of language
//reste quelques traductions à faire
133,37 → 133,8
<script type="text/javascript" src="./js/ChilliLibrary.js"></script>
<script type="text/javascript" src="./js/statusControler.js"></script>
<link type="text/css" href="./css/status.css" rel="stylesheet">
<script language="JavaScript">
if (typeof isloggedout == 'undefined') isloggedout = true;
function closePopup(){
this.focus();
self.opener=this;
self.close();
}
function alcasarLogoff(){
//pb sous Safari et Opera (OnbeforeUnload)
if (isloggedout === false){
chilliClock.stop();
chilliController.logoff();
showWaitPage(5000);
alert("<?php echo $l_loggedout; ?>");
}
isloggedout = true;
}
function logout() {
alcasarLogoff();
window.setTimeout("closePopup()",1000);
}
function logoutWithConfirmation(msg) {
if (confirm(msg)) {
logout();
}
return false;
}
</script>
</head>
<body OnbeforeUnload="javascript:alcasarLogoff();">
<body>
<div id="Chilli">
<div id="locationName"></div>
<div id="chilliPage">
178,7 → 149,7
</table>
</div>
<div id="statusPage" class="c1">
<table border="0" id="statusTable"><!-- style="padding-top:4px;font-size:70%" -->
<table border="0" id="statusTable">
<tr>
<td rowspan="2" valign="top"><img height="150" src="./images/logo-alcasar.png" alt="logo"></td>
<td>
/web/js/statusControler.js
4,6 → 4,7
chilliController.onUpdate = updateUI ;
chilliController.onError = handleError ;
chilliClock.onTick = function () { }
 
var isloggedout = false;
 
if (!window.queryObj) {
103,27 → 104,6
//showErrorPage(code);
}
 
/* Action triggered when buttons are pressed */
function connect() {
var username = document.getElementById('username').value ;
var password = document.getElementById('password').value ;
 
if (username == null || username == '')
return setElementValue('logonMessage', 'Username is required');
showWaitPage(1000);
chilliController.logon( username , password ) ;
}
 
function disconnect() {
if (confirm("Are you sure you want to disconnect now?")) {
chilliClock.stop();
showWaitPage(1000);
chilliController.logoff();
}
return false;
}
 
/* User interface pages update */
function showLoggedOutPage() {
isloggedout = true;
213,6 → 193,30
setElementValue("errorMessage", str);
}
 
function closePopup(){
this.focus();
self.opener=this;
self.close();
}
function alcasarLogoff(){
if (isloggedout == false){
chilliClock.stop();
chilliController.logoff();
}
showWaitPage(1000);
isloggedout = true;
}
function logout() {
alcasarLogoff();
window.setTimeout("closePopup()",1000);
}
function logoutWithConfirmation(msg) {
if (confirm(msg)) {
logout();
}
return false;
}
var chillijsWindowOnLoad = window.onload;
var delayTimer; // global reference to delayTimer
 
220,15 → 224,19
if (chillijsWindowOnLoad)
chillijsWindowOnLoad();
 
//var logonForm = document.getElementById('logonForm');
var logonForm = document.getElementById('loggedOutPage');
 
var head = document.getElementsByTagName("head")[0];
if (head == null) head = document.body;
 
if (logonForm == null) {
logonForm = document.getElementById('loginForm');
}
showWaitPage();
setTimeout('chilliController.refresh()', 500);
}
}
 
// The event window.onbeforeunload doesn't work with some browsers like 'opera' or 'Safari'.
// In the next version of alcasar, 30' without the status window do an automatic logout.
var alcasarOnbeforeUnload = window.onbeforeunload;
 
window.onbeforeunload = function(){
if (alcasarOnbeforeUnload)
alcasarOnbeforeUnload();
alcasarLogoff();
}