Giving your user the access to delete their account, is possible in Joomla! now. Its not core part of Joomla! but we have created a plug-in, which will do it without affecting your website. Here are the some simple steps, through which you can get this functionality working.
Install the Plugin
Install the plugin from Extension Manager of your Joomla! website. After installing the plugin will be listed in plugin manager section as "Delete My Account". It is a system plugin, so you can also filter the listing by type "System". Enable the plugin and edit the plugin to set Parameters.
Configure the Plugin
After clicking on edit link of plugin you will have some options, which you should configure according to your need.
- Action to be taken : If you want to block users' account, if they request for deleting account, then you need to select "Bock" or if you want to permanently delete users' account on the request od "Delete My Account", then you must select "Delete" option. Make sure once user's account is deleted it can not be recovered again.
- Load jQuery : This plugin requires jQuery to work. If you are already using jQuery then you must set this option to "NO". For Joomla 2.5, you need to set this option to "Yes",, as generally Joomla 2.5 does not load jQuery, but still your any other extension is using jQuery and it is getting loaded on all pages, you can set this option to "NO".
- Email as System Email : If this option is set to Yes, email will also be sent to those users who System Email to Yes in user manager.
- Emails : You can enter your custom email ids (by comma separated), to which Account deletion acknowledgement email should be sent.
Create a Link
After configuring the plugin, you need to create link. This link can be shown anywhere, like it can be a menu link, any module or your custom content can have a anchor tag with href="#". For creating menu link you must take care of two things
- Link should be visible to registered users only, so you need to apply access right of "Registered" or anything else except "Public" and "Guest".
- Link must have a class which must have class "f90-delete-my-account".
You can create multiple link if you want to show multiple times. But just make sure of about two points. We are taking example of creating menu link through Joomla! menu manager.
- Create a menu item under the Menu, in which you want to show. It is type of Sytem => External URL and url is #. Because we do not want to redirect user at any link.
- Now click on Link Type Tab, and in field Link CSS Style enter the text "f90-delete-my-account". It will add class "f90-delete-my-account" to menu link.
How to send delete my account request?
Your admin configuration is complete now. You need to test the plugin now. Create a dummy account and loin with this account at front end. You will see delete my account link, click on it. After clicking this link you will see an Confirmation Box, asking that "Are you sure you want to delete your account". after confirmation an Ajax request will be sent to the plugin and your request will be processed. You should wait util it get completed.
After processing you will have the acknowledgement box saying, your account have been delete successfully and will make you logout from your current session. If any error occurs, then error messgae will be shown and your account will not get deleted.
All the admin users, who can receive system email will receive an Email whenever any user requests for deleting his/her account. You can change the mail content and other text by overriding language tokens. It is described in next paragraph.
You can change the text of html which is displayed to user and email which is sent to ammin user, by overriding language token of this plugin. Find the text which you want to change in file YourJoomla => administrator => language => en-GB => en-Gb.plg_system_f990deletemyaccount.ini and override the respective token(s).