Session handling

This commit is contained in:
Dima Malishev 2011-09-11 02:57:00 +03:00
parent e1011048bd
commit b1ea8b2726
10 changed files with 243 additions and 91 deletions

View file

@ -1,3 +1,26 @@
App.Actions.authorize = function()
{
if ($('#authorize-form').length > 0) {
return;
}
App.View.popup('login');
}
App.Actions.do_authorise = function()
{
$('#authorize-error').text('');
App.Ajax.request('MAIN.signin', {'login':$('#authorize-login').val(), 'password':$('#authorize-login'.val())}, function(reply)
{
if (reply.result) {
location.href = '';
}
else {
$('#authorize-error').text(reply.message);
}
});
}
App.Actions.delete_entry = function(evt)
{
var confirmed = confirm(App.i18n.getMessage('confirm'));
@ -351,3 +374,14 @@ App.Actions.view_template_info = function(evt)
}
});
}
App.Actions.toggle_stats_block = function(evt)
{
var elm = $(evt.target);
if (!!elm.attr('checked')) {
elm.parents('.stats-settings').find('.stats-block').removeClass('hidden');
}
else {
elm.parents('.stats-settings').find('.stats-block').addClass('hidden');
}
}