Forums / Developer / Delete user from frontend..

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

eZ debug

Timing: Jan 18 2025 02:49:09
Script start
Timing: Jan 18 2025 02:49:09
Module start 'content'
Timing: Jan 18 2025 02:49:10
Module end 'content'
Timing: Jan 18 2025 02:49:10
Script end

Main resources:

Total runtime0.7291 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 587.7109180.8359
Module start 'content' 0.00570.7144 768.5469582.5391
Module end 'content' 0.72010.0089 1,351.085950.1094
Script end 0.7290  1,401.1953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4187140.0002
Check MTime0.00130.1833140.0001
Mysql Total
Database connection0.00080.109710.0008
Mysqli_queries0.667191.5015670.0100
Looping result0.00060.0825650.0000
Template Total0.702496.320.3512
Template load0.00210.282820.0010
Template processing0.700396.052820.3501
Template load and register function0.00020.025210.0002
states
state_id_array0.00090.125110.0009
state_identifier_array0.00110.150220.0005
Override
Cache load0.00180.2463440.0000
Sytem overhead
Fetch class attribute can translate value0.00050.074220.0003
Fetch class attribute name0.00090.125270.0001
XML
Image XML parsing0.00080.111320.0004
class_abstraction
Instantiating content class attribute0.00000.003290.0000
General
dbfile0.00210.2824190.0001
String conversion0.00000.000530.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs