Fixed issue #462 - Setup asks for FQDN, but doesn't write to DB.
This commit is contained in:
parent
62af5fb2ca
commit
1af073b4e8
1 changed files with 13 additions and 17 deletions
|
@ -114,22 +114,33 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
|
|
||||||
# validate url
|
# validate url
|
||||||
messages = {}
|
messages = {}
|
||||||
|
settings = {}
|
||||||
if !Setting.get('system_online_service')
|
if !Setting.get('system_online_service')
|
||||||
if !params[:url] || params[:url] !~ %r{^(http|https)://.+?$}
|
if !params[:url] || params[:url] !~ %r{^(http|https)://.+?$}
|
||||||
messages[:url] = 'A URL looks like http://zammad.example.com'
|
messages[:url] = 'A URL looks like http://zammad.example.com'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# split url in http_type and fqdn
|
||||||
|
if params[:url]
|
||||||
|
if params[:url] =~ %r{^(http|https)://(.+?)(:.+?|/.+?|)$}
|
||||||
|
settings[:http_type] = $1
|
||||||
|
settings[:fqdn] = $2
|
||||||
|
else
|
||||||
|
messages[:url] = 'A URL looks like http://zammad.example.com'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# validate organization
|
# validate organization
|
||||||
if !params[:organization] || params[:organization].empty?
|
if !params[:organization] || params[:organization].empty?
|
||||||
messages[:organization] = 'Invalid!'
|
messages[:organization] = 'Invalid!'
|
||||||
|
else
|
||||||
|
settings[:organization] = params[:organization]
|
||||||
end
|
end
|
||||||
|
|
||||||
# validate image
|
# validate image
|
||||||
if params[:logo] && params[:logo] =~ /^data:image/i
|
if params[:logo] && params[:logo] =~ /^data:image/i
|
||||||
|
|
||||||
file = StaticAssets.data_url_attributes(params[:logo])
|
file = StaticAssets.data_url_attributes(params[:logo])
|
||||||
|
|
||||||
if !file[:content] || !file[:mime_type]
|
if !file[:content] || !file[:mime_type]
|
||||||
messages[:logo] = 'Unable to process image upload.'
|
messages[:logo] = 'Unable to process image upload.'
|
||||||
end
|
end
|
||||||
|
@ -143,21 +154,6 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
# split url in http_type and fqdn
|
|
||||||
settings = {}
|
|
||||||
if !Setting.get('system_online_service')
|
|
||||||
if params[:url] =~ %r{/^(http|https)://(.+?)(:.+?|/.+?|)$}
|
|
||||||
Setting.set('http_type', $1)
|
|
||||||
settings[:http_type] = $1
|
|
||||||
Setting.set('fqdn', $2)
|
|
||||||
settings[:fqdn] = $2
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# save organization
|
|
||||||
Setting.set('organization', params[:organization])
|
|
||||||
settings[:organization] = params[:organization]
|
|
||||||
|
|
||||||
# save image
|
# save image
|
||||||
if params[:logo] && params[:logo] =~ /^data:image/i
|
if params[:logo] && params[:logo] =~ /^data:image/i
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue