Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

When logged in via a login provider, changing the Name is not allowed any more as would be overwritten anyways

Henriette Dingere4e59738afbd
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index 8e284bd4809..e51d7da3b8d 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -48,8 +48,19 @@ See docs/COPYRIGHT.rdoc for more details.
<%= @user.login %>
</div>
</div>
- <div class="form--field -required"><%= f.text_field :firstname, required: true, container_class: '-middle' %></div>
- <div class="form--field -required"><%= f.text_field :lastname, required: true, container_class: '-middle' %></div>
+ <% login_via_provider = [email protected]_url %>
+ <div class="form--field -required">
+ <%= f.text_field :firstname, required: true, container_class: '-middle', disabled: login_via_provider %>
+ <% if login_via_provider %>
+ <span class="form--field-instructions"><%= t('user.text_change_disabled_for_provider_login') %></span>
+ <% end %>
+ </div>
+ <div class="form--field -required">
+ <%= f.text_field :lastname, required: true, container_class: '-middle', disabled: login_via_provider %>
+ <% if login_via_provider %>
+ <span class="form--field-instructions"><%= t('user.text_change_disabled_for_provider_login') %></span>
+ <% end %>
+ </div>
<div class="form--field -required"><%= f.text_field :mail, required: true, container_class: '-middle' %></div>
<%= fields_for :pref, @user.pref, builder: TabularFormBuilder, lang: current_language do |pref_fields| %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 33d7605b165..84ec8ffd5c5 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2631,6 +2631,7 @@ en:
mail_self_notified: "I want to be notified of changes that I make myself"
status_user_and_brute_force: "%{user} and %{brute_force}"
status_change: "Status change"
+ text_change_disabled_for_provider_login: "The name is set by your login provider and can thus not be changed."
unlock: "Unlock"
unlock_and_reset_failed_logins: "Unlock and reset failed logins"