* improved "access denied" handler (catch all requests)

This commit is contained in:
Max Pozdeev 2010-06-13 12:31:09 +04:00
parent ed2544ba8c
commit 1e36a1604c
2 changed files with 5 additions and 6 deletions

View file

@ -577,7 +577,6 @@ function loadTasks(opts)
});
refreshTaskCnt();
$('#tasklist').html(tasks);
//port: if(json.denied) errorDenied();
});
};

View file

@ -24,7 +24,10 @@ mytinytodoStorageAjax.prototype =
{
if(!this[action]) throw "Unknown storage action: "+action;
this[action](params, callback);
this[action](params, function(json){
if(json.denied) mtt.errorDenied();
callback.call(mtt, json)
});
},
@ -142,10 +145,7 @@ mytinytodoStorageAjax.prototype =
publishList: function(params, callback)
{
$.post(this.mtt.mttUrl+'ajax.php?publishList', { list:params.list, publish:params.publish }, function(json){
if(json.denied) mtt.errorDenied();
callback.call(mtt, json)
}, 'json');
$.post(this.mtt.mttUrl+'ajax.php?publishList', { list:params.list, publish:params.publish }, callback, 'json');
},
changeListOrder: function(params, callback)