]> git.openstreetmap.org Git - rails.git/commitdiff
Only Potlatch 1 needs a token to be created
authorTom Hughes <tom@compton.nu>
Sun, 14 Nov 2010 17:36:46 +0000 (17:36 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 29 Nov 2010 12:20:22 +0000 (12:20 +0000)
app/controllers/site_controller.rb
app/views/site/_potlatch.html.erb

index d08f34a0a29b0a2689e759c327b227896419f9a7..e6d09f18d787b3b1d436bda46ac21f76cb6defb1 100644 (file)
@@ -37,8 +37,6 @@ class SiteController < ApplicationController
     if editor == "josm"
       render :action => :index
     else
-      session[:token] = @user.tokens.create.token unless session[:token] and UserToken.find_by_token(session[:token])
-
       # Decide on a lat lon to initialise potlatch with. Various ways of doing this
       if params['lon'] and params['lat']
         @lon = params['lon'].to_f
index c255cef9124f863e30d2a56be9f2a4eb1e8bc7e0..68205b6ff459b93040a60714b8a9693c7d4728ed 100644 (file)
@@ -3,6 +3,9 @@
 </div>
 
 <%= javascript_include_tag 'swfobject.js' %>
+
+<% session[:token] = @user.tokens.create.token unless session[:token] and UserToken.find_by_token(session[:token]) %>
+
 <script type="text/javascript" defer="defer">
   var brokenContentSize = $("content").offsetWidth == 0;
   var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "100%", "100%", "6", "#FFFFFF");