show a confirmation page. Closes #2792.
end
def logout
- if session[:token]
- token = UserToken.find_by_token(session[:token])
- if token
- token.destroy
+ @title = t 'user.logout.title'
+
+ if params[:session] == request.session_options[:id]
+ if session[:token]
+ token = UserToken.find_by_token(session[:token])
+ if token
+ token.destroy
+ end
+ session[:token] = nil
+ end
+ session[:user] = nil
+ session_expires_automatically
+ if params[:referer]
+ redirect_to params[:referer]
+ else
+ redirect_to :controller => 'site', :action => 'index'
end
- session[:token] = nil
- end
- session[:user] = nil
- session_expires_automatically
- if params[:referer]
- redirect_to params[:referer]
- else
- redirect_to :controller => 'site', :action => 'index'
end
end
inbox_attributes[:title] = t 'layouts.inbox_tooltip', :count => @user.new_messages.size
%>
<%= link_to t('layouts.inbox', :count => @user.new_messages.size), {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, inbox_attributes %> |
- <%= link_to t('layouts.logout'), {:controller => 'user', :action => 'logout', :referer => request.request_uri}, {:id => 'logoutanchor', :title => t('layouts.logout_tooltip')}%>
+ <%= link_to t('layouts.logout'), {:controller => 'user', :action => 'logout', :session => request.session_options[:id], :referer => request.request_uri}, {:id => 'logoutanchor', :title => t('layouts.logout_tooltip'), :method => :post, :href => url_for(:controller => 'user', :action => 'logout', :referer => request.request_uri)}%>
<% else %>
<%= link_to t('layouts.log_in'), {:controller => 'user', :action => 'login', :referer => request.request_uri}, {:id => 'loginanchor', :title => t('layouts.log_in_tooltip')} %> |
<%= link_to t('layouts.sign_up'), {:controller => 'user', :action => 'new'}, {:id => 'registeranchor', :title => t('layouts.sign_up_tooltip')} %>
--- /dev/null
+<h1><%= t 'user.logout.heading' %></h1>
+<% form_tag :action => "logout" do %>
+ <%= hidden_field_tag("referer", h(params[:referer])) %>
+ <%= hidden_field_tag("session", request.session_options[:id]) %>
+ <%= submit_tag t('user.logout.logout_button') %>
+<% end %>
login_button: "Login"
account not active: "Sorry, your account is not active yet.<br />Please click on the link in the account confirmation email to activate your account."
auth failure: "Sorry, could not log in with those details."
+ logout:
+ title: "Logout"
+ heading: "Logout from OpenStreetMap"
+ logout_button: "Logout"
lost_password:
title: "Lost password"
heading: "Forgotten Password?"