Manage user global variable

This commit is contained in:
Benjamin Renard 2014-01-12 20:03:12 +01:00
parent eaf2c8d0f4
commit d70e964e77

View file

@ -407,9 +407,7 @@ on_valid_login_modal=function(e) {
* Sync
********************/
on_click_sync_btn=function(e) {
if (jQuery.type(localStorage.user)!="undefined") {
user=JSON.parse(localStorage.user);
localStorage.oldgroups=groups.export();
if (user) {
sync_server.sync(user.server, user.email, user.password, groups.export(),
function(data) {
console.log(data);
@ -455,6 +453,7 @@ logged_menu=function() {
}
logged_out_menu=function() {
user=false;
$('#user-name').html('Connexion');
$('#user-menu li').remove();
menu=$('#user-menu');