diff --git a/e107_core/shortcodes/batch/usersettings_shortcodes.php b/e107_core/shortcodes/batch/usersettings_shortcodes.php
index 29f36637a..b9994fee0 100755
--- a/e107_core/shortcodes/batch/usersettings_shortcodes.php
+++ b/e107_core/shortcodes/batch/usersettings_shortcodes.php
@@ -554,5 +554,22 @@ class usersettings_shortcodes extends e_shortcode
}
+ function sc_deleteaccountbutton($parm=array())
+ {
+
+ if((int) $_GET['id'] !== USERID)
+ {
+ return null;
+ }
+
+ $confirm = defset("LAN_USET_51", "Are you sure? This procedure cannot be reversed! Once completed all personal data that you have entered on this site will be permanently lost and you will no longer be able to login.");
+ $label = defset('LAN_USET_50', "Delete All Account Information");
+
+ $parm['confirm'] = $confirm;
+
+ return e107::getForm()->button('delete_account',1, 'delete', $label, $parm);
+
+ }
+
}
?>
\ No newline at end of file
diff --git a/e107_core/templates/usersettings_template.php b/e107_core/templates/usersettings_template.php
index c5222a588..330f0ca4d 100755
--- a/e107_core/templates/usersettings_template.php
+++ b/e107_core/templates/usersettings_template.php
@@ -173,6 +173,7 @@ $USERSETTINGS_EDIT = "
{UPDATESETTINGSBUTTON}
+ {DELETEACCOUNTBUTTON}
";
@@ -303,6 +304,7 @@ $USERSETTINGS_TEMPLATE['edit'] = "
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php
index 2232669ed..906cbf7ca 100644
--- a/e107_handlers/form_handler.php
+++ b/e107_handlers/form_handler.php
@@ -3148,7 +3148,7 @@ class e_form
return $text;
}
-
+
return $this->admin_button($name, $value, $action, $label, $options);
@@ -3253,6 +3253,13 @@ class e_form
$include = (deftrue("FONTAWESOME")) ? "data-loading-icon='fa-spinner' data-disable='true'" : "";
}
+ $confirmation = LAN_JSCONFIRM;
+
+ if(!empty($options['confirm']))
+ {
+ $confirmation = $options['confirm'];
+ }
+
$options = $this->format_options('admin_button', $name, $options);
$options['class'] = vartrue($options['class']);
@@ -3277,7 +3284,10 @@ class e_form
case 'delete':
case 'danger':
- $options['other'] = 'data-confirm="'.LAN_JSCONFIRM.'"';
+
+
+
+ $options['other'] = 'data-confirm="'.$confirmation.'"';
break;
case 'batch':
diff --git a/e107_languages/English/lan_usersettings.php b/e107_languages/English/lan_usersettings.php
index f5fb4bf54..2892622b0 100644
--- a/e107_languages/English/lan_usersettings.php
+++ b/e107_languages/English/lan_usersettings.php
@@ -145,4 +145,6 @@ define("LAN_CUSTOMTITLE", "Custom title");
define("LAN_USET_5", "Subscribed to");
define("LAN_USET_6", "Subscribe to our mailing-list(s) and/or sections of this site.");
// define("LAN_USET_8", "Signature / Time zone");
-?>
\ No newline at end of file
+
+define("LAN_USET_50", "Delete Account");
+define("LAN_USET_51", "Are you sure? This procedure cannot be reversed! Once completed, your account and any personal data that you have entered on this site will be permanently lost and you will no longer be able to login.");
\ No newline at end of file
diff --git a/e107_web/js/core/all.jquery.js b/e107_web/js/core/all.jquery.js
index cf4c175ea..efa5ef078 100644
--- a/e107_web/js/core/all.jquery.js
+++ b/e107_web/js/core/all.jquery.js
@@ -788,6 +788,19 @@ $.ajaxSetup({
$(document).ready(function()
{
+
+ // Basic Delete Confirmation
+ $('input.delete,button.delete,a[data-confirm]').click(function(){
+ answer = confirm($(this).attr("data-confirm"));
+ return answer; // answer is a boolean
+ });
+
+ $(".e-confirm").click(function(){
+ answer = confirm($(this).attr("title"));
+ return answer; // answer is a boolean
+ });
+
+
//check all
$("#check-all").click(function(event){
var val = $(this).val(), selector = '.field-spacer';
diff --git a/usersettings.php b/usersettings.php
index 2f3f64b97..7cc9e50f8 100644
--- a/usersettings.php
+++ b/usersettings.php
@@ -69,7 +69,7 @@ class usersettings_front // Begin Usersettings rewrite.
function __construct()
{
- if(deftrue('BOOTSTRAP')===3)
+ if(deftrue('BOOTSTRAP'))
{
$template = e107::getCoreTemplate('usersettings','', true, true); // always merge
@@ -172,6 +172,11 @@ class usersettings_front // Begin Usersettings rewrite.
$adminEdit = false; // @deprecated // FALSE if editing own data. TRUE if admin edit
+ if(!empty($_POST['delete_account']))
+ {
+ echo e107::getMessage()->addWarning("This feature is currently under development. Your data has not been modified")->render(); // do not LAN.
+ }
+
/* todo subject of removal */
if(is_numeric(e_QUERY))
{ // Trying to edit specific user record