1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

Merge branch 'master' of git.opennebula.org:faf-71

This commit is contained in:
Carlos Martín 2014-01-23 15:49:35 +01:00
commit c807eba49d
2 changed files with 16 additions and 13 deletions

View File

@ -443,7 +443,7 @@ $(document).ready(function(){
timeout: true,
success: function (request, obj_list){
$.each(obj_list,function(){
$('.zone-ul').append('<li><a id="'+this.ZONE.TEMPLATE.ENDPOINT+'" class="zone-choice '+this.ZONE.NAME+'"><i class="icon-home"></i> '+this.ZONE.NAME+'</a></li>');
$('.zone-ul').append('<li><a id="'+this.ZONE.NAME+'" class="zone-choice"><i class="icon-home"></i> '+this.ZONE.NAME+'</a></li>');
});
},
error: onError
@ -454,8 +454,7 @@ $(document).ready(function(){
url: 'config',
type: "HEAD",
headers: {
"ZONE_ENDPOINT": this.id,
"ZONE_NAME" : this.className.split(" ")[1]
"ZONE_NAME" : this.id
},
dataType: "json",
success: function(){

View File

@ -224,18 +224,22 @@ 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'] && env['HTTP_ZONE_ENDPOINT'].to_i == -1
session.delete(:active_zone_endpoint)
end
# Extra check: Retrieve list
if env['HTTP_ZONE_NAME']
session[:zone_name] = env['HTTP_ZONE_NAME']
client=$cloud_auth.client(session[:user])
zpool = ZonePoolJSON.new(client)
rc = zpool.info
return [500, rc.to_json] if OpenNebula.is_error?(rc)
zpool.each{|z|
if z['TEMPLATE/ENDPOINT'] == env['HTTP_ZONE_NAME']
session[:active_zone_endpoint] = z['TEMPLATE/ENDPOINT']
end
}
end
end