X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Feuphorik.js;h=4b56fa3e01eb18a99bc7d0aa2eb18eeb8470f1b8;hp=d040dc3d5fcaceb368d0c5a4961123803c078b4f;hb=a2f6d159387e456847fb4e7607b4663ab8fa94fc;hpb=3ea00589df90388456e8587b1bebdeab0f7e99fa diff --git a/js/euphorik.js b/js/euphorik.js index d040dc3..4b56fa3 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -642,8 +642,11 @@ Client.prototype.enregistrement = function(login, password) this.login = login this.password = password if(this.flush()) + { this.setStatut(statutType.auth_registered) - return true + return true + } + return false } else { @@ -675,7 +678,7 @@ Client.prototype.connexion = function(messageJson) Client.prototype.deconnexion = function() { - this.flush() + this.flush(true) this.delCookie() this.setStatut(statutType.deconnected) // deconnexion this.resetDonneesPersonnelles() @@ -718,12 +721,14 @@ Client.prototype.chargerDonnees = function(data) Client.prototype.flush = function(async) { if (async == undefined) - async = true + async = false if (!this.authentifie()) return false thisClient = this + var ok = true + ;;; dumpObj(this.getJSONProfile()) jQuery.ajax( { @@ -735,12 +740,17 @@ Client.prototype.flush = function(async) success: function(data) { - //thisClient.util.log(thisClient.util.serializer.serializeToString(data)) + ;;; dumpObj(data) + if (data["reply"] == "error") + { + thisClient.dernierMessageErreur = data["error_message"] + ok = false + } } } ) - // TODO : retourner false si un problème est survenu lors de l'update du profile - return true + + return ok } Client.prototype.majMenu = function() @@ -930,7 +940,7 @@ $(document).ready( initialiserListeStyles(client) // TODO : pourquoi $(document).unload ne fonctionne pas ? - $(window).unload(function(){client.flush(false)}) + $(window).unload(function(){client.flush()}) $("#menu .minichat").click(function(){ pages.afficherPage("minichat") }) $("#menu .admin").click(function(){ pages.afficherPage("admin") })