Hello,

Current the choices available to users when 'Let users choose action' is set in settings are:

(o) Disable the account and keep all content.
( ) Disable the account and unpublish all content.
( ) Delete the account and make all content belong to the Anonymous user.
( ) Delete the account and all content.

I would like to only show the below as options:
(o) Disable the account and unpublish all content.
( ) Delete the account and all content.

Can anyone please assist? Your help would be very much appreciated!

Comments

artscoop’s picture

Issue tags: +administer, +delete user
StatusFileSize
new10.45 KB

Hi,
If someone could roll a patch from this package, it would be nice.
It adds options to select which options you want to provide to users allowed to delete their account.

All the options are available to anyone with the Administer users permission.

Cheers

artscoop’s picture

Status: Active » Needs work
David Stosik’s picture

Title: limit delete action choice to two options » Limit delete action options to a limited set
Assigned: Unassigned » David Stosik
Category: support » feature
Status: Needs work » Needs review
StatusFileSize
new9.18 KB

Hello,

The attached patch does the following:

  • change the admin form element type from select to checkboxes, to allow many choices
  • give only the selected choices to the user deleting his account (if one only, no choice)
  • handle module update by updating 'user_delete_default_action' variable
  • fix two warnings raised by Coder (one of these being incorrect use of t() inside watchdog() )

Please review it and tell me if there's any bug.

Regards,

David

David Stosik’s picture

StatusFileSize
new18.93 KB

With the new patch, I also unset original core $form['description'] if user has many choices.

YK85’s picture

Thanks for the great work! I will test your patch by this weekend and report back with results.

It would be really awesome if you could also help with #807738: please support themed username for this module =) It would really help complete the User Deletion process by being able to address the user by their first name (the themed username on my site). Thanks!

stella’s picture

I haven't tried out the patch yet, just gave it a quick review. It looks great, but one thing I'd like to see is to limit the options available by using permissions. Currently there's just one permission 'delete own account'. I'd like the ability for different user roles to be able to do different things. My use case - normal users when they delete their account should have their account and all content deleted, whereas when translators delete their account, their content should remain published.

YK85’s picture

Status: Needs review » Reviewed & tested by the community

RTBC for patch at #4
Thanks for the great work!

P.S. still having issue with #807738: please support themed username if you can help! thank you

ilo’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

Sorry, but lets keep 6.x-1.x as it is and moving feature requests for 2.x branch, this way we can introduce features as additional modules that can be ported to d7 also.

This can be done easily using current API implementation in 2.x and a contrib module. (see 'user cancel example' in http://drupal.org/project/examples - it is in the issue queue yet).