How to disable profile editing by users
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
To prevent users from editing their profile.
Customisations are not supported
Note that Atlassian support does not cover customisations to Velocity files, such as those described on this page.
All files should be located under <
confluence-install
>\confluence\users
.
Solution
Removing the Save Profile Option.
To remove the option that allows people to select save changes to their profile, you will need to edit the Velocity template (.vm
file) as described below.
Locate your
editmyprofile.vm
file under1
<confluence-install>\confluence\users\editmyprofile.vm
Edit this file with your favorite editor, such as Wordpad, Notepad or Notepad++ (recommended). The file looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
#macro (renderIfEdit $markup) #trim() #if ($editMode == true) $!generalUtil.htmlEncode($markup) #else $!statusTextRenderer.render($markup) #end #end #end #set($viewingMyProfile = $personalInformationEntity.belongsTo($remoteUser)) <html> <head> <title>$generalUtil.htmlEncode($pageTitle)</title> #requireResource("confluence.web.resources:aui-forms") #requireResource("confluence.userstatus:userstatus-resources") </head> #if ($editMode) #set($mode = "edit-profile-single") #else #set($mode = "edit-profile-three") #end #applyDecorator("root") #decoratorParam("context" "profile") #decoratorParam("mode" $mode) #decoratorParam("helper" $action.helper) #decoratorParam("infopanel-width" "200px") <body> #if($confirmPassOnEmailChange) #requireResource("confluence.web.resources:edit-user-profile") #parse("/users/password-dialog-templates.vm") #end <div class="profile-info #if(!$editMode)section-3#end"> #applyDecorator("form-aui") #decoratorParam("formName" "editmyprofileform") #decoratorParam("formId" "editmyprofileform") #decoratorParam("submitAction" "$req.contextPath/users/doeditmyprofile.action") #decoratorParam("editAction" "$req.contextPath/users/editmyprofile.action") #decoratorParam("editMode" "$editMode") #if(!$editMode && $viewingMyProfile)<a href="$req.contextPath/users/editmyprofile.action" class="edit-link">$action.getText("edit.name")</a>#end <h2 class="first">$action.getText("profile.group.personal")</h2> #form_xsrfToken() <fieldset> <input type="hidden" id="originalemail" value="$storedEmail"/> <input type="hidden" id="passwordconfirmation" value="" name="passwordconfirmation"/> #bodytag ("Component" "label='accessibility.profile.edit.personal'" "template='assistive.vm'" "theme='aui'") #param ("type" "legend") #end #if (!$settingsManager.getGlobalSettings().isExternalUserManagement() && !$userAccessor.isReadOnly($user)) #bodytag( "TextField" "label='fullname.name'" "name='fullName'" "size='50'" "theme='aui'" ) #if($editMode) #param("required" "$action.getText('required.field')") #end #end #tag( "TextField" "label='email.name'" "name='email'" "size='50'" "theme='aui'" ) #else #if($editMode) <strong class="extra-info">$action.getText('user.fields.readonly')</strong> #end #tag( "TextField" "label='fullname.name'" "name='fullName'" "size='50'" "theme='aui'" "readonly=true" ) #tag( "TextField" "label='email.name'" "name='email'" "size='50'" "theme='aui'" "readonly=true" ) #end #foreach ($key in $action.getUserDetailsKeys("personal")) #bodytag( "TextField" "label='confluence.user.profile.$key'" "name='userparam-$key'" "value=getUserProperty('$key')" "size='50'" "theme='aui'" ) #param ("renderWiki" $statusTextRenderer) #end #end #if($editMode) #bodytag ("Component" "name='personalInformation'" "template='textarea.vm'" "theme='aui'") #param ("label" "$action.getText('personal.info')") #param ("rows" 8) #param ("cols" 70) #param ("renderWiki" $blockWikiStyleRenderer) #end #end </fieldset> <h2>$action.getText("profile.group.business")</h2> <fieldset> #bodytag ("Component" "label='accessibility.profile.edit.company'" "template='assistive.vm'" "theme='aui'") #param ("type" "legend") #end #foreach ($key in $action.getUserDetailsKeys("business")) #bodytag( "TextField" "label='confluence.user.profile.$key'" "name='userparam-$key'" "value=getUserProperty('$key')" "size='50'" "theme='aui'" ) #param ("renderWiki" $statusTextRenderer) #end #end #if($editMode == true) #parse ("/pages/includes/captcha-form-elements.vm") #end <!-- #if($viewingMyProfile == true && $editMode==true) <br/> #bodytag( "Submit" "theme='aui'" ) #param ("submitValue" "$action.getText('save.name')") #end #end --> <p><font size="3" color="red">You cannot change your Profile, this is disabled.<br> If you need to change anything contact the Admin.<br></font></p> </fieldset> #end </div> #if(!$editMode) <div class="profile-main section-2"> #if($action.userStatusPluginEnabled && $action.currentStatus && !$editMode) <div> <div class="status-block #if($viewingMyProfile) current-user-latest-status#end"> <span class="status-text">$statusTextRenderer.render($action.currentStatus.status)</span> <div class="status-actions"> <ul> <li><a id="view-$action.currentStatus.id" href="$req.contextPath$action.currentStatus.urlPath" title="$action.dateFormatter.formatDateTime($action.currentStatus.lastModificationDate)">$action.formatFriendlyDate($action.currentStatus.lastModificationDate)</a></li> #if ($viewingMyProfile == true)<li><a id="clear-$action.currentStatus.id" href="$req.contextPath$action.currentStatus.clearPath_xsrfToken()">$action.getText("clear.name")</a></li>#end </ul> </div> </div> </div> #end #applyDecorator("form-aui") #decoratorParam("formName" "editmyprofileform") #decoratorParam("submitAction" "$req.contextPath/users/doeditmyprofile.action") #decoratorParam("editAction" "$req.contextPath/users/editmyprofile.action") #decoratorParam("editMode" "$editMode") #if($hasAboutMe) <div class="profile-section" id="profile-about-me"> #if(!$editMode && $viewingMyProfile)<a href="$req.contextPath/users/editmyprofile.action" class="edit-link">$action.getText("edit.name")</a>#end <h2>$action.getText("personal.info")</h2> <div id="profile-about-me-content">$renderedAboutMe</div> </div> #end <h2>$action.getText("activity.name")</h2> #end <div class="profile-section" id="profile-status-list"> $helper.renderConfluenceMacro("{recently-updated:author=$action.user.name|max=10|theme=sidebar|spaces=*}") </div> #webPanelForLocation("atl.confluence.userprofile" $action.context) </div> #end </body> #end </html>
Save the file. You can reload your page and see the changes. There is no need to restart Confluence.
After following the above steps, you will have something like this:

And Something like this too:

Was this helpful?