aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-05-15 19:33:13 +0100
committerGitHub <noreply@github.com>2021-05-15 20:33:13 +0200
commitf582ec4e5367f77d6b3085540a56fed818d6c638 (patch)
treeb7dc6b114e0e8980073c403ad906fa8c6903a467 /templates/user
parent17c5c654a57ecf51c8c7c8ecfc6c86ae313d4000 (diff)
downloadgitea-f582ec4e5367f77d6b3085540a56fed818d6c638.tar.gz
gitea-f582ec4e5367f77d6b3085540a56fed818d6c638.zip
Create a session on ReverseProxy and ensure that ReverseProxy users cannot change username (#15304)
* Create a session on ReverseProxy and ensure that ReverseProxy users cannot change username ReverseProxy users should generate a session on reverse proxy username change. Also prevent ReverseProxy users from changing their username. Fix #2407 * add testcase Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates/user')
-rw-r--r--templates/user/settings/profile.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl
index ee3cc58904..9f07226632 100644
--- a/templates/user/settings/profile.tmpl
+++ b/templates/user/settings/profile.tmpl
@@ -15,8 +15,8 @@
<span class="text red hide" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span>
<span class="text red hide" id="name-change-redirect-prompt"> {{.i18n.Tr "settings.change_username_redirect_prompt"}}</span>
</label>
- <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if not .SignedUser.IsLocal}}disabled{{end}}>
- {{if not .SignedUser.IsLocal}}
+ <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if or (not .SignedUser.IsLocal) .IsReverseProxy}}disabled{{end}}>
+ {{if or (not .SignedUser.IsLocal) .IsReverseProxy}}
<p class="help text blue">{{$.i18n.Tr "settings.password_username_disabled"}}</p>
{{end}}
</div>