Revert some refactoring in order to make codebase closer to upstream

rebase/4.0.0rc2
Thibaut Girka 2019-07-23 10:30:24 +02:00
parent 444796b69b
commit 8a89a2b0f4
12 changed files with 42 additions and 4 deletions

View File

@ -1,6 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
class Settings::ApplicationsController < Settings::BaseController class Settings::ApplicationsController < Settings::BaseController
layout 'admin'
before_action :authenticate_user!
before_action :set_application, only: [:show, :update, :destroy, :regenerate] before_action :set_application, only: [:show, :update, :destroy, :regenerate]
before_action :prepare_scopes, only: [:create, :update] before_action :prepare_scopes, only: [:create, :update]

View File

@ -1,12 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
class Settings::BaseController < ApplicationController class Settings::BaseController < ApplicationController
layout 'admin'
before_action :authenticate_user!
before_action :set_pack before_action :set_pack
before_action :set_body_classes before_action :set_body_classes
private
def set_pack def set_pack
use_pack 'settings' use_pack 'settings'
end end

View File

@ -1,8 +1,10 @@
# frozen_string_literal: true # frozen_string_literal: true
class Settings::DeletesController < Settings::BaseController class Settings::DeletesController < Settings::BaseController
layout 'admin'
prepend_before_action :check_enabled_deletion before_action :check_enabled_deletion
before_action :authenticate_user!
before_action :require_not_suspended! before_action :require_not_suspended!
skip_before_action :require_functional! skip_before_action :require_functional!

View File

@ -3,6 +3,10 @@
class Settings::ExportsController < Settings::BaseController class Settings::ExportsController < Settings::BaseController
include Authorization include Authorization
layout 'admin'
before_action :authenticate_user!
def show def show
@export = Export.new(current_account) @export = Export.new(current_account)
@backups = current_user.backups @backups = current_user.backups

View File

@ -1,6 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
class Settings::FlavoursController < Settings::BaseController class Settings::FlavoursController < Settings::BaseController
layout 'admin'
before_action :authenticate_user!
skip_before_action :require_functional!
def index def index
redirect_to action: 'show', flavour: current_flavour redirect_to action: 'show', flavour: current_flavour
end end

View File

@ -1,6 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
class Settings::ImportsController < Settings::BaseController class Settings::ImportsController < Settings::BaseController
layout 'admin'
before_action :authenticate_user!
before_action :set_account before_action :set_account
def show def show

View File

@ -1,6 +1,10 @@
# frozen_string_literal: true # frozen_string_literal: true
class Settings::MigrationsController < Settings::BaseController class Settings::MigrationsController < Settings::BaseController
layout 'admin'
before_action :authenticate_user!
def show def show
@migration = Form::Migration.new(account: current_account.moved_to_account) @migration = Form::Migration.new(account: current_account.moved_to_account)
end end

View File

@ -1,6 +1,10 @@
# frozen_string_literal: true # frozen_string_literal: true
class Settings::PreferencesController < Settings::BaseController class Settings::PreferencesController < Settings::BaseController
layout 'admin'
before_action :authenticate_user!
def show; end def show; end
def update def update

View File

@ -3,6 +3,9 @@
class Settings::ProfilesController < Settings::BaseController class Settings::ProfilesController < Settings::BaseController
include ObfuscateFilename include ObfuscateFilename
layout 'admin'
before_action :authenticate_user!
before_action :set_account before_action :set_account
obfuscate_filename [:account, :avatar] obfuscate_filename [:account, :avatar]

View File

@ -3,6 +3,9 @@
module Settings module Settings
module TwoFactorAuthentication module TwoFactorAuthentication
class ConfirmationsController < BaseController class ConfirmationsController < BaseController
layout 'admin'
before_action :authenticate_user!
before_action :ensure_otp_secret before_action :ensure_otp_secret
skip_before_action :require_functional! skip_before_action :require_functional!

View File

@ -3,6 +3,10 @@
module Settings module Settings
module TwoFactorAuthentication module TwoFactorAuthentication
class RecoveryCodesController < BaseController class RecoveryCodesController < BaseController
layout 'admin'
before_action :authenticate_user!
skip_before_action :require_functional! skip_before_action :require_functional!
def create def create

View File

@ -2,6 +2,9 @@
module Settings module Settings
class TwoFactorAuthenticationsController < BaseController class TwoFactorAuthenticationsController < BaseController
layout 'admin'
before_action :authenticate_user!
before_action :verify_otp_required, only: [:create] before_action :verify_otp_required, only: [:create]
skip_before_action :require_functional! skip_before_action :require_functional!