X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2Feuphorik.js;h=6ed19637883039b35f131eb332900e2f652905c0;hb=01922222ac686c2507052c0cc1d755495145d154;hp=3503c7e81f6c2fef2af46a432f2b01954cd99b99;hpb=d9d05b6a2a13c2da190dd68d4409381d093679b2;p=euphorik.git diff --git a/js/euphorik.js b/js/euphorik.js index 3503c7e..6ed1963 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -305,7 +305,8 @@ Formateur.prototype.traiterLiensConv = function(M) } /** - * FIXME : Cette méthode est attrocement lourde ! A optimiser. + * FIXME : Cette méthode est attrocement lourde ! A optimiser. + * moyenne su échantillon : 234ms */ Formateur.prototype.traiterSmiles = function(M) { @@ -426,7 +427,7 @@ Client.prototype.resetDonneesPersonnelles = function() this.nickFormat = "nick" this.pagePrincipale = 1 - this.ek_master = false + this.ekMaster = false // les conversations, une conversation est un objet possédant les attributs suivants : // - racine (entier) @@ -672,10 +673,10 @@ Client.prototype.connexion = function(messageJson) Client.prototype.deconnexion = function() { - this.flush() + this.flush() + this.delCookie() this.setStatut(statutType.deconnected) // deconnexion this.resetDonneesPersonnelles() - this.delCookie () } Client.prototype.chargerDonnees = function(data) @@ -707,7 +708,7 @@ Client.prototype.chargerDonnees = function(data) // les conversations thisClient.conversations = data["conversations"] - thisClient.ek_master = data["ek_master"] + thisClient.ekMaster = data["ek_master"] } this.dernierMessageErreur = data["error_message"] } @@ -770,6 +771,39 @@ Client.prototype.majMenu = function() } } +Client.prototype.ban = function(userId, minutes) +{ + var thisClient = this + + // par défaut un ban correspond à 3 jours + if (typeof(minutes) == "undefined") + minutes = 60 * 24 * 3 + + jQuery.ajax({ + type: "POST", + url: "request", + dataType: "json", + data: this.util.jsonVersAction( + { + "action" : "ban", + "cookie" : thisClient.cookie, + "duration" : minutes, + "user_id" : userId + }), + success: + function(data) + { + if (data["reply"] == "error") + thisClient.util.messageDialogue(data["error_message"]) + } + }) +} + +Client.prototype.kick = function(userId) +{ + this.ban(userId, 15) +} + /////////////////////////////////////////////////////////////////////////////////////////////////// function initialiserListeStyles(client)