-<% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>
+<% if STATUS == :database_offline or STATUS == :api_offline %>
<p><%= t 'layouts.osm_offline' %>
</p>
-<% elsif OSM_STATUS == :database_readonly or OSM_STATUS == :api_readonly %>
+<% elsif STATUS == :database_readonly or STATUS == :api_readonly %>
<p><%= t 'layouts.osm_read_only' %>
</p>
<% elsif !@user.data_public? %>
<%= render :partial => 'search' %>
<%
-session[:token] = @user.tokens.create.token unless session[:token]
+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']