Allowing users to delete their profile/membership

Permalink
Hi

I have a site that users can join using the registration form and are then put into a group.

I need to create a page where users can request to delete their profiles so that it either deletes the profile automatically or i am sent an email with their request.

Anybody know the best way to do this? RIght now the only way to delete a member is through the admin user groups section.

Many thanks

 
adajad replied on at Permalink Reply
adajad
You could build a page with a form on it (excluded from nav) and then link to that page from the profile page. That way you may be sent an email when the user sends the form and you can supply a thank you message telling the user the account will be removed within some days.

In this screen cast you can see how you link to a page on the profile page: http://www.concrete5.org/documentation/how-tos/editors/screencast-h...
alanbrownco replied on at Permalink Reply
Hi

Thanks for reply.

The problem with that is that when i receive the email saying that somebody has summited the form it does not tell me which user submitted it. The form is emailed from my admins email,not the users email.

So i need a way for the email to contain the information of the user that submitted the form either by their username or the email used to registered in the first place.

Regards
mkly replied on at Permalink Reply
mkly
This code deactivates the logged in user. You can make a block with a button that calls this in the controller and then redirects to the home page or something.

$u = new User();
if($u->isLoggedIn()) {
  $ui = UserInfo::getByID($u->getUserID());
  $ui->deactivate();
  $u->logout();
}
alanbrownco replied on at Permalink Reply
Thanks mkly

I can see what your saying but i am a novice and do not have the skills to edit the code or create my own block.