add confirm dialog when deleting other accounts with same IP address

This commit is contained in:
Régis Hanol 2014-11-21 00:31:22 +01:00
parent ced35cb3bb
commit acb8030d12
2 changed files with 14 additions and 10 deletions

View File

@ -43,17 +43,20 @@ export default Ember.Component.extend({
deleteAllOtherAccounts: function() {
var self = this;
this.setProperties({ other_accounts: null, otherAccountsLoading: true });
Discourse.ajax("/admin/users/delete-others-with-same-ip.json", {
type: "DELETE",
data: {
"ip": this.get("ip"),
"exclude": this.get("user_id"),
"order": "trust_level DESC"
bootbox.confirm(I18n.t("ip_lookup.confirm_delete_other_accounts"), I18n.t("no_value"), I18n.t("yes_value"), function (confirmed) {
if (confirmed) {
self.setProperties({ other_accounts: null, otherAccountsLoading: true });
Discourse.ajax("/admin/users/delete-others-with-same-ip.json", {
type: "DELETE",
data: {
"ip": self.get("ip"),
"exclude": self.get("user_id"),
"order": "trust_level DESC"
}
}).then(function() {
self.send("lookup");
});
}
}).then(function() {
self.send("lookup");
});
}
}

View File

@ -285,6 +285,7 @@ en:
read_time: "read time"
topics_entered: "topics entered"
post_count: "# posts"
confirm_delete_other_accounts: "Are you sure you want to delete these accounts?"
user:
said: "{{username}}:"