Since 2016-10-15 a redirect to a signup page has been implemented.

This commit is contained in:
Martin Edenhofer 2016-10-15 04:31:15 +02:00
parent dfdfb15d43
commit f5de9086b7

View file

@ -23,7 +23,7 @@ class ImportZendeskController < ApplicationController
'Connection refused' => 'Connection refused!', 'Connection refused' => 'Connection refused!',
} }
response = UserAgent.request( params[:url] ) response = UserAgent.request(params[:url])
if !response.success? if !response.success?
message_human = '' message_human = ''
@ -40,6 +40,15 @@ class ImportZendeskController < ApplicationController
return return
end end
# since 2016-10-15 a redirect to a signup page has been implemented
if response.body =~ /(Take it for a risk-free|Take it for a risk-free)/i
render json: {
result: 'invalid',
message_human: 'Hostname not found!',
}
return
end
Setting.set('import_zendesk_endpoint', "#{params[:url]}api/v2") Setting.set('import_zendesk_endpoint', "#{params[:url]}api/v2")
render json: { render json: {