diff --git a/src/sunstone/public/images/panel_short.png b/src/sunstone/public/images/panel_short.png new file mode 100644 index 0000000000..2eb300fe1f Binary files /dev/null and b/src/sunstone/public/images/panel_short.png differ diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 49e99f831b..e2bc06ab93 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -52,13 +52,12 @@ require 'SunstonePlugins' begin conf = YAML.load_file(CONFIGURATION_FILE) + conf[:hash_passwords] = true rescue Exception => e puts "Error parsing config file #{CONFIGURATION_FILE}: #{e.message}" exit 1 end -conf[:hash_passwords] = true - ############################################################################## # Sinatra Configuration ############################################################################## @@ -144,9 +143,10 @@ end # HTML Requests ############################################################################## get '/' do - return File.read(File.dirname(__FILE__)+ - '/templates/login.html') unless authorized? - + if !authorized? + templ = settings.config[:auth]=="basic"? "login.html" : "login_x509.html" + return File.read(File.dirname(__FILE__)+'/templates/'+templ) + end time = Time.now + 60 response.set_cookie("one-user", :value=>"#{session[:user]}", @@ -165,7 +165,10 @@ get '/' do end get '/login' do - File.read(SUNSTONE_ROOT_DIR+'/templates/login.html') + if !authorized? + templ = settings.confing[:auth]=="basic"? "login.html" : "login_x509.html" + return File.read(File.dirname(__FILE__)+'/templates/'+templ) + end end ############################################################################## diff --git a/src/sunstone/templates/login_x509.html b/src/sunstone/templates/login_x509.html new file mode 100644 index 0000000000..790e52028c --- /dev/null +++ b/src/sunstone/templates/login_x509.html @@ -0,0 +1,47 @@ + + + + OpenNebula Sunstone Login + + + + + + + + + + + + + + + +
+
+
+ +
+ Invalid username or password +
+
+ OpenNebula is not running +
+ +
+
+
+ + + + +
+
+
+
+ +