Merge branch 'develop' of github.com:martini/zammad into develop
This commit is contained in:
commit
736c782bf3
4 changed files with 6 additions and 50 deletions
|
@ -442,7 +442,7 @@ class ChatWindow extends App.Controller
|
||||||
})
|
})
|
||||||
|
|
||||||
disconnect: =>
|
disconnect: =>
|
||||||
@addStatusMessage("<strong>You</strong> left the conversation")
|
@addStatusMessage('<strong>You</strong> left the conversation')
|
||||||
App.WebSocket.send(
|
App.WebSocket.send(
|
||||||
event:'chat_session_close'
|
event:'chat_session_close'
|
||||||
data:
|
data:
|
||||||
|
|
5
db/migrate/20160113000001_update_auth.rb
Normal file
5
db/migrate/20160113000001_update_auth.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class UpdateAuth < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Setting.where(name:'auth_otrs').destroy_all
|
||||||
|
end
|
||||||
|
end
|
21
db/seeds.rb
21
db/seeds.rb
|
@ -391,27 +391,6 @@ Setting.create_if_not_exists(
|
||||||
state: true,
|
state: true,
|
||||||
frontend: 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(
|
Setting.create_if_not_exists(
|
||||||
title: 'Authentication via LDAP',
|
title: 'Authentication via LDAP',
|
||||||
name: 'auth_ldap',
|
name: 'auth_ldap',
|
||||||
|
|
|
@ -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
|
|
Loading…
Reference in a new issue