Manage user global variable
This commit is contained in:
parent
eaf2c8d0f4
commit
d70e964e77
1 changed files with 2 additions and 3 deletions
|
@ -407,9 +407,7 @@ on_valid_login_modal=function(e) {
|
||||||
* Sync
|
* Sync
|
||||||
********************/
|
********************/
|
||||||
on_click_sync_btn=function(e) {
|
on_click_sync_btn=function(e) {
|
||||||
if (jQuery.type(localStorage.user)!="undefined") {
|
if (user) {
|
||||||
user=JSON.parse(localStorage.user);
|
|
||||||
localStorage.oldgroups=groups.export();
|
|
||||||
sync_server.sync(user.server, user.email, user.password, groups.export(),
|
sync_server.sync(user.server, user.email, user.password, groups.export(),
|
||||||
function(data) {
|
function(data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
@ -455,6 +453,7 @@ logged_menu=function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
logged_out_menu=function() {
|
logged_out_menu=function() {
|
||||||
|
user=false;
|
||||||
$('#user-name').html('Connexion');
|
$('#user-name').html('Connexion');
|
||||||
$('#user-menu li').remove();
|
$('#user-menu li').remove();
|
||||||
menu=$('#user-menu');
|
menu=$('#user-menu');
|
||||||
|
|
Loading…
Reference in a new issue