]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Switch to using the rails-i18n-updater gem instead of the rails-i18n plugin
[rails.git] / app / controllers / application_controller.rb
index 655017847b81c34d200aac05d707d204de0c017e..904388b9d8959193267c2ff08adc49083f6dd663 100644 (file)
@@ -1,7 +1,7 @@
-# Filters added to this controller will be run for all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
 class ApplicationController < ActionController::Base
 
+  protect_from_forgery
+
   if STATUS == :database_readonly or STATUS == :database_offline
     session :off
 
@@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base
         if params[:referer]
           redirect_to :controller => "user", :action => "terms", :referer => params[:referer]
         else
-          redirect_to :controller => "user", :action => "terms", :referer => request.request_uri
+          redirect_to :controller => "user", :action => "terms", :referer => request.fullpath
         end
       end
     elsif session[:token]
@@ -39,7 +39,7 @@ class ApplicationController < ActionController::Base
   end
 
   def require_user
-    redirect_to :controller => 'user', :action => 'login', :referer => request.request_uri unless @user
+    redirect_to :controller => 'user', :action => 'login', :referer => request.fullpath unless @user
   end
 
   ##