From aeb1feb8264427c3563e25e3fd53542be72a9df2 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 24 Oct 2017 17:00:48 +0200 Subject: [PATCH] Fixed issue #1457: Comprehensive LDAP settings are to big for the DelayedJobs database table. --- app/controllers/concerns/integration/import_job_base.rb | 8 ++++++-- app/controllers/integration/exchange_controller.rb | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/concerns/integration/import_job_base.rb b/app/controllers/concerns/integration/import_job_base.rb index 493351ec7..8761987cf 100644 --- a/app/controllers/concerns/integration/import_job_base.rb +++ b/app/controllers/concerns/integration/import_job_base.rb @@ -30,15 +30,19 @@ module Integration::ImportJobBase end def payload_dry_run - params + clean_payload(params.permit!.to_h) end def payload_import - import_setting + clean_payload(import_setting) end private + def clean_payload(payload) + payload.except(:wizardData, :action, :controller) + end + def answer_with result = yield render json: result.merge(result: 'ok') diff --git a/app/controllers/integration/exchange_controller.rb b/app/controllers/integration/exchange_controller.rb index a173f1853..1e66600c4 100644 --- a/app/controllers/integration/exchange_controller.rb +++ b/app/controllers/integration/exchange_controller.rb @@ -59,7 +59,7 @@ class Integration::ExchangeController < ApplicationController # currently a workaround till LDAP is migrated to Sequencer def payload_dry_run { - ews_attributes: params[:attributes], + ews_attributes: params[:attributes].permit!.to_h, ews_folder_ids: params[:folders], ews_config: { endpoint: params[:endpoint],