1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-10 01:17:40 +03:00

Feature #795: Added special x509 sunstone login screen.

Does not show username field and password field.
(cherry picked from commit 015df5c95648680d225fc7f5e6683fdade48c7c5)
This commit is contained in:
Hector Sanjuan 2011-09-23 11:20:19 +02:00 committed by Daniel Molina
parent c00ecba9ab
commit b9c86afd38
3 changed files with 56 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -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
##############################################################################

View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenNebula Sunstone Login</title>
<link rel="stylesheet" type="text/css" href="css/login.css" />
<!-- Vendor Libraries -->
<script type="text/javascript" src="vendor/jQuery/jquery-1.4.4.min.js"></script>
<!-- End Vendor Libraries -->
<script type="text/javascript" src="js/opennebula.js"></script>
<script type="text/javascript" src="js/login.js"></script>
</head>
<body>
<div id="header">
<div id="logo">
The OpenNebula Cloud Operations Center
</div>
</div>
<div id="wrapper">
<div id="logo_sunstone">
</div>
<div id="auth_error" class="error_message">
Invalid username or password
</div>
<div id="one_error" class="error_message">
OpenNebula is not running
</div>
<form id="login_form">
<div class="border" id="login" style='height:169px;background:url("../images/panel_short.png") no-repeat scroll center transparent'>
<div class="content">
<input style="float:left;" type="submit" id="login_btn" value="" />
<input type="checkbox" id="check_remember" />
<label id="label_remember" for="check_remember">Remember me</label>
</div>
</div>
</form>
</div>
</body>
</html>