Skip to content
Snippets Groups Projects
Commit 7dd60d3d authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Better handling of returning users: don't display the login page.

parent 8f44a405
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,18 @@ class UsersController < ApplicationController ...@@ -53,7 +53,18 @@ class UsersController < ApplicationController
@user_pages, @users = paginate :users, :per_page => 10 @user_pages, @users = paginate :users, :per_page => 10
if params[:id].nil? if params[:id].nil?
if cookies[:user_id].nil?
@hide_logout = true @hide_logout = true
else
user = User.find(cookies[:user_id])
if user.nil?
flash.now[:notice] = "User id " + params[:id] + " not found"
@hide_logout = true
else
flash[:notice] = "Welcome back, " + user.username
redirect_to :controller => "recordings", :action => "list_owned"
end
end
return return
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment