diff --git a/.github/workflows/brakeman-scan-core.yml b/.github/workflows/brakeman-scan-core.yml index 1b585f33991b..3160d431daf2 100644 --- a/.github/workflows/brakeman-scan-core.yml +++ b/.github/workflows/brakeman-scan-core.yml @@ -29,11 +29,6 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 - with: - # FIXME: remove the ruby version once '3.2.2' is released. - # This is set to head to fix ruby segfaulting when brakeman is - # used. See https://bugs.ruby-lang.org/issues/19433 - ruby-version: 'head' - name: Setup Brakeman run: | diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index c28326a5fb47..b8554bbbf4bc 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -19,9 +19,8 @@ jobs: TOKEN: ${{ secrets.OPENPROJECT_CI_TOKEN }} REPOSITORY: opf/openproject-flavours WORKFLOW_ID: ci.yml - CORE_REF: ${{ github.ref_name }} run: | curl -i --fail-with-body -H"authorization: Bearer $TOKEN" \ -XPOST -H"Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/$REPOSITORY/actions/workflows/$WORKFLOW_ID/dispatches \ - -d '{"ref": "dev", "inputs": { "ref" : "'$CORE_REF'" }}' + -d '{"ref": "dev", "inputs": { "ref" : "${{ github.ref_name }}" }}' diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 000000000000..8b30f3873e49 --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,26 @@ +name: migration-warning-on-release-branches + +on: + pull_request: + branches: + - release/* + paths: + - 'db/migrate/**.rb' + - 'modules/**/db/migrate/*.rb' + +jobs: + danger: + if: github.repository == 'opf/openproject' + runs-on: [ubuntu-latest] + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2.3' + - uses: MeilCli/danger-action@v5 + with: + danger_file: 'Dangerfile' + danger_id: 'danger-pr' + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 000000000000..3e464b81f625 --- /dev/null +++ b/Dangerfile @@ -0,0 +1,9 @@ +CORE_OR_MODULE_MIGRATIONS_REGEX = %r{(modules/.*)?db/migrate/.*\.rb} + +def added_or_modified_migrations? + (git.modified_files + git.added_files).grep(CORE_OR_MODULE_MIGRATIONS_REGEX) +end + +if added_or_modified_migrations? + warn "This PR has migration-related changes on a release branch. Ping @opf/operations" +end diff --git a/Gemfile b/Gemfile index 2c9db7c6e658..8af268ad236f 100644 --- a/Gemfile +++ b/Gemfile @@ -382,4 +382,4 @@ end gem 'openproject-octicons', '~>19.8.0' gem 'openproject-octicons_helper', '~>19.8.0' -gem 'openproject-primer_view_components', '~>0.20.0' +gem 'openproject-primer_view_components', '~>0.22.2' diff --git a/Gemfile.lock b/Gemfile.lock index 720531b1b0cd..5f00834bbea0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -238,35 +238,35 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + actioncable (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + actionmailbox (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3) - actionpack (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activesupport (= 7.1.3) + actionmailer (7.1.3.2) + actionpack (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activesupport (= 7.1.3.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3) - actionview (= 7.1.3) - activesupport (= 7.1.3) + actionpack (7.1.3.2) + actionview (= 7.1.3.2) + activesupport (= 7.1.3.2) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -277,31 +277,31 @@ GEM actionpack-xml_parser (2.0.1) actionpack (>= 5.0) railties (>= 5.0) - actiontext (7.1.3) - actionpack (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + actiontext (7.1.3.2) + actionpack (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3) - activesupport (= 7.1.3) + actionview (7.1.3.2) + activesupport (= 7.1.3.2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3) - activesupport (= 7.1.3) + activejob (7.1.3.2) + activesupport (= 7.1.3.2) globalid (>= 0.3.6) - activemodel (7.1.3) - activesupport (= 7.1.3) + activemodel (7.1.3.2) + activesupport (= 7.1.3.2) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (7.1.3) - activemodel (= 7.1.3) - activesupport (= 7.1.3) + activerecord (7.1.3.2) + activemodel (= 7.1.3.2) + activesupport (= 7.1.3.2) timeout (>= 0.4.0) activerecord-import (1.5.1) activerecord (>= 4.2) @@ -314,13 +314,13 @@ GEM multi_json (~> 1.11, >= 1.11.2) rack (>= 2.0.8, < 4) railties (>= 6.1) - activestorage (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activesupport (= 7.1.3) + activestorage (7.1.3.2) + actionpack (= 7.1.3.2) + activejob (= 7.1.3.2) + activerecord (= 7.1.3.2) + activesupport (= 7.1.3.2) marcel (~> 1.0) - activesupport (7.1.3) + activesupport (7.1.3.2) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -756,7 +756,7 @@ GEM actionview openproject-octicons (= 19.8.0) railties - openproject-primer_view_components (0.20.0) + openproject-primer_view_components (0.22.2) actionview (>= 5.0.0) activesupport (>= 5.0.0) openproject-octicons (>= 19.8.0) @@ -824,7 +824,7 @@ GEM puma (>= 5.0, < 7) raabro (1.4.0) racc (1.7.3) - rack (2.2.8) + rack (2.2.8.1) rack-accept (0.4.5) rack (>= 0.4) rack-attack (6.7.0) @@ -854,20 +854,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.3) - actioncable (= 7.1.3) - actionmailbox (= 7.1.3) - actionmailer (= 7.1.3) - actionpack (= 7.1.3) - actiontext (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activemodel (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + rails (7.1.3.2) + actioncable (= 7.1.3.2) + actionmailbox (= 7.1.3.2) + actionmailer (= 7.1.3.2) + actionpack (= 7.1.3.2) + actiontext (= 7.1.3.2) + actionview (= 7.1.3.2) + activejob (= 7.1.3.2) + activemodel (= 7.1.3.2) + activerecord (= 7.1.3.2) + activestorage (= 7.1.3.2) + activesupport (= 7.1.3.2) bundler (>= 1.15.0) - railties (= 7.1.3) + railties (= 7.1.3.2) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -882,9 +882,9 @@ GEM rails-i18n (7.0.8) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + railties (7.1.3.2) + actionpack (= 7.1.3.2) + activesupport (= 7.1.3.2) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -1227,7 +1227,7 @@ DEPENDENCIES openproject-octicons (~> 19.8.0) openproject-octicons_helper (~> 19.8.0) openproject-openid_connect! - openproject-primer_view_components (~> 0.20.0) + openproject-primer_view_components (~> 0.22.2) openproject-recaptcha! openproject-reporting! openproject-storages! diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1f77a494fd07..564973057f70 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -220,7 +220,15 @@ def reset_i18n_fallbacks end def set_localization - SetLocalizationService.new(User.current, request.env['HTTP_ACCEPT_LANGUAGE']).call + # 1. Use completely autheticated user + # 2. Use user with some authenticated stages not compelted. + # In this case user is not considered logged in, but identified. + # It covers localization for extra authentication stages(like :consent, for example) + # 3. Use anonymous instance. + user = RequestStore[:current_user] || + (session[:authenticated_user_id].present? && User.find_by(id: session[:authenticated_user_id])) || + User.anonymous + SetLocalizationService.new(user, request.env['HTTP_ACCEPT_LANGUAGE']).call end def deny_access(not_found: false) diff --git a/app/controllers/concerns/accounts/authentication_stages.rb b/app/controllers/concerns/accounts/authentication_stages.rb index 1ddb7bf5fbd4..c2524f58e16d 100644 --- a/app/controllers/concerns/accounts/authentication_stages.rb +++ b/app/controllers/concerns/accounts/authentication_stages.rb @@ -1,3 +1,31 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + module Accounts::AuthenticationStages def successful_authentication(user, reset_stages: true, just_registered: false) stages = authentication_stages after_activation: just_registered, reset: reset_stages diff --git a/app/controllers/concerns/accounts/user_consent.rb b/app/controllers/concerns/accounts/user_consent.rb index 74cf7f9d00ca..a2603dfae3ef 100644 --- a/app/controllers/concerns/accounts/user_consent.rb +++ b/app/controllers/concerns/accounts/user_consent.rb @@ -33,8 +33,8 @@ module Accounts::UserConsent include ::UserConsentHelper def consent - if consent_required? - render 'account/consent', locals: { consenting_user: } + if user_consent_required? && consenting_user&.consent_expired? + render 'account/consent' else consent_finished end @@ -50,14 +50,6 @@ def confirm_consent end end - def consent_required? - # Ensure consent is enabled and a text is provided - return false unless user_consent_required? - - # Require the user to consent if he hasn't already - consent_expired? - end - def decline_consent message = I18n.t('consent.decline_warning_message') + "\n" message << @@ -71,19 +63,6 @@ def decline_consent redirect_to authentication_stage_failure_path :consent end - def consent_expired? - consented_at = consenting_user.try(:consented_at) - - # Always if the user has not consented - return true if consented_at.blank? - - # Did not expire if no consent_time set, but user has consented at some point - return false if Setting.consent_time.blank? - - # Otherwise, expires when consent_time is newer than last consented_at - consented_at < Setting.consent_time - end - def consenting_user User.find_by id: session[:authenticated_user_id] end diff --git a/app/helpers/user_consent_helper.rb b/app/helpers/user_consent_helper.rb index dbf945c51c1d..66d5a6dafbe8 100644 --- a/app/helpers/user_consent_helper.rb +++ b/app/helpers/user_consent_helper.rb @@ -37,16 +37,14 @@ def user_consent_required? end ## - # Gets consent instructions for the given user. + # Gets consent instructions. # - # @param user [User] The user to get instructions for. # @param locale [String] ISO-639-1 code for the desired locale (e.g. de, en, fr). # `I18n.locale` is set for each request individually depending # among other things on the user's Accept-Language headers. # @return [String] Instructions in the respective language. - def user_consent_instructions(_user, locale: I18n.locale) + def user_consent_instructions(locale) all = Setting.consent_info - all.fetch(locale.to_s) { all.values.first } end @@ -54,6 +52,8 @@ def consent_checkbox_label(locale: I18n.locale) I18n.t('consent.checkbox_label', locale:) end + private + def consent_configured? if Setting.consent_info.count == 0 Rails.logger.error 'Instance is configured to require consent, but no consent_info has been set.' diff --git a/app/models/role.rb b/app/models/role.rb index f2c06f8a24d1..a30278a45b02 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -77,7 +77,16 @@ def copy_from_role(source_role) inclusion: { in: ->(*) { Role.subclasses.map(&:to_s) } } def self.givable - where.not(builtin: [BUILTIN_NON_MEMBER, BUILTIN_ANONYMOUS]) + where + .not( + builtin: [ + Role::BUILTIN_NON_MEMBER, + Role::BUILTIN_ANONYMOUS, + Role::BUILTIN_WORK_PACKAGE_VIEWER, + Role::BUILTIN_WORK_PACKAGE_COMMENTER, + Role::BUILTIN_WORK_PACKAGE_EDITOR + ] + ) .order(Arel.sql('position')) end diff --git a/app/models/user.rb b/app/models/user.rb index 22e7c63f525a..806f40ebddcc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -470,6 +470,17 @@ def anonymous? !logged? end + def consent_expired? + # Always if the user has not consented + return true if consented_at.blank? + + # Did not expire if no consent_time set, but user has consented at some point + return false if Setting.consent_time.blank? + + # Otherwise, expires when consent_time is newer than last consented_at + consented_at < Setting.consent_time + end + # Cheap version of Project.visible.count def number_of_known_projects if admin? diff --git a/app/seeders/demo_data/global_query_seeder.rb b/app/seeders/demo_data/global_query_seeder.rb index b6e535ab5942..4c918b2387f9 100644 --- a/app/seeders/demo_data/global_query_seeder.rb +++ b/app/seeders/demo_data/global_query_seeder.rb @@ -33,6 +33,10 @@ def seed_data! end end + def applicable? + Query.global.none? + end + private def seed_global_queries diff --git a/app/seeders/development_data/shared_work_packages_seeder.rb b/app/seeders/development_data/shared_work_packages_seeder.rb index 6abe5062e5a7..5bfccbcc581d 100644 --- a/app/seeders/development_data/shared_work_packages_seeder.rb +++ b/app/seeders/development_data/shared_work_packages_seeder.rb @@ -81,8 +81,8 @@ def work_package_attributes reference: :save_gotham, description: "Gotham is in trouble. It's your job to save it!", status: seed_data.find_reference(:default_status_new), - type: seed_data.find_reference(:default_type_epic), - priority: seed_data.find_reference(:default_priority_immediate) + type: seed_data.find_reference(:default_type_epic, :default_type_phase), + priority: seed_data.find_reference(:default_priority_immediate, :default_priority_high) }, { project:, @@ -92,7 +92,7 @@ def work_package_attributes description: 'Must be stopped before Gotham is doomed.', status: seed_data.find_reference(:default_status_new), type: seed_data.find_reference(:default_type_task), - priority: seed_data.find_reference(:default_priority_immediate) + priority: seed_data.find_reference(:default_priority_immediate, :default_priority_high) }, { project:, diff --git a/app/seeders/root_seeder.rb b/app/seeders/root_seeder.rb index 0712ee730088..e95fb44f0a4c 100644 --- a/app/seeders/root_seeder.rb +++ b/app/seeders/root_seeder.rb @@ -29,10 +29,13 @@ # Seeds the minimum data required to run OpenProject (BasicDataSeeder, AdminUserSeeder) # as well as optional demo data (DemoDataSeeder) to give a user some orientation. class RootSeeder < Seeder - def initialize(seed_development_data: Rails.env.development?) + attr_reader :raise_on_unknown_language + + def initialize(seed_development_data: Rails.env.development?, raise_on_unknown_language: false) super() @seed_development_data = seed_development_data + @raise_on_unknown_language = raise_on_unknown_language load_available_seeders end @@ -174,7 +177,14 @@ def seed_plugins_data def desired_lang desired_lang = ENV.fetch('OPENPROJECT_SEED_LOCALE', Setting.default_language) - raise "Locale #{desired_lang} is not supported" if Redmine::I18n.all_languages.exclude?(desired_lang) + + if Redmine::I18n.all_languages.exclude?(desired_lang) + if raise_on_unknown_language + raise "Locale #{desired_lang} is not supported" + else + desired_lang = :en + end + end desired_lang end diff --git a/app/seeders/source/seed_data.rb b/app/seeders/source/seed_data.rb index 61da39acbcd2..82540ce6a9fe 100644 --- a/app/seeders/source/seed_data.rb +++ b/app/seeders/source/seed_data.rb @@ -43,15 +43,25 @@ def store_reference(reference, record) registry[reference] = record end - def find_reference(reference, default: :__unset__) + # Finds and returns the value associated with the given reference. + # + # @param reference [Symbol] The reference to search for. + # @param fallbacks [Array] Optional fallback references to search for if the primary reference is not found. + # @param default [Object] The default value to return if no reference or fallbacks are found. + # @return [Object, nil] The value associated with the reference, or nil if the reference is nil. + # @raise [ArgumentError] If no reference or fallbacks are found and no default value is provided. + def find_reference(reference, *fallbacks, default: :__unset__) return if reference.nil? - registry.fetch(reference) do - if default == :__unset__ - raise ArgumentError, "Nothing registered with reference #{reference.inspect}" - end - + existing_ref = [reference, *fallbacks].find { |ref| registry.key?(ref) } + if existing_ref + registry[existing_ref] + elsif default != :__unset__ default + else + references = [reference, *fallbacks].map(&:inspect) + message = "Nothing registered with #{'reference'.pluralize(references.count)} #{references.to_sentence(locale: false)}" + raise ArgumentError, message end end diff --git a/app/seeders/standard.yml b/app/seeders/standard.yml index 8eee51f18036..e64223af7f27 100644 --- a/app/seeders/standard.yml +++ b/app/seeders/standard.yml @@ -27,14 +27,17 @@ #++ priorities: - - t_name: Low + - reference: :default_priority_low + t_name: Low color_name: cyan-1 position: 1 - - t_name: Normal + - reference: :default_priority_normal + t_name: Normal color_name: blue-3 is_default: true position: 2 - - t_name: High + - reference: :default_priority_high + t_name: High color_name: yellow-7 position: 3 - reference: :default_priority_immediate diff --git a/app/services/principals/replace_references_service.rb b/app/services/principals/replace_references_service.rb index e7846ec00a7b..e960a3856a4b 100644 --- a/app/services/principals/replace_references_service.rb +++ b/app/services/principals/replace_references_service.rb @@ -93,6 +93,7 @@ def rewrite_author(from, to) def rewrite_user(from, to) [TimeEntry, + CostEntry, ::Query, Changeset, CostQuery, @@ -126,7 +127,10 @@ def rewrite_responsible(from, to) end def rewrite_logged_by(from, to) - [TimeEntry].each do |klass| + [ + TimeEntry, + CostEntry + ].each do |klass| rewrite(klass, :logged_by_id, from, to) end end diff --git a/app/services/projects/archive_service.rb b/app/services/projects/archive_service.rb index 28b20f7bc9e4..db0e8aaf1535 100644 --- a/app/services/projects/archive_service.rb +++ b/app/services/projects/archive_service.rb @@ -29,7 +29,7 @@ module Projects class ArchiveService < ::BaseServices::BaseContracted include Contracted - include Projects::Concerns::UpdateDemoData + prepend Projects::Concerns::UpdateDemoData def initialize(user:, model:, contract_class: Projects::ArchiveContract) super(user:, contract_class:) diff --git a/app/services/projects/concerns/update_demo_data.rb b/app/services/projects/concerns/update_demo_data.rb index 2fbb91ce679b..e923cf9fae9f 100644 --- a/app/services/projects/concerns/update_demo_data.rb +++ b/app/services/projects/concerns/update_demo_data.rb @@ -34,8 +34,8 @@ def after_perform(call) project = call.result # e.g. when one of the demo projects gets deleted or archived - if %w[your-scrum-project demo-project].include?(project.identifier) - Setting.demo_projects_available = !project.destroyed? && !project.archived? + if %w[demo-project].include?(project.identifier) + Setting.demo_projects_available = !project.destroyed? && !project.archived? && project.public? end super diff --git a/app/services/projects/delete_service.rb b/app/services/projects/delete_service.rb index 2acfb54e552e..110998d456b5 100644 --- a/app/services/projects/delete_service.rb +++ b/app/services/projects/delete_service.rb @@ -28,7 +28,7 @@ module Projects class DeleteService < ::BaseServices::Delete - include Projects::Concerns::UpdateDemoData + prepend Projects::Concerns::UpdateDemoData ## # Reference to the dependent projects that we're deleting diff --git a/app/services/projects/unarchive_service.rb b/app/services/projects/unarchive_service.rb index f0df6035a9f0..203b49944537 100644 --- a/app/services/projects/unarchive_service.rb +++ b/app/services/projects/unarchive_service.rb @@ -29,7 +29,7 @@ module Projects class UnarchiveService < ::BaseServices::BaseContracted include Contracted - include Projects::Concerns::UpdateDemoData + prepend Projects::Concerns::UpdateDemoData def initialize(user:, model:, contract_class: Projects::UnarchiveContract) super(user:, contract_class:) diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb index b6da8ef729dd..34eab7b4a1d2 100644 --- a/app/services/projects/update_service.rb +++ b/app/services/projects/update_service.rb @@ -28,6 +28,7 @@ module Projects class UpdateService < ::BaseServices::Update + prepend Projects::Concerns::UpdateDemoData private attr_accessor :memoized_changes diff --git a/app/services/set_localization_service.rb b/app/services/set_localization_service.rb index 9249a5342640..013aeab942b2 100644 --- a/app/services/set_localization_service.rb +++ b/app/services/set_localization_service.rb @@ -1,3 +1,31 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + class SetLocalizationService attr_reader :user, :http_accept_header diff --git a/app/views/account/_register.html.erb b/app/views/account/_register.html.erb index 8331c2c9447d..8ea86ce868b0 100644 --- a/app/views/account/_register.html.erb +++ b/app/views/account/_register.html.erb @@ -90,7 +90,7 @@ See COPYRIGHT and LICENSE files for more details. <% if user_consent_required? %>
- <%= render partial: 'account/user_consent_check', locals: { consenting_user: @user } %> + <%= render partial: 'account/user_consent_check' %> <% end %> <%= render partial: 'account/auth_providers', locals: { omniauth_title: I18n.t('account.signup_with_auth_provider'), wide: true } %> diff --git a/app/views/account/_user_consent_check.html.erb b/app/views/account/_user_consent_check.html.erb index c59978007828..26020ae4bd9c 100644 --- a/app/views/account/_user_consent_check.html.erb +++ b/app/views/account/_user_consent_check.html.erb @@ -1,6 +1,6 @@