Forums / Developer / Delete user from frontend..
D K
Thursday 02 July 2009 1:48:24 am
Hi,
I want to facilitate a logged user to delete user account himself.
I used following code <form method="post" action={"content/action/"|ezurl}> <input name="ContentNodeID" value="{$node.node_id}" type="text"> <input name="ContentObjectID" value="{$node.object.id}" type="text"> <input class="button" name="ActionRemove" value="Supprimer" title="Supprimer cet élément." type="submit"> </form>
and set user role ascontent remove Class( User ) , Section( Users )
User can delete his record. The problem is once deleted it redirected to http://www.mysite.com/Users/Utilisateurs. So the user do not have permission to view this area. I want to redirect to home page once deleted the details. Also I want to logout the logged user.
Can anyone help on this matter.
Thanks. --------------------------------http://www.eyepax.com
http://www.eyepax.com
André R.
Thursday 02 July 2009 4:32:06 am
Try to set ContentNodeID to the node you want the user to be redirect to after the delete operation.But you probably need to create your own view for this for several reasons, one is to logout user ( he isn't? ), second is to not allow users to delete other users witch you allow by the "content remove Class( User ) , Section( Users ) " access rule.
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription @: http://twitter.com/andrerom
Friday 03 July 2009 2:20:29 am
Hi André R.,
Thank you for your reply. I have done as per your suggesstion. Now the thing is user record not delete and redirect to the node we assigned as "ContentNodeID".
Do you have any idea?
Thanks.
Friday 03 July 2009 2:39:30 am
Actually ignore my suggestion about using another node id. If the user had permission to delete it, it would have been deleted(I read the code wrong the first time).. :(
I have created an enhancement issue for you on this one here:http://issues.ez.no/IssueView.php?Id=15130&activeItem=1
Feel free to comment on it if you have anything to add.
Friday 03 July 2009 3:25:09 am
Thanks. for your support. I have found an extension (RedirectOperators) that we can set redirection in the template.
We can provide redirect page as {redirectrelative( '/path/to/file.php' )}.
But I don't have any idea to find the template that activated after deletion of the user.
Can you help me on this?
Friday 03 July 2009 3:36:25 am
Enable this setting in site.ini, it will give you an a list of used templates and hint for witch one to override:
[TemplateSettings] ShowUsedTemplates=enabled