/user/edit doesn't work

Author Message

Willie Seabrook

Sunday 31 August 2003 9:31:22 pm

Hi,

I have modified all the user login/register bits etc but i want to allow my users to edit their information easily. However, going to user/edit simply returns an error:

"Unavailable:
Content unavailable"

What is the story with this? How can I allow my users to edit their details but nothing else?

Regards,
Willie

Paul Forsyth

Monday 01 September 2003 12:22:51 am

I have problems editing the user that way. It is the best way, programmatically. The code seems to fail when it checks whether the user can be edited when given the correct user id (user/edit/80, for example).

I get better results by editing the content object directly, as a user is simply a content object. This code gives you an idea how to do this from a form in a template. Sometimes the variable $current_user is set in your current namespace. If not you can fetch it as I have shown. Note, you can test this just by typing a url directly into your browser... :)

{let current_user=fetch('user','current_user')}

<form name="MyForm" method="post" action="{concat('/content/edit/', $current_user.contentobject_id,'/')}">

<input type="submit" name="NewButton" value="Edit user"/>

</form>

Paul

Paul Forsyth

Monday 01 September 2003 12:26:41 am

Note, you need to make sure your user role is able to self edit their own details for this to work. Also, 3.2 has some bug fixes in it to make this work...

Paul

Willie Seabrook

Tuesday 02 September 2003 2:34:31 pm

Do you mean that 3.2 has some fixes in it to make *your* code work or to make the *user/edit* code work?

3.2 Is quite useless to me at the moment because the 3.1 to 3.2 database upgrade sql doesn't work - hence I'm stuck on 3.1.

Regards,
Willie

Paul Forsyth

Wednesday 03 September 2003 12:19:02 am

We saw a comment in svn commit logs a while ago about something in 3.2 that helps to fix this but to be honest im not 100% sure. I just know it seems to work... but we haven't heavily tested yet.

This thread speaks about what we did for 3.1 to get it all to work. There is a small patch in there you can apply.

http://ez.no/developer/ez_publish_3/forum/developer/allowing_users_to_edit_their_own_details_with_selfedit_how_does_it_work

Paul

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 22:31:16
Script start
Timing: Jan 18 2025 22:31:16
Module start 'layout'
Timing: Jan 18 2025 22:31:16
Module start 'content'
Timing: Jan 18 2025 22:31:17
Module end 'content'
Timing: Jan 18 2025 22:31:17
Script end

Main resources:

Total runtime1.4821 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.5078152.6250
Module start 'layout' 0.00710.0033 742.132839.4453
Module start 'content' 0.01041.4703 781.5781493.8047
Module end 'content' 1.48070.0014 1,275.382812.1719
Script end 1.4820  1,287.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.2566160.0002
Check MTime0.00150.0990160.0001
Mysql Total
Database connection0.00140.095610.0014
Mysqli_queries1.423096.0119630.0226
Looping result0.00070.0489610.0000
Template Total1.442897.420.7214
Template load0.00230.152820.0011
Template processing1.440597.196520.7203
Template load and register function0.00030.017010.0003
states
state_id_array0.00160.105510.0016
state_identifier_array0.00170.111320.0008
Override
Cache load0.00180.1244310.0001
Sytem overhead
Fetch class attribute can translate value0.00080.053320.0004
Fetch class attribute name0.00150.098050.0003
XML
Image XML parsing0.00030.018120.0001
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00060.0387100.0001
String conversion0.00000.000740.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs