]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Localisation updates from http://translatewiki.net.
[rails.git] / app / controllers / user_controller.rb
index d89d483f2a72ab5f490a469307cff9daf33accaf..a7822e47fd436188d703fe55493482d9649a92cb 100644 (file)
@@ -86,13 +86,20 @@ class UserController < ApplicationController
         @user.openid_url = nil if @user.openid_url and @user.openid_url.empty?
 
         if @user.save
-          flash[:piwik_goal] = PIWIK_SIGNUP_GOAL if defined?(PIWIK_SIGNUP_GOAL)
+          flash[:piwik_goal] = PIWIK["goals"]["signup"] if defined?(PIWIK)
+
+          referer = welcome_path
 
           begin
-            referer_params = Rack::Utils.parse_query(URI(session[:referer]).query)
-            referer = welcome_path(referer_params.slice(:lat, :lon, :zoom, :editor))
+            uri = URI(session[:referer])
+            /map=(.*)\/(.*)\/(.*)/.match(uri.fragment) do |m|
+              editor = Rack::Utils.parse_query(uri.query).slice('editor')
+              referer = welcome_path({'zoom' => m[1],
+                                      'lat' => m[2],
+                                      'lon' => m[3]}.merge(editor))
+            end
           rescue
-            referer = welcome_path
+            # Use default
           end
 
           if @user.status == "active"