]> git.openstreetmap.org Git - rails.git/blob - app/controllers/site_controller.rb
It was not possible to remove an OpenID from your user profile
[rails.git] / app / controllers / site_controller.rb
1 class SiteController < ApplicationController
2   layout 'site', :except => [:key, :permalink]
3
4   before_filter :authorize_web
5   before_filter :set_locale
6   before_filter :require_user, :only => [:edit]
7
8   def export
9     render :action => 'index'
10   end
11
12   def permalink
13     lon, lat, zoom = ShortLink::decode(params[:code])
14     new_params = params.clone
15     new_params.delete :code
16     if new_params.has_key? :m
17       new_params.delete :m
18       new_params[:mlat] = lat
19       new_params[:mlon] = lon
20     else
21       new_params[:lat] = lat
22       new_params[:lon] = lon
23     end
24     new_params[:zoom] = zoom
25     new_params[:controller] = 'site'
26     new_params[:action] = 'index'
27     redirect_to new_params
28   end
29
30   def key
31     expires_in 7.days, :public => true
32   end
33 end