From 7ae3fbbc11508be79b7ac3173bbd9baf58026b58 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 15 Jan 2016 15:10:56 +0100 Subject: [PATCH] Removed not longer needed sso backend. --- lib/sso.rb | 14 -------------- lib/sso/otrs.rb | 29 ----------------------------- 2 files changed, 43 deletions(-) delete mode 100644 lib/sso/otrs.rb diff --git a/lib/sso.rb b/lib/sso.rb index bf55430cb..5301788b6 100644 --- a/lib/sso.rb +++ b/lib/sso.rb @@ -22,20 +22,6 @@ returns { adapter: 'Sso::Env', }, - { - adapter: 'Sso::Otrs', - required_group_ro: 'stats', - group_rw_role_map: { - 'admin' => 'Admin', - 'stats' => 'Report', - }, - group_ro_role_map: { - 'stats' => 'Report', - }, - always_role: { - 'Agent' => true, - }, - }, ] # added configured backends diff --git a/lib/sso/otrs.rb b/lib/sso/otrs.rb deleted file mode 100644 index b97a0a5e6..000000000 --- a/lib/sso/otrs.rb +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ - -module Sso::Otrs - def self.check( params, _config_item ) - - endpoint = Setting.get('import_otrs_endpoint') - return false if !endpoint - return false if endpoint.empty? - return false if endpoint == 'http://otrs_host/otrs' - return false if !params['SessionID'] - - # connect to OTRS - result = Import::OTRS.session( params['SessionID'] ) - - 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 - - if !user - Rails.logger.info "No such user #{result['user']['UserLogin']}, requested for SSO!" - return - end - - user - end -end