parsing member_id into exp:user:edit
Posted: 21 July 2008 10:27 AM   [ Ignore ]
Member
RankRankRank
Total Posts:  76
Joined  2007-07-19

If i make an edit form with this

{exp:user:edit member_id="5" return="template_group/template"}your code{/exp:user:edit}

and add a member ID to the url it will only show the member ID for user 5 and it ignores the the url member id (this is what i want to happen).

However, i want this to only show the user edit for for the currently logged in user, so i tried this (copied from the docs):

{exp:user:edit member_id="{member_id}" return="template_group/template"}your code{/exp:user:edit}

But if i then add a member ID to the url it will change to that members user edit page rather than the currently logged in admins.

Is this the correct behaviour or is it not parsing member_id as a parameter?

It’s not the end of the world since only admins can edit other peoples profile this way, but i like to lock down my templates.

Profile
 
 
Posted: 22 July 2008 07:11 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Joobs,

Have you seen the User:Is_Mine documentation? smile

{exp:user:is_mine member_id="{member_id}"

{if mine}This profile is mine
, or I am a super admin.{/if} 
{if not_mine}Eat my shorts
.{/if} 

{exp
:user:edit return="user"

<p>Location <input name="location" value="{location}" /></p
<
p>Email <input name="email" value="{email}" /></p
<
p>Username <input name="username" value="{username}" /></p
<
p>Screen Name <input name="screen_name" value="{screen_name}" /></p
<
p>Password <input type="password" name="password" value="" /></p
<
p>Password Confirm <input type="password" name="password_confirm" value="" /></p
<
p>Current Password <input type="password" name="current_password" value="" /></p
<
p><input type="submit" value="Submit" /></p

{/exp:user:edit} 

{
/exp:user:is_mine}

 Signature 
Profile