]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2132 redirect to original URI when user clicks on the link "Login"
authorsimonbrandhof <simon.brandhof@gmail.com>
Mon, 6 Feb 2012 22:48:35 +0000 (23:48 +0100)
committersimonbrandhof <simon.brandhof@gmail.com>
Mon, 6 Feb 2012 22:48:35 +0000 (23:48 +0100)
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/sessions_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb

index 1de49ac8c871c8489fa26d3c7c9fc2dec18d10c2..4a1e940aca189bb58d0a7620b96d4704c5895787 100644 (file)
@@ -342,7 +342,6 @@ sessions.new_account=Not a member? <a href="{0}" tabindex="-1">Sign up</a> for a
 sessions.confirm_password=Confirm password
 sessions.sign_up=Sign up
 sessions.old_account=<a href="{0}" tabindex="-1">Log in</a> if you already have an account.
-session.flash_notice.logged_in=Logged in.
 session.flash_notice.authentication_failed=Authentication failed.
 session.flash_notice.logged_out=You have been logged out.
 
index 2a05c51db591e1dfeebf08a31b6cc9a4f19268d6..81701fbc608b801eda6872aa9fc74e0aa37e3f31 100644 (file)
@@ -51,4 +51,12 @@ class SessionsController < ApplicationController
     reset_session
   end
 
+  def new
+    if params[:return_to]
+      # user clicked on the link "login" : redirect to the original uri after authentication
+      session[:return_to] = params[:return_to]
+    # else the original uri can be set by ApplicationController#access_denied
+    end
+  end
+
 end
index f14272916112a56156a8605e03c20267b4370987..5f9b38b33e61b8fae0ea48d7050c9906ebefc5f8 100644 (file)
@@ -23,7 +23,7 @@
           &raquo; <a href="<%= ApplicationController.root_context -%>/sessions/logout"><%= message('layout.logout') -%></a>
         </li>
       <% else %>
-        <li><a href="<%= ApplicationController.root_context -%>/sessions/new"><%= message('layout.login') -%></a></li>
+        <li><a href="<%= ApplicationController.root_context -%>/sessions/new?return_to=<%= u (request.request_uri) -%>"><%= message('layout.login') -%></a></li>
       <% end %>
       <li><a href="<%= ApplicationController.root_context -%>/profiles"><%= message('layout.configuration') -%></a></li>
     </ol>