mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
Hide endpoint to Sunstone prying users
This commit is contained in:
parent
8dbf56363b
commit
a3822c4487
@ -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(){
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user