* optimized calls of updateAccessStatus()

This commit is contained in:
Max Pozdeev 2009-11-26 14:46:00 +03:00
parent 5a0ad4e3a0
commit 44746f7ce7
3 changed files with 7 additions and 17 deletions

View file

@ -487,8 +487,7 @@ function doAuth(form)
if(json.logged)
{
flag.isLogged = true;
updateAccessStatus();
loadLists();
loadLists(0,1);
}
else {
flashError(lang.invalidpass);
@ -505,8 +504,7 @@ function logout()
resetAjaxErrorTrigger();
}, 'json');
flag.isLogged = false;
updateAccessStatus();
loadLists();
loadLists(0,1);
return false;
}
@ -900,7 +898,7 @@ function toggleAllNotes(show)
}
}
function loadLists(onInit)
function loadLists(onInit, updAccess)
{
if(filter.search != '') {
filter.search = '';
@ -939,12 +937,14 @@ function loadLists(onInit)
$('#page_tasks h3').children().addClass('invisible');
$('#mylistscontainer .mtt-need-list').addClass('mtt-disabled');
$('#rss_icon').hide();
if(flag.needAuth && !flag.isLogged) $('#page_tasks').hide();
}
ti += '<li class="mtt-tabs-button menu-owner"><a href="#" id="mylists" onClick="btnMenu(this);return false;"><span><img src="images/arrdown.gif"></span></a></li>';
$('#lists>ul').html(ti);
$('#lists').show();
});
$('#page_tasks').hide();
$('#tasklist').html('');
if(updAccess) updateAccessStatus();
}
function addList()

View file

@ -63,9 +63,8 @@ $().ready(function(){
{
echo "\tflag.needAuth = true;\n";
if(is_logged()) echo "\tflag.isLogged = true;\n";
echo "\tupdateAccessStatus();\n";
}
echo "\tloadLists(1);\n";
echo "\tloadLists(1, 1);\n";
?>
preloadImg();
$("#duedate").datepicker({dateFormat: '<?php echo $duedateformat; ?>', firstDay: <?php echo $config['firstdayofweek']; ?>,

View file

@ -40,15 +40,6 @@ if($needAuth && !isset($dontStartSession))
session_start();
}
/*
function canAllRead()
{
global $config;
if(!isset($config['password']) || $config['password'] == '') return true;
if(isset($config['allowread']) && $config['allowread']) return true;
return false;
}*/
function is_logged()
{
if(!isset($_SESSION['logged']) || !$_SESSION['logged']) return false;