Added google and linked in authentication.
This commit is contained in:
parent
c5dee5c797
commit
1c250b586c
9 changed files with 240 additions and 118 deletions
1
Gemfile
1
Gemfile
|
@ -26,6 +26,7 @@ gem "omniauth"
|
||||||
gem "omniauth-twitter"
|
gem "omniauth-twitter"
|
||||||
gem "omniauth-facebook"
|
gem "omniauth-facebook"
|
||||||
gem "omniauth-linkedin"
|
gem "omniauth-linkedin"
|
||||||
|
gem "omniauth-google-oauth2"
|
||||||
|
|
||||||
gem "twitter"
|
gem "twitter"
|
||||||
gem "koala"
|
gem "koala"
|
||||||
|
|
|
@ -83,6 +83,9 @@ GEM
|
||||||
rack
|
rack
|
||||||
omniauth-facebook (1.2.0)
|
omniauth-facebook (1.2.0)
|
||||||
omniauth-oauth2 (~> 1.0.0)
|
omniauth-oauth2 (~> 1.0.0)
|
||||||
|
omniauth-google-oauth2 (0.1.9)
|
||||||
|
omniauth (~> 1.0)
|
||||||
|
omniauth-oauth2
|
||||||
omniauth-linkedin (0.0.6)
|
omniauth-linkedin (0.0.6)
|
||||||
omniauth-oauth (~> 1.0.0)
|
omniauth-oauth (~> 1.0.0)
|
||||||
omniauth-oauth (1.0.0)
|
omniauth-oauth (1.0.0)
|
||||||
|
@ -160,6 +163,7 @@ DEPENDENCIES
|
||||||
mime-types
|
mime-types
|
||||||
omniauth
|
omniauth
|
||||||
omniauth-facebook
|
omniauth-facebook
|
||||||
|
omniauth-google-oauth2
|
||||||
omniauth-linkedin
|
omniauth-linkedin
|
||||||
omniauth-twitter
|
omniauth-twitter
|
||||||
rails (= 3.2.2)
|
rails (= 3.2.2)
|
||||||
|
|
|
@ -182,14 +182,19 @@ class App.Controller extends Spine.Controller
|
||||||
if attribute.tag is 'boolean'
|
if attribute.tag is 'boolean'
|
||||||
|
|
||||||
# build options list
|
# build options list
|
||||||
attribute.options = [
|
if _.isEmpty(attribute.options)
|
||||||
{ name: 'active', value: true }
|
attribute.options = [
|
||||||
{ name: 'inactive', value: false }
|
{ name: 'active', value: true }
|
||||||
] || []
|
{ name: 'inactive', value: false }
|
||||||
|
]
|
||||||
|
|
||||||
|
# update boolean types
|
||||||
|
for record in attribute.options
|
||||||
|
record.value = '{boolean}::' + record.value
|
||||||
|
|
||||||
# finde selected item of list
|
# finde selected item of list
|
||||||
for record in attribute.options
|
for record in attribute.options
|
||||||
if record.value is attribute.value
|
if record.value is '{boolean}::' + attribute.value
|
||||||
record.selected = 'selected'
|
record.selected = 'selected'
|
||||||
|
|
||||||
# return item
|
# return item
|
||||||
|
@ -286,6 +291,15 @@ class App.Controller extends Spine.Controller
|
||||||
else
|
else
|
||||||
param[key.name].push key.value
|
param[key.name].push key.value
|
||||||
else
|
else
|
||||||
|
|
||||||
|
# check boolean
|
||||||
|
boolean = key.value.split '::'
|
||||||
|
if boolean[0] is '{boolean}'
|
||||||
|
if boolean[1] is 'true'
|
||||||
|
key.value = true
|
||||||
|
else
|
||||||
|
key.value = false
|
||||||
|
|
||||||
param[key.name] = key.value
|
param[key.name] = key.value
|
||||||
|
|
||||||
@log 'formParam', form, param
|
@log 'formParam', form, param
|
||||||
|
|
|
@ -28,6 +28,11 @@ class Index extends App.Controller
|
||||||
name: 'LinkedIn',
|
name: 'LinkedIn',
|
||||||
config: 'auth_linkedin',
|
config: 'auth_linkedin',
|
||||||
},
|
},
|
||||||
|
google_oauth2: {
|
||||||
|
url: '/auth/google_oauth2',
|
||||||
|
name: 'Google',
|
||||||
|
config: 'auth_google_oauth2',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
auth_providers = []
|
auth_providers = []
|
||||||
for key, provider of auth_provider_all
|
for key, provider of auth_provider_all
|
||||||
|
|
|
@ -7,6 +7,8 @@ require 'user_info'
|
||||||
# load omniauth strategies with database lookups api keys at runtime
|
# load omniauth strategies with database lookups api keys at runtime
|
||||||
require 'twitter_database'
|
require 'twitter_database'
|
||||||
require 'facebook_database'
|
require 'facebook_database'
|
||||||
|
require 'linked_in_database'
|
||||||
|
require 'google_oauth2_database'
|
||||||
|
|
||||||
# Initialize the rails application
|
# Initialize the rails application
|
||||||
Zammad::Application.initialize!
|
Zammad::Application.initialize!
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
Rails.application.config.middleware.use OmniAuth::Builder do
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
|
|
||||||
# twitter database connect
|
# twitter database connect
|
||||||
provider :twitter_database, 'xx', 'xx',
|
provider :twitter_database, 'not_change_will_be_set_by_databse', 'not_change_will_be_set_by_databse',
|
||||||
:client_options => { :authorize_path => '/oauth/authorize', :site => 'https://api.twitter.com' }
|
:client_options => { :authorize_path => '/oauth/authorize', :site => 'https://api.twitter.com' }
|
||||||
|
|
||||||
# facebook database connect
|
# facebook database connect
|
||||||
provider :facebook_database, 'xx', 'xx'
|
provider :facebook_database, 'not_change_will_be_set_by_databse', 'not_change_will_be_set_by_databse'
|
||||||
|
|
||||||
# linkedin database connect
|
# linkedin database connect
|
||||||
# provider :linked_in_database, 'xx', 'xx'
|
provider :linked_in_database, 'not_change_will_be_set_by_databse', 'not_change_will_be_set_by_databse'
|
||||||
|
|
||||||
|
# google database connect
|
||||||
|
provider :google_oauth2_database, 'not_change_will_be_set_by_databse', 'not_change_will_be_set_by_databse',
|
||||||
|
:authorize_options => { :access_type => 'online', :approval_prompt => '' }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
272
db/seeds.rb
272
db/seeds.rb
|
@ -157,16 +157,16 @@ Setting.create(
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'user_create_account',
|
:name => 'user_create_account',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
1 => 'yes',
|
true => 'yes',
|
||||||
0 => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 1,
|
:value => true,
|
||||||
},
|
},
|
||||||
:frontend => true
|
:frontend => true
|
||||||
)
|
)
|
||||||
|
@ -181,16 +181,16 @@ Setting.create(
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'user_lost_password',
|
:name => 'user_lost_password',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
1 => 'yes',
|
true => 'yes',
|
||||||
0 => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 1,
|
:value => true,
|
||||||
},
|
},
|
||||||
:frontend => true
|
:frontend => true
|
||||||
)
|
)
|
||||||
|
@ -205,18 +205,18 @@ Setting.create(
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'switch_to_user',
|
:name => 'switch_to_user',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
1 => 'yes',
|
true => 'yes',
|
||||||
0 => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 0,
|
:value => false,
|
||||||
},
|
},
|
||||||
:frontend => true
|
:frontend => true
|
||||||
)
|
)
|
||||||
Setting.create(
|
Setting.create(
|
||||||
:title => 'Autentication via Database',
|
:title => 'Autentication via Database',
|
||||||
|
@ -229,18 +229,18 @@ Setting.create(
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'auth_db',
|
:name => 'auth_db',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
1 => 'yes',
|
true => 'yes',
|
||||||
0 => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 1,
|
:value => true,
|
||||||
},
|
},
|
||||||
:frontend => true
|
:frontend => true
|
||||||
)
|
)
|
||||||
Setting.create(
|
Setting.create(
|
||||||
:title => 'Autentication via Twitter',
|
:title => 'Autentication via Twitter',
|
||||||
|
@ -253,7 +253,7 @@ Setting.create(
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'auth_twitter',
|
:name => 'auth_twitter',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
|
@ -303,7 +303,7 @@ Setting.create(
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'auth_facebook',
|
:name => 'auth_facebook',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
|
@ -343,6 +343,58 @@ Setting.create(
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Setting.create(
|
||||||
|
:title => 'Autentication via Google',
|
||||||
|
:name => 'auth_google_oauth2',
|
||||||
|
:area => 'Security::Authentication',
|
||||||
|
:description => 'Enables user authentication via Google.',
|
||||||
|
:options => {
|
||||||
|
:form => [
|
||||||
|
{
|
||||||
|
:display => '',
|
||||||
|
:null => true,
|
||||||
|
:name => 'auth_google_oauth2',
|
||||||
|
:tag => 'boolean',
|
||||||
|
:options => {
|
||||||
|
true => 'yes',
|
||||||
|
false => 'no',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
:state => {
|
||||||
|
:value => false,
|
||||||
|
},
|
||||||
|
:frontend => true
|
||||||
|
)
|
||||||
|
Setting.create(
|
||||||
|
:title => 'Google App Credentials',
|
||||||
|
:name => 'auth_google_oauth2_credentials',
|
||||||
|
:area => 'Security::Authentication',
|
||||||
|
:description => 'Enables user authentication via Google.',
|
||||||
|
:options => {
|
||||||
|
:form => [
|
||||||
|
{
|
||||||
|
:display => 'Client ID',
|
||||||
|
:null => true,
|
||||||
|
:name => 'client_id',
|
||||||
|
:tag => 'input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
:display => 'Client Secret',
|
||||||
|
:null => true,
|
||||||
|
:name => 'client_secret',
|
||||||
|
:tag => 'input',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
:state => {
|
||||||
|
:value => {},
|
||||||
|
},
|
||||||
|
:frontend => false
|
||||||
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
:title => 'Autentication via LinkedIn',
|
:title => 'Autentication via LinkedIn',
|
||||||
:name => 'auth_linkedin',
|
:name => 'auth_linkedin',
|
||||||
|
@ -354,8 +406,8 @@ Setting.create(
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'auth_linkedin',
|
:name => 'auth_linkedin',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
|
@ -638,17 +690,17 @@ Setting.create(
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'ticket_number',
|
:name => 'ticket_number',
|
||||||
:tag => 'select',
|
:tag => 'select',
|
||||||
:options => {
|
:options => {
|
||||||
'increment' => 'Increment (SystemID.Counter)',
|
'increment' => 'Increment (SystemID.Counter)',
|
||||||
'date' => 'Date (Year.Month.Day.SystemID.Counter)',
|
'date' => 'Date (Year.Month.Day.SystemID.Counter)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 'increment',
|
:value => 'increment',
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
Setting.create(
|
Setting.create(
|
||||||
:title => 'Ticket Number Increment',
|
:title => 'Ticket Number Increment',
|
||||||
|
@ -658,21 +710,21 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => 'Checksum',
|
:display => 'Checksum',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'checksum',
|
:name => 'checksum',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:display => 'Min. size of number',
|
:display => 'Min. size of number',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'min_size',
|
:name => 'min_size',
|
||||||
:tag => 'select',
|
:tag => 'select',
|
||||||
:options => {
|
:options => {
|
||||||
1 => 1,
|
1 => 1,
|
||||||
2 => 2,
|
2 => 2,
|
||||||
3 => 3,
|
3 => 3,
|
||||||
|
@ -696,21 +748,21 @@ Setting.create(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:display => 'Logfile',
|
:display => 'Logfile',
|
||||||
:null => false,
|
:null => false,
|
||||||
:name => 'file',
|
:name => 'file',
|
||||||
:tag => 'input',
|
:tag => 'input',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => {
|
:value => {
|
||||||
:checksum => false,
|
:checksum => false,
|
||||||
:file => '/tmp/counter.log',
|
:file => '/tmp/counter.log',
|
||||||
:min_size => 5,
|
:min_size => 5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
Setting.create(
|
Setting.create(
|
||||||
:title => 'Ticket Number Increment Date',
|
:title => 'Ticket Number Increment Date',
|
||||||
|
@ -720,30 +772,30 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => 'Checksum',
|
:display => 'Checksum',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'checksum',
|
:name => 'checksum',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:display => 'Logfile',
|
:display => 'Logfile',
|
||||||
:null => false,
|
:null => false,
|
||||||
:name => 'file',
|
:name => 'file',
|
||||||
:tag => 'input',
|
:tag => 'input',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => {
|
:value => {
|
||||||
:checksum => false,
|
:checksum => false,
|
||||||
:file => '/tmp/counter.log',
|
:file => '/tmp/counter.log',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -765,10 +817,10 @@ Setting.create(
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 'SystemAddressName',
|
:value => 'SystemAddressName',
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -779,17 +831,17 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => false,
|
:null => false,
|
||||||
:name => 'ticket_define_email_from_seperator',
|
:name => 'ticket_define_email_from_seperator',
|
||||||
:tag => 'input',
|
:tag => 'input',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 'via',
|
:value => 'via',
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -800,21 +852,21 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'customer_ticket_create',
|
:name => 'customer_ticket_create',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => true,
|
:value => true,
|
||||||
},
|
},
|
||||||
:frontend => true
|
:frontend => true
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -825,11 +877,11 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'customer_ticket_view',
|
:name => 'customer_ticket_view',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
|
@ -879,10 +931,10 @@ Setting.create(
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 10,
|
:value => 10,
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -893,11 +945,11 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'postmaster_follow_up_search_in',
|
:name => 'postmaster_follow_up_search_in',
|
||||||
:tag => 'checkbox',
|
:tag => 'checkbox',
|
||||||
:options => {
|
:options => {
|
||||||
'references' => 'References',
|
'references' => 'References',
|
||||||
'body' => 'Body',
|
'body' => 'Body',
|
||||||
'attachment' => 'Attachment',
|
'attachment' => 'Attachment',
|
||||||
|
@ -906,10 +958,10 @@ Setting.create(
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => ['subject'],
|
:value => ['subject'],
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -920,17 +972,17 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => false,
|
:null => false,
|
||||||
:name => 'notification_sender',
|
:name => 'notification_sender',
|
||||||
:tag => 'input',
|
:tag => 'input',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 'Notification Master <noreply@#{config.fqdn}>',
|
:value => 'Notification Master <noreply@#{config.fqdn}>',
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -941,17 +993,17 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => false,
|
:null => false,
|
||||||
:name => 'system_sender',
|
:name => 'system_sender',
|
||||||
:tag => 'input',
|
:tag => 'input',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => 'Zammad Team <zammad@#{config.fqdn}>',
|
:value => 'Zammad Team <zammad@#{config.fqdn}>',
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
Setting.create(
|
Setting.create(
|
||||||
:title => 'Block Notifications',
|
:title => 'Block Notifications',
|
||||||
|
@ -961,17 +1013,17 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => false,
|
:null => false,
|
||||||
:name => 'send_no_auto_response_reg_exp',
|
:name => 'send_no_auto_response_reg_exp',
|
||||||
:tag => 'input',
|
:tag => 'input',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => '(MAILER-DAEMON|postmaster|abuse)@.+?\..+?',
|
:value => '(MAILER-DAEMON|postmaster|abuse)@.+?\..+?',
|
||||||
},
|
},
|
||||||
:frontend => false
|
:frontend => false
|
||||||
)
|
)
|
||||||
|
|
||||||
Setting.create(
|
Setting.create(
|
||||||
|
@ -982,21 +1034,21 @@ Setting.create(
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
:display => '',
|
:display => '',
|
||||||
:null => true,
|
:null => true,
|
||||||
:name => 'chat',
|
:name => 'chat',
|
||||||
:tag => 'select',
|
:tag => 'boolean',
|
||||||
:options => {
|
:options => {
|
||||||
true => 'yes',
|
true => 'yes',
|
||||||
false => 'no',
|
false => 'no',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
:state => {
|
:state => {
|
||||||
:value => false,
|
:value => false,
|
||||||
},
|
},
|
||||||
:frontend => true
|
:frontend => true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
20
lib/google_oauth2_database.rb
Normal file
20
lib/google_oauth2_database.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
module OmniAuth
|
||||||
|
module Strategies
|
||||||
|
|
||||||
|
class GoogleOauth2Database < OmniAuth::Strategies::GoogleOauth2
|
||||||
|
option :name, 'google_oauth2'
|
||||||
|
|
||||||
|
def initialize(app, *args, &block)
|
||||||
|
|
||||||
|
# database lookup
|
||||||
|
puts 'GoogleOauth2Database -> initialize'
|
||||||
|
config = Setting.get('auth_google_oauth2_credentials') || {}
|
||||||
|
args[0] = config['client_id']
|
||||||
|
args[1] = config['client_secret']
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
20
lib/linked_in_database.rb
Normal file
20
lib/linked_in_database.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
module OmniAuth
|
||||||
|
module Strategies
|
||||||
|
|
||||||
|
class LinkedInDatabase < OmniAuth::Strategies::LinkedIn
|
||||||
|
option :name, 'linkedin'
|
||||||
|
|
||||||
|
def initialize(app, *args, &block)
|
||||||
|
|
||||||
|
# database lookup
|
||||||
|
puts 'LinkedInDatabase -> initialize'
|
||||||
|
config = Setting.get('auth_linkedin_credentials') || {}
|
||||||
|
args[0] = config['app_id']
|
||||||
|
args[1] = config['app_secret']
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue