API page: https://api.drupal.org/api/drupal/modules%21user%21user.module/function/...

Now after deleting users we are going to the admin/people page.But I want to redirect to the front page after deleting users.
Since making changes in the drupal core module is a bad practice,I like to write a custom module for that.
Which function should I use for this.Can any one help

Comments

Jooblay.net’s picture

Issue tags: +No need

Drupal will default to your system site set page. Go to example.com/admin/config/system/site-information and set your front page.

If your want custom pages to be set after a given action use a rule. Such "after content is updated" page redirect to node/123

Rules are really powerful....

ktrev’s picture

I have written a rule 'After deleting a user' redirect to front page.But this rule is not working.I have posted an issue regarding this in the 'Rules Module'.
Since the rule is not working I thought of writing a custom module for that.
in 'example.com/admin/config/system/site-information' my front page is set.

Jooblay.net’s picture

How are you deleting the user?

Rules have a learning curve take your time and check each step. If you want the rule to trigger the front page you will need to play with the permissions of the user "role" that is deleted. If your do not have the permission as the user to delete your own user account then the rule will not work. This also means you can not delete a user account via the user 1 admin and expect the rule to fire.

ktrev’s picture

I have created a new role 'Sitewise Admin' and gave "Administer user account" permission to that role.
So that a user with that role can delete other users if needed.But after deleting the users he should go to front page.

Jooblay.net’s picture

Yes then you will want to write a rule that set the condition "if user has role" then add an action to redirect to the front page:) that may help you out...

ktrev’s picture

Ok, Thanks for your help. I will try this :)

Version: 7.22 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.