Delete user from frontend..

Author Message

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 as
content 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

D K

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.

http://www.eyepax.com

André R.

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.

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

D K

Friday 03 July 2009 3:25:09 am

Hi André R.,

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?

Thanks.

http://www.eyepax.com

André R.

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

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:35:04
Script start
Timing: Jan 18 2025 10:35:04
Module start 'layout'
Timing: Jan 18 2025 10:35:04
Module start 'content'
Timing: Jan 18 2025 10:35:05
Module end 'content'
Timing: Jan 18 2025 10:35:05
Script end

Main resources:

Total runtime0.9377 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 587.9141152.6250
Module start 'layout' 0.00890.0029 740.539139.4453
Module start 'content' 0.01180.9243 779.9844577.4609
Module end 'content' 0.93610.0015 1,357.445316.1641
Script end 0.9377  1,373.6094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3422160.0002
Check MTime0.00140.1492160.0001
Mysql Total
Database connection0.00130.135110.0013
Mysqli_queries0.875993.4072660.0133
Looping result0.00060.0590640.0000
Template Total0.901296.120.4506
Template load0.00180.197120.0009
Template processing0.899495.906620.4497
Template load and register function0.00020.017610.0002
states
state_id_array0.00100.104610.0010
state_identifier_array0.00100.110120.0005
Override
Cache load0.00160.1739440.0000
Sytem overhead
Fetch class attribute can translate value0.00070.069820.0003
Fetch class attribute name0.00100.110070.0001
XML
Image XML parsing0.00070.073220.0003
class_abstraction
Instantiating content class attribute0.00000.002190.0000
General
dbfile0.00090.0960170.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0003 secs