X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2Feuphorik.js;h=6ed19637883039b35f131eb332900e2f652905c0;hb=01922222ac686c2507052c0cc1d755495145d154;hp=2d64fe2333857cfffc0e26943296ad3a7ab92016;hpb=13bf850da2316cde3ad2ff8d5c26fb32928bf7b4;p=euphorik.git diff --git a/js/euphorik.js b/js/euphorik.js index 2d64fe2..6ed1963 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -673,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) @@ -771,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)