From: Alexander Ebert Date: Sat, 20 May 2017 20:05:32 +0000 (+0200) Subject: Fixed link to edit own profile inside user dropdown X-Git-Tag: 3.0.6~45 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9c97182114bf469b3e3a5066f2edef8e88a8859f;p=GitHub%2FWoltLab%2FWCF.git Fixed link to edit own profile inside user dropdown The code previously lacked a check for ther profile ownership, causing administrators to start editing a foreign profile once they click on "Edit Profile" in their user panel dropdown. --- diff --git a/com.woltlab.wcf/templates/user.tpl b/com.woltlab.wcf/templates/user.tpl index 524dc0669b..46860e76f3 100644 --- a/com.woltlab.wcf/templates/user.tpl +++ b/com.woltlab.wcf/templates/user.tpl @@ -64,14 +64,16 @@ }); var userProfileEditor = new WCF.User.Profile.Editor({@$user->userID}, {if $editOnInit}true{else}false{/if}); - var editLink = elBySel('.interactiveDropdownItemsUserMenu .jsUserPanelEditProfile'); - if (editLink) { - editLink.addEventListener(WCF_CLICK_EVENT, function (event) { - userProfileEditor._beginEdit(event); - - WCF.CloseOverlayHandler.forceExecution(); - }); - } + {if $__wcf->getUser()->userID == $user->userID} + var editLink = elBySel('.interactiveDropdownItemsUserMenu .jsUserPanelEditProfile'); + if (editLink) { + editLink.addEventListener(WCF_CLICK_EVENT, function (event) { + userProfileEditor._beginEdit(event); + + WCF.CloseOverlayHandler.forceExecution(); + }); + } + {/if} {/if} {if $followingCount > 7}