diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 95f6a7d19c..a2c282d8e8 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -452,7 +452,7 @@ $(document).ready(function(){ $('a.zone-choice').live("click", function(){ $.ajax({ url: 'config', - type: "POST", + type: "HEAD", headers: { "ZONE_ENDPOINT": this.id, "ZONE_NAME" : this.className.split(" ")[1] diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index e9fae24e6b..73e1d73bbe 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -224,26 +224,25 @@ before do unless request.path=='/login' || request.path=='/' || request.path=='/vnc' halt 401 unless authorized? + # Extra check: Retrieve list + if env['HTTP_ZONE_ENDPOINT'] session[:active_zone_endpoint] = env['HTTP_ZONE_ENDPOINT'] end - if env['HTTP_ZONE_ENDPOINT'] and env['HTTP_ZONE_ENDPOINT'].to_i == -1 + if env['HTTP_ZONE_ENDPOINT'] && env['HTTP_ZONE_ENDPOINT'].to_i == -1 session.delete(:active_zone_endpoint) end if env['HTTP_ZONE_NAME'] session[:zone_name] = env['HTTP_ZONE_NAME'] end - - client=$cloud_auth.client(session[:user], - session[:active_zone_endpoint]) end - @SunstoneServer = SunstoneServer.new( - client, - $conf, - logger) + client=$cloud_auth.client(session[:user], + session[:active_zone_endpoint]) + + @SunstoneServer = SunstoneServer.new(client,$conf,logger) end after do