- ;;; dumpObj(dataToSend)
- jQuery.ajax(
- {
- type: "POST",
- url: "request",
- dataType: "json",
- data: this.util.jsonVersAction(dataToSend),
- success:
- function(data)
- {
- ;;; dumpObj(data)
-
- if (data["reply"] == "list_banned_ips")
- {
- var XHTML = ""
- for(var i = 0; i < data["list"].length; i++)
- {
- var ip = data["list"][i]
- XHTML += '<div class="ban"><span class="ip">' + ip["ip"] + '</span>|' +
- '<span class="temps">' +
- ip["remaining_time"] +
- '</span>|'
- for(var j = 0; j < ip["users"].length; j++)
- {
- var user = ip["users"][j]
- XHTML += (j > 0 ? ", " : "") +
- '<span class="pseudo">' + thisPageAdmin.formateur.traitementComplet(user["nick"]) + '</span>' +
- (user["login"] == "" ? "" : '<span class="login">(' + thisPageAdmin.formateur.traitementComplet(user["login"]) + ')</span>')
- }
- XHTML += '<span class="deban">débannir</span></div>'
- }
-
- if (data["list"].length == 0)
- XHTML += '<p>Aucune IP bannie</p>'
-
- $("#ips").html(XHTML)
-
- $(".ban").each(
- function()
- {
- var ip = $(".ip", this).html()
- $(".deban", this).click(
- function()
- {
- thisPageAdmin.util.messageDialogue("Êtes-vous sur de vouloir débannir l'IP ''" + ip + "'' ?", messageType.question,
- {"Oui" : function()
- {
- thisPageAdmin.deban(ip)
- },
- "Non" : function(){}
- }
- )
- }
- )
+ var thisPageAdmin = this;
+
+ this.communication.requete(
+ "list_banned_ips",
+ {"cookie" : this.client.cookie},
+ function(data) {
+ var XHTML = "";
+ data.list.each(function(i, ip) {
+ XHTML += '<div class="ban"><span class="ip">' + ip.ip + '</span>|' +
+ '<span class="temps">' +
+ ip.remaining_time +
+ '</span>|';
+ ip.users.each(function(j, user) {
+ XHTML += (j > 0 ? ", " : "") +
+ '<span class="pseudo">' + thisPageAdmin.formateur.traitementComplet(user.nick) + '</span>' +
+ (user.login === "" ? "" : '<span class="login">(' + thisPageAdmin.formateur.traitementComplet(user.login) + ')</span>');
+ });
+ XHTML += '<span class="deban">débannir</span></div>';
+ });
+
+ if (data.list.length === 0) {
+ XHTML += '<p>Aucune IP bannie</p>';
+ }
+
+ $("#ips").html(XHTML);
+
+ $(".ban").each(function() {
+ var ip = $(".ip", this).html();
+ $(".deban", this).click(
+ function() {
+ thisPageAdmin.util.messageDialogue("Êtes-vous sur de vouloir débannir l'IP ''" + ip + "'' ?", euphorik.Util.messageType.question,
+ {"Oui" : function() {
+ thisPageAdmin.deban(ip);
+ },
+ "Non" : function(){}