diff options
Diffstat (limited to 'lib/mauve/web_interface.rb')
-rw-r--r-- | lib/mauve/web_interface.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/mauve/web_interface.rb b/lib/mauve/web_interface.rb index 4bb9517..9369ee3 100644 --- a/lib/mauve/web_interface.rb +++ b/lib/mauve/web_interface.rb @@ -103,11 +103,12 @@ EOF # Uh-oh.. Intruder alert! # ok_urls = %w(/ /login /logout) + no_redirect_urls = %w(/ajax) unless ok_urls.include?(request.path_info) flash['error'] = "You must be logged in to access that page." status 403 - redirect "/login?next_page=#{request.path_info}" + redirect "/login?next_page=#{request.path_info}" unless no_redirect_urls.any?{|u| /^#{u}/ =~ request.path_info } end end end @@ -230,7 +231,7 @@ EOF end end - flash["errors"] = "Failed to acknowledge #{failed.length} alerts." if failed.length > 0 + flash["error"] = "Failed to acknowledge #{failed.length} alerts." if failed.length > 0 flash["notice"] = "Successfully acknowledged #{succeeded.length} alerts" if succeeded.length > 0 redirect "/alerts/raised" @@ -267,7 +268,6 @@ EOF get '/ajax/time_to_s_human/:seconds' do content_type :text - secs = params[:seconds].to_i Time.at(secs).to_s_human end |