Fixed several small bugs.

This commit is contained in:
Martin Edenhofer 2014-11-17 11:35:36 +01:00
parent 4557979d6f
commit 851f0ef912
4 changed files with 38 additions and 33 deletions

View file

@ -143,11 +143,6 @@ class Admin extends App.ControllerContent
} }
) )
@Config.set('system_init_done', true) @Config.set('system_init_done', true)
App.Event.trigger 'notify', {
type: 'success'
msg: App.i18n.translateContent( 'Welcome to %s!', @Config.get('product_name') )
timeout: 2500
}
fail: (data) => fail: (data) =>
@formEnable(e) @formEnable(e)
@ -540,7 +535,7 @@ class ChannelEmail extends App.ControllerContent
@enable(e) @enable(e)
) )
verify: (account) => verify: (account, count = 0) =>
@showSlide('js-verify') @showSlide('js-verify')
@hideAlert('js-verify') @hideAlert('js-verify')
@ -555,7 +550,14 @@ class ChannelEmail extends App.ControllerContent
if data.result is 'ok' if data.result is 'ok'
@navigate 'getting_started/agents' @navigate 'getting_started/agents'
else else
@showAlert('js-verify', data.message_human || data.message ) if count is 1
@showAlert('js-verify', data.message_human || data.message )
@delay(
=> @showSlide('js-inbound')
2300
)
else
@verify( @account, count + 1 )
@enable(e) @enable(e)
fail: => fail: =>
@enable(e) @enable(e)

View file

@ -8,10 +8,10 @@
<div class="wizard-buttonList vertical"> <div class="wizard-buttonList vertical">
<% for adapter in @adapters: %> <% for adapter in @adapters: %>
<div class="btn auth_provider auth_provider--wide <%= adapter.class %>"> <a href="<%= adapter.link %>" class="btn auth_provider auth_provider--wide <%= adapter.class %>">
<div class="<%= adapter.class %> provider_icon"></div> <div class="<%= adapter.class %> provider_icon"></div>
<a class="provider_name" href="<%= adapter.link %>"><%- @T( adapter.name ) %></a> <div class="provider_name"><%- @T( adapter.name ) %></div>
</div> </a>
<% end %> <% end %>
</div> </div>

View file

@ -198,7 +198,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
# probe inbound # probe inbound
result = email_probe_inbound( settings[:inbound] ) result = email_probe_inbound( settings[:inbound] )
if !result if result[:result] != 'ok'
render :json => result render :json => result
return return
end end
@ -355,7 +355,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
puts "PROBE: #{config.inspect}" puts "PROBE: #{config.inspect}"
result = email_probe_inbound( config ) result = email_probe_inbound( config )
puts "RESULT: #{result.inspect}" puts "RESULT: #{result.inspect}"
if !result if result[:result] == 'ok'
success = true success = true
settings[:inbound] = config settings[:inbound] = config
break break
@ -539,14 +539,9 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
# connection test # connection test
result = email_probe_outbound( params, params[:email] ) result = email_probe_outbound( params, params[:email] )
if result[:result] != 'ok'
render :json => result
return
end
# return result
render :json => { render :json => {
:result => 'ok', :result => result
} }
end end
@ -565,14 +560,9 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
# connection test # connection test
result = email_probe_inbound( params ) result = email_probe_inbound( params )
if result
render :json => result
return
end
render :json => { render :json => result
:result => 'ok', return
}
end end
def email_verify def email_verify
@ -683,10 +673,10 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
# test connection # test connection
translationMap = { translationMap = {
'authentication failed' => 'Authentication failed!', 'authentication failed' => 'Authentication failed!',
'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!', 'getaddrinfo: nodename nor servname provided, or not known' => 'Hostname not found!',
'No route to host' => 'No route to host!', 'No route to host' => 'No route to host!',
'Connection refused' => 'Connection refused!', 'Connection refused' => 'Connection refused!',
} }
if params[:adapter] == 'smtp' if params[:adapter] == 'smtp'
begin begin
@ -711,6 +701,7 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
if e.message =~ /#{Regexp.escape(key)}/i if e.message =~ /#{Regexp.escape(key)}/i
result = { result = {
:result => 'ok', :result => 'ok',
:notice => e.message,
} }
return result return result
end end
@ -728,7 +719,10 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
} }
return result return result
end end
return result = {
:result => 'ok',
}
return result
end end
begin begin
@ -755,7 +749,10 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
} }
return result return result
end end
return result = {
:result => 'ok',
}
return result
end end
def email_probe_inbound(params) def email_probe_inbound(params)
@ -789,7 +786,10 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
} }
return result return result
end end
return result = {
:result => 'ok',
}
return result
end end
begin begin
@ -808,7 +808,10 @@ curl http://localhost/api/v1/getting_started -v -u #{login}:#{password}
} }
return result return result
end end
return result = {
:result => 'ok',
}
return result
end end
def mxers(domain) def mxers(domain)

View file

@ -49,7 +49,7 @@ Setting.create_if_not_exists(
}, },
], ],
}, },
:state => 'Example Inc.', :state => '',
:frontend => true :frontend => true
) )