mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-24 21:34:01 +03:00
bug #847: Fixes minor bugs in suntone-server
This commit is contained in:
parent
4f8a1c2f9d
commit
0e822f4035
@ -81,8 +81,7 @@ class CloudAuth
|
||||
def expiration_time
|
||||
time_now = Time.now.to_i
|
||||
|
||||
expire = time_now - @token_expiration_time
|
||||
if expire < EXPIRE_MARGIN
|
||||
if time_now > @token_expiration_time - EXPIRE_MARGIN
|
||||
@token_expiration_time = time_now + @token_expiration_delta
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,13 @@
|
||||
:host: 127.0.0.1
|
||||
:port: 9869
|
||||
|
||||
:auth: basic
|
||||
# Authentication driver for incomming requests
|
||||
:auth: sunstone
|
||||
|
||||
# Authentication driver to communicate with OpenNebula core
|
||||
:core_auth: cipher
|
||||
# Life-time in seconds for token renewal (that used to handle OpenNebula auths)
|
||||
:token_expiration_delta: 1800
|
||||
|
||||
# VNC Configuration
|
||||
:vnc_proxy_base_port: 29876
|
||||
|
@ -143,7 +143,12 @@ end
|
||||
##############################################################################
|
||||
get '/' do
|
||||
if !authorized?
|
||||
templ = settings.config[:auth]=="basic"? "login.html" : "login_x509.html"
|
||||
if settings.config[:auth] == "x509"
|
||||
templ = "login_x509.html"
|
||||
else
|
||||
templ = "login.html"
|
||||
end
|
||||
|
||||
return File.read(File.dirname(__FILE__)+'/templates/'+templ)
|
||||
end
|
||||
time = Time.now + 60
|
||||
@ -165,7 +170,12 @@ end
|
||||
|
||||
get '/login' do
|
||||
if !authorized?
|
||||
templ = settings.config[:auth]=="basic"? "login.html" : "login_x509.html"
|
||||
if settings.config[:auth] == "x509"
|
||||
templ = "login_x509.html"
|
||||
else
|
||||
templ = "login.html"
|
||||
end
|
||||
|
||||
return File.read(File.dirname(__FILE__)+'/templates/'+templ)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user