* login and logout are available now only via POST query

This commit is contained in:
Max Pozdeev 2009-10-01 16:50:04 +04:00
parent ef93b6a4c9
commit 41c84d4c2e
2 changed files with 5 additions and 7 deletions

View file

@ -463,8 +463,7 @@ function updateAccessStatus()
function doAuth(form)
{
setAjaxErrorTrigger();
var nocache = '&rnd='+Math.random();
$.post('ajax.php?login'+nocache, { password: form.password.value }, function(json){
$.post('ajax.php?rnd='+Math.random(), { login:1, password: form.password.value }, function(json){
resetAjaxErrorTrigger();
form.password.value = '';
if(json.logged)
@ -484,10 +483,9 @@ function doAuth(form)
function logout()
{
setAjaxErrorTrigger();
var nocache = '&rnd='+Math.random();
$.getJSON('ajax.php?logout'+nocache, function(json){
$.post('ajax.php?rnd='+Math.random(), { logout:1 }, function(json){
resetAjaxErrorTrigger();
});
}, 'json');
flag.isLogged = false;
updateAccessStatus();
if(flag.canAllRead) {

View file

@ -234,7 +234,7 @@ elseif(isset($_GET['changeOrder']))
echo json_encode($t);
exit;
}
elseif(isset($_GET['login']))
elseif(isset($_POST['login']))
{
$t = array('logged' => 0);
if(!$needAuth) {
@ -252,7 +252,7 @@ elseif(isset($_GET['login']))
echo json_encode($t);
exit;
}
elseif(isset($_GET['logout']))
elseif(isset($_POST['logout']))
{
$_SESSION = array();
$t = array('logged' => 0);