fixes to the login system
This commit is contained in:
Родитель
edaa7f5611
Коммит
73fc527a9a
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
$datafolder = "/home/h4writer/data/";
|
$datafolder = "/home/h4writer/data/";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
$machine = 30;
|
$machine = 30;
|
||||||
$suiteVersion = 0;
|
$suiteVersion = 0;
|
||||||
if (isset($_GET["machine"]))
|
if (isset($_GET["machine"]))
|
||||||
|
@ -78,7 +80,11 @@ for (var i = 0; i < AWFYOverview["data"].length; i++) {
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var url = "http://www.arewefastyet.com/auth.php";
|
var url;
|
||||||
|
if ((window.location + "").substr(0, 10) == "http://www")
|
||||||
|
url = "http://www.arewefastyet.com/auth.php";
|
||||||
|
else
|
||||||
|
url = "http://arewefastyet.com/auth.php";
|
||||||
|
|
||||||
// Listen on Persona events
|
// Listen on Persona events
|
||||||
var request = false;
|
var request = false;
|
||||||
|
@ -89,19 +95,28 @@ for (var i = 0; i < AWFYOverview["data"].length; i++) {
|
||||||
if(request) {
|
if(request) {
|
||||||
window.location = url + "?persona=1&assertion=" + assertion;
|
window.location = url + "?persona=1&assertion=" + assertion;
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("personaLogout").style.display = "block";
|
//document.getElementById("personaLogout").style.display = "block";
|
||||||
document.getElementById("personaLogin").style.display = "none";
|
//document.getElementById("personaLogin").style.display = "none";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onlogout: function () {
|
onlogout: function () {
|
||||||
if(request) {
|
if(request) {
|
||||||
window.location = url + "?persona=1&logout=1";
|
window.location = url + "?persona=1&logout=1";
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("personaLogout").style.display = "none";
|
//document.getElementById("personaLogout").style.display = "none";
|
||||||
document.getElementById("personaLogin").style.display = "block";
|
//document.getElementById("personaLogin").style.display = "block";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (isset($_SESSION["persona"])) {
|
||||||
|
?>
|
||||||
|
document.getElementById("personaLogout").style.display = "block";
|
||||||
|
document.getElementById("personaLogin").style.display = "none";
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
// Do login in
|
// Do login in
|
||||||
var doLogin = function() {
|
var doLogin = function() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче