From a224e531f8f0c37a44bda59b55a667919a372c30 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 16 Sep 2014 12:58:30 -0400 Subject: [PATCH] added a confirmation dialog that asks you to type in your username before being able to delete account --- public/language/ar/user.json | 2 +- public/language/cs/user.json | 2 +- public/language/de/user.json | 2 +- public/language/en@pirate/user.json | 2 +- public/language/en_GB/user.json | 2 +- public/language/en_US/user.json | 2 +- public/language/es/user.json | 2 +- public/language/et/user.json | 2 +- public/language/fa_IR/user.json | 2 +- public/language/fi/user.json | 2 +- public/language/fr/user.json | 2 +- public/language/he/user.json | 2 +- public/language/hu/user.json | 2 +- public/language/it/user.json | 2 +- public/language/ja/user.json | 2 +- public/language/ko/user.json | 2 +- public/language/lt/user.json | 2 +- public/language/ms/user.json | 2 +- public/language/nb/user.json | 2 +- public/language/nl/user.json | 2 +- public/language/pl/user.json | 2 +- public/language/pt_BR/user.json | 2 +- public/language/ro/user.json | 2 +- public/language/ru/user.json | 2 +- public/language/sc/user.json | 2 +- public/language/sk/user.json | 2 +- public/language/sv/user.json | 2 +- public/language/th/user.json | 2 +- public/language/tr/user.json | 2 +- public/language/vi/user.json | 2 +- public/language/zh_CN/user.json | 2 +- public/language/zh_TW/user.json | 2 +- public/src/forum/account/edit.js | 18 ++++++++++++------ 33 files changed, 44 insertions(+), 38 deletions(-) diff --git a/public/language/ar/user.json b/public/language/ar/user.json index 980fe54962..3f6b8cbe4e 100644 --- a/public/language/ar/user.json +++ b/public/language/ar/user.json @@ -5,7 +5,7 @@ "email": "البريد الإلكتروني", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "الاسم الكامل", "website": "الموقع الإلكتروني", "location": "موقع", diff --git a/public/language/cs/user.json b/public/language/cs/user.json index fc341e2e27..0668457ebc 100644 --- a/public/language/cs/user.json +++ b/public/language/cs/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Jméno a příjmení", "website": "Webové stránky", "location": "Poloha", diff --git a/public/language/de/user.json b/public/language/de/user.json index ac5142d047..7e827ae1ac 100644 --- a/public/language/de/user.json +++ b/public/language/de/user.json @@ -5,7 +5,7 @@ "email": "E-Mail", "confirm_email": "E-Mail bestätigen", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Kompletter Name", "website": "Homepage", "location": "Wohnort", diff --git a/public/language/en@pirate/user.json b/public/language/en@pirate/user.json index 81446843ba..10c8d164a2 100644 --- a/public/language/en@pirate/user.json +++ b/public/language/en@pirate/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Full Name", "website": "Website", "location": "Location", diff --git a/public/language/en_GB/user.json b/public/language/en_GB/user.json index 772994f440..92d50ee4ab 100644 --- a/public/language/en_GB/user.json +++ b/public/language/en_GB/user.json @@ -6,7 +6,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Full Name", "website": "Website", diff --git a/public/language/en_US/user.json b/public/language/en_US/user.json index 1156c94b85..414532fe8f 100644 --- a/public/language/en_US/user.json +++ b/public/language/en_US/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Full Name", "website": "Website", "location": "Location", diff --git a/public/language/es/user.json b/public/language/es/user.json index 7096d48bc1..edaa890672 100644 --- a/public/language/es/user.json +++ b/public/language/es/user.json @@ -5,7 +5,7 @@ "email": "Correo Electrónico", "confirm_email": "Repetir correo electrónico", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Nombre completo", "website": "Sitio Web", "location": "Ubicación", diff --git a/public/language/et/user.json b/public/language/et/user.json index e791df8333..848c4daddd 100644 --- a/public/language/et/user.json +++ b/public/language/et/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Kinnita email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Täisnimi", "website": "Koduleht", "location": "Asukoht", diff --git a/public/language/fa_IR/user.json b/public/language/fa_IR/user.json index 73a1370f48..76ab51bacd 100644 --- a/public/language/fa_IR/user.json +++ b/public/language/fa_IR/user.json @@ -5,7 +5,7 @@ "email": "رایانامه", "confirm_email": "تأیید رایانامه", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "نام کامل", "website": "تارنما", "location": "محل سکونت", diff --git a/public/language/fi/user.json b/public/language/fi/user.json index c3577bb745..64fd3511b2 100644 --- a/public/language/fi/user.json +++ b/public/language/fi/user.json @@ -5,7 +5,7 @@ "email": "Sähköposti", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Koko nimi", "website": "Kotisivu", "location": "Sijainti", diff --git a/public/language/fr/user.json b/public/language/fr/user.json index 8af112838f..6d832ee81d 100644 --- a/public/language/fr/user.json +++ b/public/language/fr/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirmer l'adresse email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Nom", "website": "Site web", "location": "Emplacement", diff --git a/public/language/he/user.json b/public/language/he/user.json index d306d4b410..7d2b777bfa 100644 --- a/public/language/he/user.json +++ b/public/language/he/user.json @@ -5,7 +5,7 @@ "email": "כתובת אימייל", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "שם מלא", "website": "אתר", "location": "מיקום", diff --git a/public/language/hu/user.json b/public/language/hu/user.json index ff3f13efb2..024d83aecc 100644 --- a/public/language/hu/user.json +++ b/public/language/hu/user.json @@ -5,7 +5,7 @@ "email": "E-mail", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Teljes Név", "website": "Weboldal", "location": "Lakhely", diff --git a/public/language/it/user.json b/public/language/it/user.json index b225460481..691a818241 100644 --- a/public/language/it/user.json +++ b/public/language/it/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Nome e Cognome", "website": "Sito Internet", "location": "Località", diff --git a/public/language/ja/user.json b/public/language/ja/user.json index 7bdc9a761e..8d69a78188 100644 --- a/public/language/ja/user.json +++ b/public/language/ja/user.json @@ -5,7 +5,7 @@ "email": "メール", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "フルネーム", "website": "ウェブサイト", "location": "ロケーション", diff --git a/public/language/ko/user.json b/public/language/ko/user.json index c619b7015a..7e4f4f760a 100644 --- a/public/language/ko/user.json +++ b/public/language/ko/user.json @@ -5,7 +5,7 @@ "email": "이메일", "confirm_email": "이메일 확인", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "이름", "website": "웹 사이트", "location": "거주지", diff --git a/public/language/lt/user.json b/public/language/lt/user.json index d3839a30cb..7d502c9c1c 100644 --- a/public/language/lt/user.json +++ b/public/language/lt/user.json @@ -5,7 +5,7 @@ "email": "El. paštas", "confirm_email": "Patvirtinti el. paštą", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Vardas ir pavardė", "website": "Tinklalapis", "location": "Vieta", diff --git a/public/language/ms/user.json b/public/language/ms/user.json index ddf8f2d012..7d9a3e2989 100644 --- a/public/language/ms/user.json +++ b/public/language/ms/user.json @@ -5,7 +5,7 @@ "email": "Emel", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Nama penuh", "website": "Laman Web", "location": "Lokasi", diff --git a/public/language/nb/user.json b/public/language/nb/user.json index ceb25363f2..283348db31 100644 --- a/public/language/nb/user.json +++ b/public/language/nb/user.json @@ -5,7 +5,7 @@ "email": "E-post", "confirm_email": "Bekfreft e-post", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Fullt navn", "website": "Nettsted", "location": "Plassering", diff --git a/public/language/nl/user.json b/public/language/nl/user.json index 11e13421c4..916a856227 100644 --- a/public/language/nl/user.json +++ b/public/language/nl/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Bevestig uw email adres", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Volledige Naam", "website": "Website", "location": "Locatie", diff --git a/public/language/pl/user.json b/public/language/pl/user.json index 0c1918be92..bcbe736105 100644 --- a/public/language/pl/user.json +++ b/public/language/pl/user.json @@ -5,7 +5,7 @@ "email": "Adres e-mail", "confirm_email": "Potwierdź e-mail", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Pełna nazwa", "website": "Strona WWW", "location": "Położenie", diff --git a/public/language/pt_BR/user.json b/public/language/pt_BR/user.json index 88307d657f..2ce231dd81 100644 --- a/public/language/pt_BR/user.json +++ b/public/language/pt_BR/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirmar Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Nome Completo", "website": "Website", "location": "Localização", diff --git a/public/language/ro/user.json b/public/language/ro/user.json index 12ab225a2a..a3a45e9731 100644 --- a/public/language/ro/user.json +++ b/public/language/ro/user.json @@ -5,7 +5,7 @@ "email": "Adresă Email", "confirm_email": "Confirmă Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Nume Întreg", "website": "Pagină Web", "location": "Locație", diff --git a/public/language/ru/user.json b/public/language/ru/user.json index 599fe21700..86e3a3dd9d 100644 --- a/public/language/ru/user.json +++ b/public/language/ru/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Подтвердить Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Полное имя", "website": "Сайт", "location": "Откуда", diff --git a/public/language/sc/user.json b/public/language/sc/user.json index 3557fa4082..b8426137bc 100644 --- a/public/language/sc/user.json +++ b/public/language/sc/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Nùmene e Sambenadu", "website": "Giassu web", "location": "Logu", diff --git a/public/language/sk/user.json b/public/language/sk/user.json index e23a35b187..8281beeff1 100644 --- a/public/language/sk/user.json +++ b/public/language/sk/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Meno a priezvisko", "website": "Webová stránka", "location": "Poloha", diff --git a/public/language/sv/user.json b/public/language/sv/user.json index 677cd7a0e5..a55c26bb7d 100644 --- a/public/language/sv/user.json +++ b/public/language/sv/user.json @@ -5,7 +5,7 @@ "email": "Epost", "confirm_email": "Bekräfta epostadress ", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Hela namnet", "website": "Webbsida", "location": "Plats", diff --git a/public/language/th/user.json b/public/language/th/user.json index 84d59d5cae..e5debb6388 100644 --- a/public/language/th/user.json +++ b/public/language/th/user.json @@ -5,7 +5,7 @@ "email": "อีเมล์", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "ชื่อเต็ม", "website": "เว็บไซต์", "location": "สถานที่", diff --git a/public/language/tr/user.json b/public/language/tr/user.json index ae5b8f5956..7f4281ce96 100644 --- a/public/language/tr/user.json +++ b/public/language/tr/user.json @@ -5,7 +5,7 @@ "email": "E-posta", "confirm_email": "E-posta onayla", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Tam Ad", "website": "Websitesi", "location": "Konum", diff --git a/public/language/vi/user.json b/public/language/vi/user.json index a7923a0189..accaa5bcbd 100644 --- a/public/language/vi/user.json +++ b/public/language/vi/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "Tên đầy đủ", "website": "Website", "location": "Địa điểm", diff --git a/public/language/zh_CN/user.json b/public/language/zh_CN/user.json index d7b76aab4c..4e22cd19b5 100644 --- a/public/language/zh_CN/user.json +++ b/public/language/zh_CN/user.json @@ -5,7 +5,7 @@ "email": "电子邮件", "confirm_email": "确认电子邮箱", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "姓名", "website": "网站", "location": "位置", diff --git a/public/language/zh_TW/user.json b/public/language/zh_TW/user.json index ed09318784..ed42254f3b 100644 --- a/public/language/zh_TW/user.json +++ b/public/language/zh_TW/user.json @@ -5,7 +5,7 @@ "email": "Email", "confirm_email": "Confirm Email", "delete_account": "Delete Account", - "delete_account_confirm": "Are you sure you want to delete your account? This action is irreversible and you will not be able to recover any of your data", + "delete_account_confirm": "Are you sure you want to delete your account?
This action is irreversible and you will not be able to recover any of your data

Enter your username to confirm that you wish to destroy this account.", "fullname": "姓名", "website": "網站", "location": "地址", diff --git a/public/src/forum/account/edit.js b/public/src/forum/account/edit.js index d93ca01bbd..4b2645a976 100644 --- a/public/src/forum/account/edit.js +++ b/public/src/forum/account/edit.js @@ -129,15 +129,21 @@ define('forum/account/edit', ['forum/account/header', 'uploader'], function(head function handleAccountDelete() { $('#deleteAccountBtn').on('click', function() { translator.translate('[[user:delete_account_confirm]]', function(translated) { - bootbox.confirm(translated, function(confirm) { + bootbox.confirm(translated + '

', function(confirm) { if (!confirm) { return; } - socket.emit('user.deleteAccount', {}, function(err) { - if (!err) { - app.logout(); - } - }); + + if ($('#confirm-username').val() !== app.username) { + app.alertError('[[error:invalid-username]]'); + return false; + } else { + socket.emit('user.deleteAccount', {}, function(err) { + if (!err) { + app.logout(); + } + }); + } }); }); return false;