1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-24 21:34:01 +03:00

Feature #2505: Possibility to customize the Sunstone display name

This commit is contained in:
Jaime Melis 2013-11-27 13:23:26 +01:00
parent 5a8eb83263
commit e4bc95e559
3 changed files with 16 additions and 11 deletions

View File

@ -478,7 +478,7 @@ function setLogin(){
};
var user_login_content = '<div href="#" class="button tiny secondary dropdown" id="logout">\
<i class="icon-user header-icon"></i> '+ decodeURIComponent(username) + '\
<i class="icon-user header-icon"></i> '+ config['display_name'] + '\
<ul>\
<li><a href="#" class="configuration"><i class="icon-cog"></i> Settings</a></li>\
<li><a href="#" class="logout"><i class="icon-off"></i> Sign Out</a></li>\

View File

@ -48,6 +48,8 @@ $: << SUNSTONE_ROOT_DIR+'/models'
SESSION_EXPIRE_TIME = 60*60
DISPLAY_NAME_XPATH = 'TEMPLATE/SUNSTONE_DISPLAY_NAME'
##############################################################################
# Required libraries
##############################################################################
@ -159,12 +161,13 @@ helpers do
return [500, ""]
end
session[:user] = user['NAME']
session[:user_id] = user['ID']
session[:user_gid] = user['GID']
session[:user_gname] = user['GNAME']
session[:ip] = request.ip
session[:remember] = params[:remember]
session[:user] = user['NAME']
session[:user_id] = user['ID']
session[:user_gid] = user['GID']
session[:user_gname] = user['GNAME']
session[:ip] = request.ip
session[:remember] = params[:remember]
session[:display_name] = user[DISPLAY_NAME_XPATH] || user['NAME']
#User IU options initialization
#Load options either from user settings or default config.
@ -324,10 +327,11 @@ post '/config' do
error 500, ""
end
session[:lang] = user['TEMPLATE/LANG']
session[:vnc_wss] = user['TEMPLATE/VNC_WSS']
session[:lang] = user['TEMPLATE/LANG']
session[:vnc_wss] = user['TEMPLATE/VNC_WSS']
session[:default_view] = user['TEMPLATE/DEFAULT_VIEW']
session[:table_order] = user['TEMPLATE/TABLE_ORDER']
session[:table_order] = user['TEMPLATE/TABLE_ORDER']
session[:display_name] = user[DISPLAY_NAME_XPATH] || user['NAME']
[200, ""]
end

View File

@ -56,7 +56,8 @@
'vnc_proxy_port' : '<%= $vnc.proxy_port %>'
},
'view' : view,
'available_views' : available_views
'available_views' : available_views,
'display_name' : '<%= session[:display_name] %>'
};