]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7761 Restore error in login page when not even privilege
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 20 Jul 2016 06:48:10 +0000 (08:48 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 20 Jul 2016 10:31:11 +0000 (12:31 +0200)
server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb

index 4495fffa997fc709b34ac21fa9a9025909b2416b..3cb6a3187e018694849812d5d8f8055a373a87e0 100644 (file)
 <form id="login_form" action="<%= ApplicationController.root_context -%>/api/authentication/login" method="post">
   <input type="hidden" name="return_to_anchor" value="<%= h @return_to_anchor %>">
 
-  <div class="alert alert-danger hidden"><%= message('session.flash_notice.authentication_failed') %></div>
+  <div class="alert alert-danger alert-authentication-failed hidden"><%= message('session.flash_notice.authentication_failed') %></div>
+  <% if flash[:loginerror] %>
+    <div class="alert alert-danger alert-flash"> <%= flash[:loginerror] %></div>
+  <% end %>
+  <% if flash[:notice] %>
+    <div class="alert alert-info alert-flash"><%= flash[:notice] %></div>
+  <% end %>
 
   <div class="big-spacer-bottom">
     <label for="login" class="login-label"><%= message('login') %></label>
@@ -62,7 +68,8 @@
         window.location = '<%= h(@return_to) -%>' + $('[name="return_to_anchor"]').val();
       },
       error: function () {
-        $('.alert').removeClass('hidden');
+        $('.alert-flash').addClass('hidden');
+        $('.alert-authentication-failed').removeClass('hidden');
         $('button').prop('disabled', false);
       },
       statusCode: {