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

Remove type and auth_method_name

Oliver Günthere7674b410315
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index 885c6abef45..8b87e40f9b6 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -225,7 +225,7 @@ class AccountController < ApplicationController
session[:invitation_token] = token.value
user = token.user
- if user.ldap_auth_source && user.ldap_auth_source.auth_method_name == 'LDAP'
+ if user.ldap_auth_source
activate_through_ldap user
else
activate_user user
diff --git a/app/models/ldap_auth_source.rb b/app/models/ldap_auth_source.rb
index ec95d4828be..c0ac6a01988 100644
--- a/app/models/ldap_auth_source.rb
+++ b/app/models/ldap_auth_source.rb
@@ -142,10 +142,6 @@ class LdapAuthSource < ApplicationRecord
raise LdapAuthSource::Error, I18n.t('auth_source.ldap_error', error_message: e.to_s)
end
- def auth_method_name
- 'LDAP'
- end
-
def get_user_attributes_from_ldap_entry(entry)
base_attributes = {
dn: entry.dn,
diff --git a/app/views/ldap_auth_sources/edit.html.erb b/app/views/ldap_auth_sources/edit.html.erb
index 7489f94e249..bf853c1108f 100644
--- a/app/views/ldap_auth_sources/edit.html.erb
+++ b/app/views/ldap_auth_sources/edit.html.erb
@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
<% html_title t(:label_administration), "#{t(:label_edit)} #{t(:label_auth_source)} #{@auth_source.name}" %>
<% local_assigns[:additional_breadcrumb] = @auth_source.name %>
-<%= toolbar title: "#{t(:label_auth_source)} (#{@auth_source.auth_method_name})" %>
+<%= toolbar title: "#{t(:label_auth_source)}" %>
<%= labelled_tabular_form_for @auth_source, as: :auth_source do |f| %>
<%= render partial: 'form', locals: { f: f } %>
diff --git a/app/views/ldap_auth_sources/index.html.erb b/app/views/ldap_auth_sources/index.html.erb
index 17fa462bc9e..ce229a568f2 100644
--- a/app/views/ldap_auth_sources/index.html.erb
+++ b/app/views/ldap_auth_sources/index.html.erb
@@ -62,15 +62,6 @@ See COPYRIGHT and LICENSE files for more details.
</div>
</div>
</th>
- <th>
- <div class="generic-table--sort-header-outer">
- <div class="generic-table--sort-header">
- <span>
- <%= LdapAuthSource.human_attribute_name(:type) %>
- </span>
- </div>
- </div>
- </th>
<th>
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
@@ -96,7 +87,6 @@ See COPYRIGHT and LICENSE files for more details.
<% for source in @auth_sources %>
<tr>
<td><%= link_to source.name, action: 'edit', id: source %></td>
- <td><%= source.auth_method_name %></td>
<td><%= source.host %></td>
<td><%= source.users.count %></td>
<td class="buttons">
diff --git a/app/views/ldap_auth_sources/new.html.erb b/app/views/ldap_auth_sources/new.html.erb
index 4d165cf4472..507c29b0055 100644
--- a/app/views/ldap_auth_sources/new.html.erb
+++ b/app/views/ldap_auth_sources/new.html.erb
@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
<% html_title t(:label_administration), t(:label_auth_source_new) %>
<% local_assigns[:additional_breadcrumb] = t(:label_auth_source_new) %>
-<%= toolbar title: "#{t(:label_auth_source_new)} (#{@auth_source.auth_method_name})" %>
+<%= toolbar title: "#{t(:label_auth_source_new)}" %>
<%= labelled_tabular_form_for @auth_source, as: :auth_source do |f| %>
<%= render partial: 'form', locals: { f: f } %>
diff --git a/db/migrate/20230726112130_remove_type_from_ldap_auth_sources.rb b/db/migrate/20230726112130_remove_type_from_ldap_auth_sources.rb
new file mode 100644
index 00000000000..89f044b6d71
--- /dev/null
+++ b/db/migrate/20230726112130_remove_type_from_ldap_auth_sources.rb
@@ -0,0 +1,5 @@
+class RemoveTypeFromLdapAuthSources < ActiveRecord::Migration[7.0]
+ def change
+ remove_column :ldap_auth_sources, :type, :string, null: false
+ end
+end