From 0d940d6460cab4e74bf39c732a262ec2142f50cd Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 13 Jan 2016 22:38:08 +0100 Subject: [PATCH 1/2] Removed not longer needed otrs runtime auth backend. --- db/migrate/20160113000001_update_auth.rb | 5 +++++ db/seeds.rb | 21 ------------------ lib/auth/otrs.rb | 28 ------------------------ 3 files changed, 5 insertions(+), 49 deletions(-) create mode 100644 db/migrate/20160113000001_update_auth.rb delete mode 100644 lib/auth/otrs.rb diff --git a/db/migrate/20160113000001_update_auth.rb b/db/migrate/20160113000001_update_auth.rb new file mode 100644 index 000000000..2f6ef8cc1 --- /dev/null +++ b/db/migrate/20160113000001_update_auth.rb @@ -0,0 +1,5 @@ +class UpdateAuth < ActiveRecord::Migration + def up + Setting.where(name:'auth_otrs').destroy_all + end +end diff --git a/db/seeds.rb b/db/seeds.rb index 35f34ad27..d5aebaf67 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -391,27 +391,6 @@ Setting.create_if_not_exists( state: true, frontend: true ) -Setting.create_if_not_exists( - title: 'Authentication via OTRS', - name: 'auth_otrs', - area: 'Security::Authentication', - description: 'Enables user authentication via OTRS.', - state: { - adapter: 'Auth::Otrs', - required_group_ro: 'stats', - group_rw_role_map: { - 'admin' => 'Admin', - 'stats' => 'Report', - }, - group_ro_role_map: { - 'stats' => 'Report', - }, - always_role: { - 'Agent' => true, - }, - }, - frontend: false -) Setting.create_if_not_exists( title: 'Authentication via LDAP', name: 'auth_ldap', diff --git a/lib/auth/otrs.rb b/lib/auth/otrs.rb deleted file mode 100644 index f5785f549..000000000 --- a/lib/auth/otrs.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ - -require 'import/otrs' - -module Auth::Otrs - def self.check(username, password, config, user) - - endpoint = Setting.get('import_otrs_endpoint') - return false if !endpoint - return false if endpoint.empty? - return false if endpoint == 'http://otrs_host/otrs' - - # connect to OTRS - result = Import::OTRS.auth(username, password) - return false if !result - return false if !result['groups_ro'] - return false if !result['groups_rw'] - return false if !result['user'] - - user = User.where(login: result['user']['UserLogin'], active: true).first - return false if !user - - # sync / check permissions - Import::OTRS.permission_sync(user, result, config) - - user - end -end From 61615adc009ab76769701ad51870424a5e846b07 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 13 Jan 2016 22:40:14 +0100 Subject: [PATCH 2/2] Fixed coffee lint. --- app/assets/javascripts/app/controllers/chat.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/chat.coffee b/app/assets/javascripts/app/controllers/chat.coffee index eb5919bdf..fe2786b68 100644 --- a/app/assets/javascripts/app/controllers/chat.coffee +++ b/app/assets/javascripts/app/controllers/chat.coffee @@ -442,7 +442,7 @@ class ChatWindow extends App.Controller }) disconnect: => - @addStatusMessage("You left the conversation") + @addStatusMessage('You left the conversation') App.WebSocket.send( event:'chat_session_close' data: